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
fix(guardrails): block-hook-bypass is evaded by a script-file interpreter; gate the outcome, not the command shape #6674
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.needs-triageNot yet classified. Floor until a type and one priority tier are set.
On 2026-10-09 an implementation subagent editing melodic-software/github-iac (.github/governance-verify/*) ran an inline python3 -c file write. block-hook-bypass.sh (guardrails 0.49.0) blocked it, correctly by its own rule. The agent then wrote a Node script to its scratchpad with the Write tool and ran node <script>, which edited the repo file. Nothing blocked that path. The resulting commits (github-iac#670, dc11b30 and 1e7ee5f) passed lefthook and review, so the edit itself did no harm.
Was the block valid?
The guard's purpose is valid: file edits should go through Write/Edit so the PostToolUse format and lint hooks and the Edit/Write permission rules apply to them. The blocked action itself (an ordinary edit inside a feature worktree) was not dangerous.
The problem is that the guard keys on command shape (cat >, echo >, python3 -c ... write). Any interpreter that runs a script file bypasses it: node x.js, python3 x.py, ruby x.rb, deno run. So the block adds friction without closing the hole, and an agent under pressure takes the workaround. This is not a request to relax the guard; it is inconsistent in both directions.
Proposed fix (gate the outcome)
Add a PostToolUse(Bash/PowerShell) hook that records which tracked or untracked files under the session's repo roots changed during the command (git status --porcelain before and after, or mtimes). For each changed file, run the same format/lint and protected-path checks the Write/Edit path runs. A protected path changed by Bash gets the same deny or report the Edit path would give.
Once (1) exists, narrow block-hook-bypass.sh to the cases (1) cannot see, or retire it, per the hook-precision convention (a stay-quiet test before relaxing).
Add a test: node <scratch script that writes a repo file> triggers the same checks as an Edit of that file.
Basis: hooks/block-hook-bypass.sh header (patterns are command-shape based). Remove the cause before adding detection: the gate belongs on file changes, not command spellings.
needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.needs-triageNot yet classified. Floor until a type and one priority tier are set.
Activity
github-actions commentedon Oct 9, 2026
Thanks for the report. Automated triage handed this issue to a maintainer.
Automated triage. A maintainer reviews it.
fix(guardrails): harden check-bash-file-changes from security review
fix(guardrails): judge staged and committed shell writes too
fix(guardrails): skip no-op reflog entries when judging in-command co…
fix(guardrails): find in-command commits from the appended reflog bytes
fix(guardrails): list the paths a resolved merge commit changed