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
Deny a Hook-Bypass Commit or Push Nested Past the Write Guard's Wrapper Cap #3010
Raised by CodeRabbit on the develop -> main promotion #3002, against the substitution-body readings host-setup/agent-safety/README.md describes (added in #2994 and #3001).
_check_bypass_flags in host-setup/agent-safety/claude/gh-write-guard.py collects overflow from _embedded_wrapper_commands, but reads it only for gh pr merge --admin. A git commit --no-verify, a git push --no-verify, or a core.hooksPath override inside a body nested past _WRAPPER_NESTING_LIMIT reaches none of those checks, so the command is allowed.
A constructed probe, git commit --no-verify -m x wrapped in six levels of bash -c '...', is allowed by both origin/main's guard and develop's, while the same command under two levels is denied. So this predates #2994 and the promotion does not introduce it. #2994 reads substitution bodies through the same capped walk, so a deep enough substitution body joins the same gap.
This is the bypass-flag instance of the class #2943 "Other Rules Past the Wrapper Nesting Cap" names, which lists rule 6 and the gh-write rules but not this check.
Fix Shape
In _check_bypass_flags, deny where overflow holds a body that names a git commit or push (the reading _names_push and a commit counterpart give), the way the push check already returns "wrapper shells or substitutions nested deeper than the guard reads". Keep the quoted eval exception. Add _GIT_CASES rows for a nested-past-the-cap --no-verify commit and push, and a hooks-path override, with an allowed control below the cap. Then qualify the README statements to say nested bodies are read up to the cap and a git commit or push past it is denied.
Activity
ptr727 commentedon Oct 15, 2026
Claimed for an engineering-track lane (handoff #3040 resume). Branch:
feature/guard-hidden-commands-3010. Predicted file set:host-setup/agent-safety/claude/gh-write-guard.py,host-setup/agent-safety/claude/test_install.py,host-setup/agent-safety/README.md,host-setup/agent-safety/claude/README.md.Read Commands Hidden in Config, Environment, Aliases, and Other Shell…
Promote the Write Guard's Hidden-Command Readings to Main (#3064)