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
Ask only for commands whose effects leave the sandbox #177
ADR-0034 says to ask only for effects that escape the sandbox, but the allowed-command guard still asks for any approved family whose form is not in the precise allowlist and for any run-time word. Replaying the 151 Bash commands run after #175 through the current hooks gives 58 non-allow verdicts; 56 of them are asks for commands that the sandbox already contains:
44: a variable such as $W or $D passed to git, sed, gh, cat, or mkdir.
7: git commit forms outside the commit pattern (for example -S).
5: other unlisted forms (git branch -D, git branch -r, gh api ... --jq, sed -i '').
1: zsh-only syntax.
Only 2 were real denials (a credential read and find -exec).
Scope
Commands whose effects stay on this machine pass unless a forbidden rule or the dangerous-Git guard denies them, regardless of form or run-time words.
Commands that change GitHub (git push, gh writes) keep their static checks and ask only when a run-time word hides what the check needs, such as the push destination.
Commands outside the sandbox (docker, herdr, watchman) and the existing ask prefixes are reviewed against the same rule.
Out of scope
Changing the forbidden rules or the dangerous-Git denials.
Merging, which stays with the user.
Acceptance criteria
Replaying the same 151 commands asks only where a run-time word hides a GitHub-affecting target, and still denies the 2 forbidden ones.
echo "$(rm -rf x)", a force push inside a loop, and pushes to main are still denied.
An ADR records the change, or ADR-0034 is amended.
Principle: the hooks ask only where a run-time word hides what a check needs to see, and only for effects the sandbox cannot contain. Everything else passes unless a forbidden rule or the dangerous-Git guard denies it.
Allowed guard (guard_command.py allowed).
Drop the "approved family, unlisted form" ask for commands whose effects stay local, and drop the run-time-word ask for local commands.
Keep precise forms only for GitHub-affecting families (gh api methods, gh writes, git push). A run-time word there asks.
Remove the local-command patterns from allowed_commands.json that no longer decide anything (commit, sed, branch, and so on).
Dangerous-Git guard (guard_git.py). Ask for a run-time word only when the word can change the verdict:
a dynamic program or subcommand;
a dynamic word in git push (remote, refspec, or flags);
a dynamic word that could be a flag of a subcommand git_safety inspects (reset, clean, checkout, restore, branch, stash, rebase, and so on).
git -C $W add, git -C $W diff, and a quoted -m "$MSG" pass.
Unsupported syntax. zsh-only expansions such as ${(@f)...} still ask, since the parser cannot see the commands inside.
tools outside the sandbox: docker, herdr control, terraform, esa.
ADR. Record the inversion (allow by default inside the sandbox, ask only for hidden outward targets) as a new ADR that amends ADR-0034.
Verification
TSDD tests per slice in tests/agents/hooks. Existing denial tests stay green: substitutions, clauses, shell heredocs, force push, push to main, and --no-verify.
Replay the 151 commands from the Issue through the new hooks. Expect only GitHub-target asks and the 2 denials.
Full uv run --frozen pytest tests/agents, ruff, ty, and lefthook.
Assumptions
Agent Bash runs inside the sandbox, so local writes are confined to the worktree and temporary directories (ADR-0035).
Codex and other providers harden ask to deny, so fewer asks also means fewer denials there.
Activity
furedea-agent commentedon Oct 17, 2026
Plan
Principle: the hooks ask only where a run-time word hides what a check needs to see, and only for effects the sandbox cannot contain. Everything else passes unless a forbidden rule or the dangerous-Git guard denies it.
Allowed guard (
guard_command.py allowed).gh apimethods,ghwrites,git push). A run-time word there asks.allowed_commands.jsonthat no longer decide anything (commit, sed, branch, and so on).Dangerous-Git guard (
guard_git.py). Ask for a run-time word only when the word can change the verdict:git push(remote, refspec, or flags);git_safetyinspects (reset, clean, checkout, restore, branch, stash, rebase, and so on).git -C $W add,git -C $W diff, and a quoted-m "$MSG"pass.Unsupported syntax. zsh-only expansions such as
${(@f)...}still ask, since the parser cannot see the commands inside.Native ask prefixes (
command_permissions.json). Move local, recoverable ones to allow:ln -s,git stash drop,git stash clear. Keep ask for:rm,kill,pkill;uv add,npm install,npx,nix run,nix shell, and so on;gh pr merge,gh release,gh workflow run,git remote set-url;ADR. Record the inversion (allow by default inside the sandbox, ask only for hidden outward targets) as a new ADR that amends ADR-0034.
Verification
tests/agents/hooks. Existing denial tests stay green: substitutions, clauses, shell heredocs, force push, push to main, and--no-verify.uv run --frozen pytest tests/agents, ruff, ty, and lefthook.Assumptions
build(nix): update agent-config to 0.1.2 (#457)