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
Section 1 (Tool Security & Least Privilege) covers authorization middleware outside the agent's context, but not pre-execution hooks. That hook is where coding agents (Claude Code and similar CLI and IDE agents) expose this enforcement point for shell commands, file edits and pushes. The sheet doesn't cover the pitfalls specific to hooks: a hook that lets the action run when the hook itself fails, project-level hook config the agent can edit, and secret checks that look at filenames instead of contents.
How should this be resolved?
Add a short subsection at the end of Section 1, after Tool Authorization Middleware:
enforce at the pre-execution hook and parse the pending action;
judge secrets by content and follow data to network calls;
fail closed, and deploy hooks through managed settings the agent can't edit;
return the reason when an action is blocked, and start in log-only mode;
state the limits: a hook only sees what the agent sends through it.
Citations would be the Claude Code hooks and settings documentation and Anthropic's published permission-prompt data. I'll wait for discussion and approval before opening a PR.
This refiles #2961, which I filed through the API by mistake, so the template labels were missing. #3002 proposes a shorter Do and Don't version for the Secure Coding with AI Cheat Sheet. If you'd rather keep this guidance in one sheet, I'm happy to do that and link it from the other.
Disclosure: drafted with AI assistance (Claude); I checked every citation against its source.
Activity