Repository navigation
Description
Purpose
Reduce permission prompts to the cases whose effects escape the sandbox or cannot be undone. The OS sandbox is now the hard boundary (writes limited to the worktree and temp directories, network limited to allowed domains, credential paths unreadable), so prompting for script execution, in-place edits, and read-only inspection inside it buys no safety and costs a prompt every time.
Audit evidence (2026-10-15, after #159 was deployed): 94 hook escalations in one afternoon, 82 of them "syntax" (a glob, $VAR, $(...), or heredoc anywhere in the call), the rest grep/rg/cat arguments that merely contain \ or $ inside quotes. python3 <script>, python3 -c, and uv run python prompt on every call through the ask rules or the auto-mode classifier, and the classifier also denied a read-only grep today.
Scope
- Allow sandboxed script execution:
python3,python,node,uv run python,uv run --frozen python, including-c/-eone-liners. Keepuvx,npx,pnpm dlx,bunx, dependency changes,nix run/shell/develop, and the sandbox escape in ask. Denypython -m piplikepip. - Judge read-only inspection commands structurally instead of by regex: a command whose program is in a read-only set (rg, grep, cat, bat, head, tail, nl, wc, ls, eza, fd, find, stat, file, jq, diff, sort, uniq, cut, tr, which, echo, printf, pwd, date, true, false, test, basename, dirname, realpath, readlink, seq, env) is allowed when it has no redirection to a file; its arguments may contain globs or variables. Command substitution, process substitution, and heredocs still escalate. Globs and variables in any other command still escalate, and a deny prefix that matches literally (
rm -rf $DIR) still denies. - Allow the trivial builtins above so they no longer reach the classifier.
- Allow in-place edits that the sandbox confines to the worktree:
sed -i,perl -i,tee,truncate.rmstays in ask because untracked files cannot be recovered. - Record the decision as ADR-0034, superseding ADR-0031's ask tier, and update the README paragraph.
Out of scope
- The agent-harness renderer.
- Classifier behavior itself; the goal is to reach it less often.
Acceptance criteria
uv run --frozen pytest tests/agentspasses.rg -n "def \w+" agents,rg foo *.py,cat $FILE, andls -la ~/xare allowed byguard_command.py allowed;rg foo > out.txt,cat $(x),git push $FLAGS origin main, andcd $DIRstill escalate;rm -rf $DIRis still denied.python3 scripts/x.py,python3 -c 'print(1)', anduv run --frozen python x.pyare allowed without a prompt;uvx ruffandnpx cowsaystill ask;python3 -m pip install xis denied.- Every new allow prefix has a precise rule or a structural entry, and the generated Claude permissions match.
Activity