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
Agent guards: ignore shell comments when matching blocked commands #1057
The agent-guards kit matches blocked commands even inside shell comments (a line like # never run X is refused). Comments should be ignored before matching, with a test that a commented-out pattern passes and the same pattern as a real command is still refused.
Follow-up note from #1108 fix round 1: the PR now covers shell comments only (~/.bashrc and the other start files, and sourced files, read for CLAUDE_CODE_SIMPLE; the command's own comments were already skipped).
Dropped, for a later issue: leaving out comments in Python and JS code (python3 -c / node -e inline code, .py / .js script files, quoted heredocs into an interpreter). Round 0 tried it, and the lens found 16 ways past it (line counting vs Python's tokenizer, # coding: utf-7, language from the file name instead of the program that runs it, JS // inside template literals / /* */ / string continuations, later argv words, joined -cCODE with stdin). Those are kept in #1108 as refused tests; any new attempt must keep them refused and stay to narrow, provable cases.
Activity
agent-guards: a guarded word in a comment is no command (#1057)
agent-guards: read Python and JS code whole, comments too (#1108 fix …
scuttletoby commentedon Nov 27, 2026
Follow-up note from #1108 fix round 1: the PR now covers shell comments only (
~/.bashrcand the other start files, and sourced files, read forCLAUDE_CODE_SIMPLE; the command's own comments were already skipped).Dropped, for a later issue: leaving out comments in Python and JS code (
python3 -c/node -einline code,.py/.jsscript files, quoted heredocs into an interpreter). Round 0 tried it, and the lens found 16 ways past it (line counting vs Python's tokenizer,# coding: utf-7, language from the file name instead of the program that runs it, JS//inside template literals //* *// string continuations, later argv words, joined-cCODEwith stdin). Those are kept in #1108 as refused tests; any new attempt must keep them refused and stay to narrow, provable cases.🤖 Generated with Claude Code
agent-guards: a guarded word in a comment is no command (#1057)
agent-guards: read Python and JS code whole, comments too (#1108 fix …
fix(agent-guards): a guarded word in a comment is no command (#1108)