Security Guidance
Security review for generated code. Three layers:
- Pattern warnings — instant regex-based reminders on
Edit/Writefor ~25 known-dangerous patterns (yaml.load,torch.load(weights_only=False),pickle.loadon untrusted data, rawinnerHTML, hardcoded secrets, etc.). - LLM diff review — sends the diff to a fast LLM call and feeds high-severity findings back to fix them before returning.
- Agentic commit review — on
git commit, an SDK-driven reviewer reads related files (Read/Grep/Glob) to trace data flow across the codebase, catching multi-file vulnerabilities.
Findings cover common web-vulnerability classes — injection, XSS, SSRF, hardcoded secrets, IDOR, auth bypass, unsafe deserialization, and path traversal among others.
Configuration
All configuration is via environment variables. None are required for default behavior.
SECURITY_REVIEW_MODEL controls the LLM diff review. SG_AGENTIC_MODEL controls the agentic commit reviewer.
Kill switches:
SECURITY_GUIDANCE_DISABLE=1ENABLE_PATTERN_RULES=0ENABLE_CODE_SECURITY_REVIEW=0ENABLE_STOP_REVIEW=0ENABLE_COMMIT_REVIEW=0
Higher-recall mode:
SG_DUAL_OR=on
Org-specific policies
Drop a claude-security-guidance.md in ~/.claude/ or <project>/.claude/ to apply organization rules to the security review.