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
Closes#819. Four follow-ups from the #739 / PR #818 review.
1. Dangerous-command guard for bypassPermissions (security). The built-in
ReAct engine filters every Bash command through is_dangerous_command();
the delegated claude CLI had unrestricted Bash with no CodeFrame-side
equivalent, and #565 turns externally-authored issue bodies into task
prompts. Registers a PreToolUse hook (hooks fire even under
bypassPermissions) reusing is_dangerous_command verbatim, so both
engines block the same set from one source of truth. Patterns live in a
stdlib-only leaf (core/dangerous_commands.py) and the guard outside the
eagerly-importing adapters package, keeping the per-Bash-call hook cost
at ~142ms rather than ~423ms.
2. Exit-0 clarifications route to a blocker instead of a hard failure.
--print cannot prompt, so a genuine ambiguity is printed and the process
exits clean; the zero-file guard hard-failed it with a misleading
"likely lacked write permission". Tactical questions still fail, by
design.
3. require_file_changes follows what the allowlist grants, not whether one
was passed. An unrecognized tool is assumed write-capable so the unknown
case fails loudly rather than silently disabling the #739 guard.
4. Git errors are logged; empty now means failed, so a transient hiccup was
indistinguishable from "the agent changed nothing".
Verified: guard proven live against the real claude CLI (denied
dd if=/dev/zero of=/dev/null, allowed echo); 4275 tests pass; ruff clean;
diff coverage 96.67%; test-mutation check passes on all 5 new behaviors;
codex cross-family review (pre-PR + posted post-PR) and the GLM bug-hunter
both found no defects.
Known limitation: the guard is advisory-grade, not a sandbox — a regex
matcher an agent that means to evade it can evade, same grade as ReAct's.
0 commit comments