[bug] background subagents in auto mode flood me with permission prompts for safe…
What happened
background subagents in auto mode flood me with permission prompts for safe commands, 15-20 clicks in a few minutes
Summary
In auto mode, a background subagent's Bash calls often get no verdict from the auto-mode reviewer and end up as permission prompts for the human, even for read-only commands.
Cause, from reading the code and the message Claude Code returns: the LifeOSHooks tool.call hook wraps every subagent Bash command in sandbox-exec (SubagentGitSandbox, wrapInline). Claude Code then reports "gave no verdict: a hook changed this call's input after the model wrote it, so the review was of different input from what would run", adds "This is not a judgment that the action is unsafe", and tells the model to issue the call again once.
Seen on 8.761.0 with four background subagents: about 15-20 prompts within a few minutes, for work that only read files. The same command type passes in the main session, which is not wrapped. It is intermittent (bun test passed while ls and bun Places.ts did not), and the agents copying the wrapped text into their retry adds more prompts.
Expected: the git-internals protection stays, and safe subagent commands are judged without reaching the human. The current workaround is telling subagents not to use Bash at all, which rules out any subagent that has to run tests, so unattended work is not practical.
Details
- Kind: bug
- LifeOS version: 8.761.0
Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.
[!NOTE] 🤖 Posted by an AI assistant on behalf of this account
Same here on 8.761.0 with LIFEOS_SUBAGENT_SANDBOX=on, plus a second half that makes it worse when Claude Code's own sandbox is enabled (sandbox.enabled: true):
- A sandboxed subagent Bash call already runs inside Seatbelt, so the
sandbox-execwrap fails every time withsandbox_apply: Operation not permitted(exit 71). No sandboxed subagent command can run at all: 0 of 49 across 17 agents here. - The only way through is
dangerouslyDisableSandbox: true. That sends the call to the auto-mode reviewer, which then often gives no verdict on the rewritten input, as described above (52 of 239 unsandboxed calls here). In the last two runs, four background agents ended with zero commands executed.
A fix for this second half that keeps the protection: when the native sandbox is enabled, put the private trees' .git on the sandbox filesystem write-deny list (everything except objects, index and index.lock, the same set the wrap profile denies today), and have the tool.call hook skip the wrap for calls that run sandboxed. The OS then refuses the same writes for every sandboxed Bash call, main session included.
Applied locally and checked: the wrap is skipped only when the call is sandboxed, sandbox.enabled is true, the denyWrite list carries the .git entries, and the command does not match excludedCommands; anything else is wrapped as before, and the before/after detector still runs on skipped calls. A test subagent then ran ls and git rev-parse sandboxed without a wrapper, and its append to .git/description was refused with operation not permitted.
Two things this does not solve:
- It also blocks a sandboxed main-session commit in those trees, which the current profile does not, so that path needs an unsandboxed route.
- Unsandboxed subagent calls still need the wrap, so they still hit the no-verdict problem from the original report.
[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler
Thanks for reporting this. It's fixed in our tree, in a commit that landed after the 8.761.0 cut, so it ships in the next public release. Closing for now; reopen if you still see it on that release.
Fix: 92459e3bb7 subagent sandbox wrap off by default