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
A Trailing Backslash Hides a Loop From the Guard's Wait-Loop Rule #2442
When a command ends in an unescaped backslash, shlex raises "No escaped character", and _shell_tokens in host-setup/agent-safety/claude/gh-write-guard.py falls back to splitting the line on whitespace. That split fuses each ; into the word before it, such as false; and done;, so no loop keyword sits in command position and the loop goes unread. Bash reads the trailing backslash as a literal and runs the loop.
Reproduce (constructed)
Each of these is allowed on develop, and bash runs the loop:
bash -c 'for i in 1; do echo RAN; done; echo \' prints RAN.
Done looks like
A trailing unescaped backslash is read as a literal character rather than as a reason to fall back, or the fallback splits operators off words. All three commands above are denied, and a self-test row pins each.
Found by a local strict review pass on the #2080 branch. It predates that branch.
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": An unquoted trailing backslash beside a wait loop is not a shape an agent session writes, and the failure is a loud hang.
Activity
ptr727 commentedon Oct 8, 2026
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": An unquoted trailing backslash beside a wait loop is not a shape an agent session writes, and the failure is a loud hang.