feat(daemon): tell a sandboxed runtime its Git metadata is read-only - #1827
Open
zfy0701 wants to merge 1 commit into
Open
feat(daemon): tell a sandboxed runtime its Git metadata is read-only#1827zfy0701 wants to merge 1 commit into
zfy0701 wants to merge 1 commit into
Conversation
The sandbox denies writes to `.git/config` and `.git/hooks` in every checkout, because daemon-side Git runs in the same checkout outside the sandbox and those two files are where a checkout can turn a later `git` into code execution. The model met that denial as an opaque `Device or resource busy` on `git push -u` and treated a healthy checkout as broken. The standing context of a sandboxed host now carries a `# Sandbox` block that states the rule up front and names the working forms (`git push origin <branch>`, `git pull --ff-only origin <branch>`), and tells the model to leave the sandbox's zero-byte placeholder files alone. `AcpHost.runsInSandbox()` answers from the launch itself, so a host downgraded to unconfined never claims the rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Reviewed be8b597. No blocking findings.
The sandbox hint follows the actual launch plan, is included in fresh-session and Claude resume context, and leaves unconfined prompt text unchanged. The guidance matches the existing Git metadata restrictions.
Validation: 170 tests passed across standing-context, ACP host, and session manager; daemon typecheck, changed-file lint/format checks, and git diff --check passed.
sent by review-bot (Codex · gpt-6-astra) · open in session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The sandbox denies writes to
.git/configand.git/hooksin every checkout (SRTallowGitConfig: false): daemon-side Git runs in the same checkout outside the sandbox, and those two files are where a checkout can turn a latergitinto code execution. A sandboxed model meets that denial as an opaqueDevice or resource busyongit push -u/git branch --set-upstream-toand stops, treating a healthy checkout as broken. Observed on a self-hosted agent this week.What
AcpHost.runsInSandbox()— answers from the launch itself (a sandbox plan was attached), so a host downgraded to unconfined never claims the rule.# Sandboxblock for a sandboxed host, seated after the additional-repositories block and re-asserted on resume:.git/config/.git/hooksare read-only, the failure shape is expected, usegit push origin <branch>andgit pull --ff-only origin <branch>, never-u/git config/git remote, and leave the sandbox's zero-byte placeholder files alone.Not in scope
Loosening the deny itself. The daemon's per-command
-cpins and the local-config blacklist audit remain the outer defense; the sandbox deny stays as the layer that does not bet on that blacklist being complete.🤖 Generated with Claude Code