Repository navigation
Daemon: sandbox a bot's commands, writes and edits as Codex does - #265
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (6)
ℹ️ 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 Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85e2ca3961
ℹ️ 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: 85e2ca3961
ℹ️ 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc13380ceb
ℹ️ 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: fc13380ceb
ℹ️ 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.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
012daeb to
f6de576
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6de576508
ℹ️ 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: f6de576508
ℹ️ 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.
… 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
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a219bc807
ℹ️ 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".
… 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
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0760bd8626
ℹ️ 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".
…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
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00ae9aef11
ℹ️ 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".
…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
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1782065bc1
ℹ️ 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: 1782065bc1
ℹ️ 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 socket Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHSSeQctmSznfdNuRg
…-6zwinw # Conflicts: # docs/DAEMON_MEASUREMENTS.md
#271) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
…-only first Codex's guardian sees only what would leave the sandbox and runs as a read-only agent turn that may inspect before it answers. Now the daemon sandboxes bots (#265), the approver does the same: - The state gains `sandbox` (mode, writable folders, network) for a sandboxed bot, and the policy carries Codex's investigation and execution-environment sections: an escalation or a retry after a sandbox denial is not suspicious in itself, the justification is untrusted, and tools are called only when they would flip the outcome. - Where a sandbox runs, a model judge's base has `shell` and `read` in a read-only sandbox (no writes, no network), and each round's fork starts in the bot's workspace. Elsewhere it has no tools, as before. - A judge base from an older approver, its policy since changed, is remade instead of refused as a bot that is not a judge: a judge is known by its instructions' first sentence and its read-only tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NSAn6KdbZwnLbDoimEJpTZ
This is the daemon half of the sandboxing design: lead and task sandboxes, aligned with Codex. Sonny's half comes next in its own PR.
What changes
--sandbox read-only|workspace-write|danger-full-access,--writable PATH(repeatable, made absolute) and--network.inspectandlsreport them.writableandnetworkrequireworkspace-write.writablefolder is stored by its real path, and a missing one ispath_not_found. There are at most 64, taking 32 KiB of JSON.src/sandbox.rs):shell(foreground, background, lifted and detached) runs under bubblewrap on Linux and Seatbelt on macOS. The bwrap arguments and the Seatbelt profile are ported from Codex'slinux-sandboxandsandboxingcrates. Its three.sbplfiles are copied verbatim (seeNOTICE).workspace-writecan write the bot's folder, thewritablefolders,$TMPDIRand/tmp..git(and a worktree's gitdir when the folder holds it),.agents,.codex,.aws, and the store's files..git,.agentsor.codex.sandbox_unavailable.--network./dev/nullis bound read-only over it; on macOS, Seatbelt denies it. Nothing confined can drive the daemon, so a sandboxed bot delegates through tools its client declares.PATH, and probed once on a blocking worker.writeandedit: a confined call is checked against the same folders by its real path, and a denied one giveswrite_denied.apply_patch. The daemon starts the agent binary asagent --agent-run-as-write PATHunder bwrap or Seatbelt, with the content on stdin. That way a link swapped in after the check can't carry the write out.shellschema shows Codex'ssandbox_permissionsandjustificationfields. An escape is either ashellcall with"require_escalated", or awrite/editthat names a path outside the writable folders.escalation_refused; a write stays confined and getswrite_denied.created_by) or forks takes the creator's sandbox andwritablefolders unless it names a stricter sandbox. It reaches the network only if both do. This is how Codex's subagents inherit their parent's sandbox.sandbox_unavailable: no bwrap, user namespaces off, or no/usr/bin/sandbox-exec..gitread-only over.bubblewrapin both jobs and allows unprivileged user namespaces, which Ubuntu 24.04 blocks by default. It setsAGENT_TEST_SANDBOX=1so the sandbox tests fail rather than skip.Performance
Matched screens against main are recorded in
docs/DAEMON_MEASUREMENTS.mdunder "Sandbox (#265)".Not in this PR
apply_patch(apply_patch: Codex's patch tool beside edit, freeform on Responses #254): it gets the same in-sandbox write once it lands.Tests
.git, to the store and to a fresh.gitare refused.write/editgivewrite_denied, including through a symlink out and a dangling link.write_denied..git, paths go in only as parameters, and the socket deny is present..gitrefuses.cargo test --workspacewithAGENT_TEST_SANDBOX=1, clippy and fmt pass locally.🤖 Generated with Claude Code