Repository navigation
Sandbox: sandboxed bots use the agent CLI through their own socket, capped by caller - #276
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
… a process slot, a child's roots keep what its creator's keep read-only Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
… pass on no root the creator keeps read-only Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…s; children inherit the sandbox without ceilings; take placeholders before a process slot Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…amed or linked; each Seatbelt rule names only its own paths, once Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
… the socket Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…-6zwinw # Conflicts: # docs/DAEMON_MEASUREMENTS.md
…apped to what it may do Each sandboxed bot gets a socket of its own beside the daemon's, bound over the daemon's path in bwrap and allowed by Seatbelt, and named by AGENT_SOCKET, so the agent CLI works in its shell. Requests on it answer as that bot: no configure, answers, tool results, serving approvals or shutdown; what it makes is its own and inherits its sandbox inside its folders; it removes only its own bots; what it sends reads as its own. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
… only the answered tools its maker passes on Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…to claude/project-thread-6zwinw # Conflicts: # docs/RUST_PROTOTYPE.md # src/sandbox.rs # src/server/mod.rs # src/server/turn.rs # src/tools.rs # tests/test_approvals.py # tests/tool_contract.rs
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (2)
ℹ️ 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. |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 3ad1ecaa54
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
The test's own socket sat beside the daemon's, so hiding the folder of bots' sockets hid the daemon's path too; the daemon keeps them in SOCKET.d/. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfe1141b7d
ℹ️ 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 folder a bot was given can sit in one its creator may write, and the creator can swap a link in for it later; bound by its path, bubblewrap would follow that link. Each root is now opened folder by folder without following links, refused if one was swapped in, and bound from that descriptor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b0e9bbff0
ℹ️ 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".
…lose a bot's socket with it A fork keeps its source's declared tools, so forking a bot whose tools a client answers is held to what the caller may pass on, as create is. A turn's folder becomes the bot's, so one given to any sandboxed bot must be the caller's to write. A deleted or expired bot's own socket is closed and removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
|
@codex review 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: fbd8aaada7
ℹ️ 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".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: fbd8aaada7
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
… sockets off the runtime thread Pinned descriptors outlived bubblewrap into the command itself, which could reach the host's folders through them. Each confined call builds its policy anew, off the runtime thread, so a root that a link was swapped in for since is refused there instead. Closing a deleted bot's own socket takes a lock and unlinks a file, so it runs on a blocking worker. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…-6zwinw # Conflicts: # docs/DAEMON_MEASUREMENTS.md
…-6zwinw # Conflicts: # docs/DAEMON_MEASUREMENTS.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c58f65baf4
ℹ️ 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".
…rred attribution stable across retries A caller whose allowed list leaves out a client-answered tool can't declare it for a bot it makes, nor have a new bot inherit it. A submit on a bot's own socket without from is named by the caller's name as origin, never by whatever turn it runs then, so a retry is the same request. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
|
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 review 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: 9e834d947b
ℹ️ 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".
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…ts source's allowed list Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c679356ed
ℹ️ 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".
…-6zwinw # Conflicts: # docs/DAEMON_MEASUREMENTS.md
The store answers a resent fork before it looks up the source, so a client recovering a lost response still gets the fork it made. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
#265 denied the daemon's socket to every sandboxed command, which also took the
agentandsonnyCLIs away from sandboxed bots. Those CLIs are how bots delegate, message each other and report back. This PR brings them back and limits each request to what the calling bot may do. It also closes the earlier finding that a confined command could answer its own approvals or reconfigure its gates.What changes
SOCKET.d/BOT_ID, beside the daemon's.agentfinds it at the usual place. A read-only tmpfs hides the folder that holds the bots' sockets.AGENT_SOCKETnames the socket the command should use..d/ID), sandboxed commands get no way in, as before.not_permitted.configure,answer,tool_result,serve_approvals,renew_approvalsandshutdown.createandfork:Settings::under).writablefolders, plus a fork's source's, must be folders the caller can write.allow: []only answers questions, so it may be of any bot.createthat declares them and to a fork whose callable tools include them. Otherwise a bot could get a client to act on its behalf.submit:origin. Afromnaming another bot is refused.delete,prune,compactandinterrupt: only on the caller itself or a bot it made.sandbox_unavailable). A bot may write the folder above a folder it gave a child, so following that link would carry the child's sandbox elsewhere. Each confined call builds its policy anew, off the runtime thread, so the swap is caught on the next call.inspect_id.Known gaps, declined here:
Performance
A matched screen against main is recorded in
docs/DAEMON_MEASUREMENTS.mdunder "Sandboxed bots' own sockets". Every measure's range overlaps between the two builds. Each request adds one hash lookup. The rest of the new work runs only on a bot's own socket, or on a sandboxed bot's confined call.Tests
$AGENT_SOCKET. The test checks that:configure,answerandshutdownare refused.workspace-write.allow: []fork works.AGENT_SOCKETis the daemon's path.reach()picks the right path per platform.cargo test --workspacewithAGENT_TEST_SANDBOX=1passes.tests.run --jobs 4, all 42 modules) passes.macOS isn't run here. The Seatbelt rules follow the existing socket deny, and a check on a Mac is still to do.
🤖 Generated with Claude Code