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
Honor the Quote Mask in the _runs_as_command Short-Circuit #2310
_runs_as_command in host-setup/agent-safety/claude/gh-write-guard.py decides whether a bash -c wrapper runs. #2117 lets its walk back honor the quote mask, so echo ';' x bash -c '<loop>' runs no shell. Its _opens_command short-circuit before that walk still reads a quoted ; directly before the wrapper as a separator, so this constructed command is denied although no shell runs:
echo';' bash -c 'until [ -f x ]; do sleep 60; done'
Done looks like
The short-circuit honors the mask where the caller passes one, with a self-test row for the shape above. This is a false deny, not a leak.
Found by a local strict review pass on #2117. It predates that pull request.
The sleep path has the same false deny, since _sleeps calls _runs_as_command with no quote mask at all:
while [ -f x ];doecho";" sleep 1;done
Develop denies it, although echo prints the ; and nothing sleeps. The #2080 branch fixed both shapes by passing the mask and honoring it in the short-circuit. Decision #2367 reverted those changes to keep that branch on eval-only paths, so both stay develop's behavior for this issue to fix. The reverted early return also skipped a quoted assignment before a wrapper, which let GIT_PAGER="/bin/cat" bash -lc '<loop>' through. So the fix here honors the mask only for a quoted separator, never for a quoted word that is an assignment or a prefix.
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The guard backstops an agent's own mistakes, and this is a command shape built to defeat it rather than one an agent session writes, so a miss does not realistically occur. See #2517 for the per-issue reason.
Activity
ptr727 commentedon Oct 6, 2026
The
sleeppath has the same false deny, since_sleepscalls_runs_as_commandwith no quote mask at all:Develop denies it, although
echoprints the;and nothing sleeps. The #2080 branch fixed both shapes by passing the mask and honoring it in the short-circuit. Decision #2367 reverted those changes to keep that branch on eval-only paths, so both stay develop's behavior for this issue to fix. The reverted early return also skipped a quoted assignment before a wrapper, which letGIT_PAGER="/bin/cat" bash -lc '<loop>'through. So the fix here honors the mask only for a quoted separator, never for a quoted word that is an assignment or a prefix.Read an eval's Arguments as a Wait-Loop Payload in the Guard (#2452)
ptr727 commentedon Oct 8, 2026
Declined per #2517, approved by the maintainer, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": The guard backstops an agent's own mistakes, and this is a command shape built to defeat it rather than one an agent session writes, so a miss does not realistically occur. See #2517 for the per-issue reason.