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
start_task in a nested repository runs that repository's hooks and config outside the sandbox #597
Found by Codex's code review on #590 (the role eval), and it applies to Sonny itself.
What happens. The sandbox protects only the .git at the top of each writable root (src/sandbox.rs). A sandboxed agent can make a repository inside its folder (nested/) and write nested/.git/hooks/post-checkout, or nested/.git/config with core.fsmonitor, a smudge filter, and so on. start_task with folder: "nested" then runs git worktree add in that repository (sonny/src/task.rs, the git(here, &["worktree", "add", ...]) call). That git runs outside any sandbox, as the person. Git runs post-checkout on worktree add, and the config's fsmonitor and filters also run as the person.
Who it reaches. Any row where start_task is allowed without the person seeing it: a model reviewer approving a start, or full. In ask the person approves, but nothing on the card says the folder's git is agent-written.
Precedent in this repo.sonny/src/snapshot.rs and sonny/src/home.rs already pass -c core.hooksPath=/dev/null to the git they run. task.rs doesn't. That flag alone doesn't cover core.fsmonitor, filters, core.sshCommand, or the rest of the repository's own config.
Options
Only start tasks at a folder whose repository's .git is kept from the sandbox (the lead's own repository). A nested one would need the person, or would be refused.
Run that git with hooks off and the repository's config neutralized (-c core.hooksPath=/dev/null -c core.fsmonitor= ...). This is partial, because config has many command-running keys.
Extend the sandbox's PROTECTED names to .git at any depth (Codex protects only the top level too).
The role eval (#590) denies start_task with folder for now. This is a Sonny decision, so it's here for discussion first.
Fourth option: run Sonny's own git worktree add inside the agent's sandbox, allowed to write only the new worktree path and that repository's .git. A hook or config command then runs with no more rights than the agent already has.
Why not option 1 alone:start_task with folder supports a lead in a folder that holds several repositories (for example, a lead in ~/Developer). Refusing nested repositories would break that.
Why not option 3 alone: on Linux, protection is bound per path when a sandbox starts. A single command can git init nested and write its hook before any later sandbox would protect it, so the hook is already there when Sonny's git runs.
The same reasoning already exists for setup.task.rs runs only the lead's own .agents/setup, never a nested repository's, because the nested one isn't kept from the lead's sandbox. The worktree's git needs the same rule.
Activity
Role eval: deny task starts at another folder
lydakis commentedon Nov 1, 2026
Two more points and a revised recommendation.
Fourth option: run Sonny's own
git worktree addinside the agent's sandbox, allowed to write only the new worktree path and that repository's.git. A hook or config command then runs with no more rights than the agent already has.Why not option 1 alone:
start_taskwithfoldersupports a lead in a folder that holds several repositories (for example, a lead in~/Developer). Refusing nested repositories would break that.Why not option 3 alone: on Linux, protection is bound per path when a sandbox starts. A single command can
git init nestedand write its hook before any later sandbox would protect it, so the hook is already there when Sonny's git runs.The same reasoning already exists for setup.
task.rsruns only the lead's own.agents/setup, never a nested repository's, because the nested one isn't kept from the lead's sandbox. The worktree's git needs the same rule.Recommendation: option 4.
Generated by Claude Code
Run Sonny's git in a sandbox where an agent may have written the repo…