Repository navigation
Sandbox follows Codex: every Unix socket with the network on, file pages in the browser - #526
Conversation
…ges in the browser George, 10-31: follow what Codex does, and don't limit the user from doing useful things; where an earlier choice was stricter than Codex, Codex wins. - An agent that reaches the network reaches every Unix socket, as Codex's full network does, so MCPX, Docker and ssh-agent just work and a test suite may listen on its own. One kept off the network still reaches only those its row's unix_sockets names. On macOS the Seatbelt blanket deny goes and AF_UNIX sockets may be made and bound; on Linux the seccomp block applies only with the network off. - The daemon's socket and other bots' stay out of reach either way; on macOS a hard link to them is refused (file-link), as one in the agent's folder would otherwise name them. - `sonny zen`, which an agent's shell runs and which writes only Sonny's state, is let out of every sandbox (OWN_UNSANDBOXED). - The browser tool opens file pages anywhere and takes --new-tab, as the sandbox reads anywhere; writes still stay in the agent's folder. - tests/test_workflows.py: useful work in each permission row (the agent and sonny CLIs, an MCPX socket, a suite with its own servers, commits, a write outside the folder that asks once and then is always allowed). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a252736f6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… out A command prefix let out of the sandbox is matched by its words, so a `sonny` earlier on PATH in a folder the agent writes would have run outside it. As Codex adds its own folders to the roots it may write, every row that writes now writes ~/.agent/sonny/zen, and nothing new leaves the sandbox. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 806d53c4f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A row of the person's that writes no folder of its own was no longer recognised once the zen folder was added, and fell back to auto. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae3edec4f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
A folder Sonny writes may now be one a sandboxed agent writes too (the zen folder): a link left by the temporary's name would have been written through, truncating any file. The temporary is made exclusively, without following a link, and its mode set on the file opened. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
@codex security review This PR's automatic security review failed on the usage limit; it is one of the riskier rows in #531 (sandbox: every Unix socket with the network on). Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f056187e4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && writable.len() < MAX_WRITABLE | ||
| && let Some(zen) = zen_root() | ||
| { | ||
| writable.push(json!(zen)); |
There was a problem hiding this comment.
Harden zen reads before granting agents directory write access
A sandboxed bot can now replace a focus file with a FIFO, causing the unsandboxed Sonny window to hang indefinitely: zen::focus_in() calls blocking std::fs::read_to_string(), and App::zen_taken_up() invokes it directly while handling turn completion and accepted/steered events. Because this directory is shared, a bot can also target another bot's window. I reproduced the blocking read with the actual focus_in() implementation. Before exposing this directory, make focus reads reject non-regular files using a nonblocking open and descriptor-based validation, so checking the file type cannot itself race with replacement.
Useful? React with 👍 / 👎.
|
@codex security review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…541) The Sandbox section said a sandboxed bot reaches only the Unix sockets its unix_sockets names, network on or off; since #526 that holds only with the network off. install.sh and the formula called bubblewrap the daemon's default sandbox; the daemon confines nothing unless asked, and it is Sonny's agents that are sandboxed by default. APPROVALS.md said the automatic approver was not built and that any bot's shell reaches the daemon and the approval channel; scope those to unsandboxed bots and allowed escalations, pointing at the sandbox section.
George, 10-31: "We should follow what Codex does, and we should not limit the user from doing useful things." Where an earlier choice (#508, #514, #515) was stricter than Codex, Codex wins.
What changes
unix_socketsnames (Codex's network off reaches none).(deny network-outbound (remote unix-socket))is gone, and AF_UNIX sockets may be made and bound.file-link), since a link in the agent's folder would otherwise name them. The macOS CI job checks this.sonny zenworks in Auto and Ask me. As Codex adds its own folders to the roots it may write, every row that writes now also writes~/.agent/sonny/zen(made 0700). Nothing new leaves the sandbox: an earlier draft letsonny zenout by prefix, which asonnyearlier on PATH could have hijacked./permissionsstill recognises a custom row with the zen root added.client::files::replace_mode):create_newwithO_NOFOLLOW, mode set on the open file, so a link planted at the temporary's name is never written through.file://pages anywhere, since the sandbox reads anywhere, Codex's included, and it takes--new-tab. Writes still stay in the agent's folder.tests/test_workflows.py(George's idea): useful work in each permission row.sonny zenin every row but Read only).Left as is
Tests
cargo test --workspace, clippy-D warnings, fmttests.test_served,tests.test_approvals,tests.test_workflows(Linux, bubblewrap, agent-browser)a_sandboxed_command_reaches_only_the_sockets_it_namesnow covers the hard link and a server of the agent's own. It runs on the macOS CI job.Security review owed (Codex security reviews are out of usage): listed in #531.
🤖 Generated with Claude Code