You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sandbox: protect nested repositories' .git, not only the root's #414
The daemon's sandbox (src/sandbox.rs, PROTECTED / GIT_PROTECTED) keeps .git read-only only at the top of a writable root. When a bot's root is a folder that holds repositories, which is common for a workspace folder that isn't git itself (ws/src/api, ws/src/web, …), a sandboxed bot can write ws/src/api/.git/hooks/* and .git/config (core.fsmonitor, filters, core.hooksPath…). Anything that later runs git there as the person then runs the bot's program outside the sandbox:
Codex: protects .git at the top of a writable root only, so it has the same gap.
Claude Code: its sandbox reportedly denies writes to .git/hooks and .git/config at any depth.
Open questions, to discuss before any daemon change:
How to find nested .git folders cheaply in very large workspaces with deep trees and big caches. Options are scanning at sandbox setup, a depth limit, or seatbelt regex rules on macOS and their Linux equivalent.
Whether a .git the bot makes after the sandbox starts needs covering, as PROTECTED_MISSING does at the root.
Until then, Sonny could run git worktree add for a folder repository with hooks off (-c core.hooksPath=/dev/null). That only covers the reported vector: filters and fsmonitor stay open, so it is a stopgap, not the fix.
Activity
Sonny: each repository inside an agent's folder keeps what git runs
Sonny: each repository inside an agent's folder keeps what git runs (#…
Sandbox: no nested repos, ssh config from the person's copy, shell wo…
Sandbox: no nested repos, ssh config from the person's copy, shell wo…