Security Audit Skill
A portable security auditing skill that teaches AI coding assistants to become expert security auditors. Works with Claude Code, Codex CLI, Cursor, and any AI that can learn from prompts.
What is This?
This is not a tool you install and run. It's a skill - a set of instructions and patterns that teach an AI assistant how to perform comprehensive security audits on any codebase.
Think of it like giving your AI assistant a security certification.
Why a Skill Instead of a Tool?
Traditional Tool | AI Skill |
Runs regex patterns mechanically | Understands context and intent |
Fixed rules, many false positives | Can reason about actual risk |
Only finds exact pattern matches | Can identify novel vulnerabilities |
Reports everything, you filter | Prioritizes what matters |
Just flags issues | Explains why and how to fix |
An AI with security knowledge can:
Follow data flow across functions and files
Understand your specific architecture
Explain attack scenarios in context
Suggest fixes that match your codebase style
Answer follow-up questions
Quick Start
Claude Code
Copy the skill file to your project or global config:
Then ask Claude Code to audit your code:
Codex CLI
Add the skill to your Codex instructions:
Or reference it in your Codex config:
Cursor / Other AI Editors
Add to your rules or system prompt:
Open settings/rules
Add the contents of
skills/security-audit.mdOr reference it: "For security audits, use the methodology in skills/security-audit.md"
Any AI Chat
Simply paste the skill content before your question:
What Gets Detected
Critical (Fix Immediately)
SQL Injection - Concatenated queries, f-strings in execute()
Command Injection - exec() with user input, shell=True
Medium Priority
XSS - innerHTML, dangerouslySetInnerHTML, document.write
SSRF - User-controlled URLs in fetch/axios/requests
Path Traversal - User input in file operations
NoSQL Injection - Variable objects in MongoDB queries
Low Priority
Template Injection - Variable templates
Debug Code - alert(), console.log with sensitive data
Beyond Pattern Matching
The AI can also review:
Authentication & session handling
Authorization & access controls
Cryptography usage
Dependency vulnerabilities
Security headers & configuration
Secrets management
Error handling
Files
security-audit.md
The complete skill teaching:
Systematic audit methodology
Taint analysis (tracking untrusted data)
Vulnerability patterns with examples
Language-specific guidance (JS/TS, Python, React)
Fix recommendations
Output format
vulnerability-patterns.md
Quick reference containing:
All detection patterns in table format
Regex patterns for grep/ripgrep
Severity classifications
Taint source patterns
Example Session
Risk: Attacker can inject SQL via the id parameter to extract or modify database contents. Fix:
Medium Issues (2)
Path Traversal at line 31
...
Recommendations
Use parameterized queries throughout
Add input validation middleware
Consider using an ORM like Prisma
Add Framework-Specific Rules
Extend skills/security-audit.md with your framework's security considerations:
Philosophy
Zero network calls - Everything runs locally in your AI's context
Teach, don't just flag - The AI explains vulnerabilities, not just lists them
Context-aware - The AI understands your code, not just pattern matches
Portable - Works with any AI that can read markdown
Extensible - Add your own patterns and rules
Contributing
Add patterns, improve explanations, support more languages:
Fork this repo
Edit files in
skills/Submit a PR
License
MIT - Use freely, contribute back if you can.