auto-security-scan
Skill0 starsChanged 7 months agoMITView on GitHub
Scan code changes for security vulnerabilities (model-invoked)
- Reads credentials
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- harness/CLAUDE.mdCLAUDE.md
- auto-test-runnerSkill
- compactSkill
- content-library-producerSkill
- content-publisherSkill
- fastapi-service-templateSkill
- frontend-designSkill
- human-review-gateSkill
- integration-testerSkill
- ios-agentSkill
- ios-designSkill
- mvp-spec-writerSkill
- niche-explorerSkill
- overnight-dispatchSkill
- pwa-frontend-liteSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
After editing authentication code (auth/, login, jwt)
- Distinctive: line 17
After editing API routes handling user data
- Distinctive: line 18
After modifying database queries
- Distinctive: line 19
After adding new dependencies
- Distinctive: line 39
Look for string formatting in SQL:
- Distinctive: line 50
Check for unsanitized output:
- Distinctive: line 112
When CRITICAL or HIGH issues are found:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auto Security Scan
Automatically scans code changes for common security vulnerabilities. Runs after edits to sensitive files.
When to Use
Automatic triggers (model-invoked):
- After editing authentication code (
auth/,login,jwt) - After editing API routes handling user data
- After modifying database queries
- After adding new dependencies
Manual invocation:
/auto-security-scan- Scan recent changes/auto-security-scan --full- Full codebase scan
Checks Performed
1. Secret Detection
# Check for hardcoded secrets
grep -rn "api_key\s*=\s*['\"]" --include="*.py"
grep -rn "password\s*=\s*['\"][^'\"]+['\"]" --include="*.py"
grep -rn "sk-[a-zA-Z0-9]" --include="*.py" # OpenAI keys
grep -rn "ghp_" --include="*.py" # GitHub tokens2. SQL Injection
Look for string formatting in SQL:
# BAD: SQL injection vulnerable
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")
# GOOD: Parameterized query
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))3. XSS Prevention
Check for unsanitized output:
# BAD: XSS vulnerable
return f"<div>{user_input}</div>"
# GOOD: Escaped output
from markupsafe import escape
return f"<div>{escape(user_input)}</div>"4. Authentication Gaps
- Missing
@require_authdecorators - Endpoints without product access checks
- Hardcoded user IDs in routes
5. Dependency Vulnerabilities
# Python
pip-audit --strict
# Node
npm auditSeverity Levels
| Level | Description | Action |
| CRITICAL | Immediate exploit risk | Block commit |
| HIGH | Significant vulnerability | Require fix |
| MEDIUM | Potential issue | Warn, suggest fix |
| LOW | Best practice | Info only |
Example Output
🔒 Security Scan Results
Scanned files:
- app/api/routes/billing.py
- app/auth/dependencies.py
Findings:
⚠️ MEDIUM: Potential logging of sensitive data
app/api/routes/billing.py:45
> logger.info(f"Processing payment for user {user_id}: {payload}")
Suggestion: Redact payload in logs
> logger.info(f"Processing payment for user {user_id}")
✅ PASS: No SQL injection patterns found
✅ PASS: All routes have auth decorators
✅ PASS: No hardcoded secrets detected
Summary: 0 critical, 0 high, 1 medium, 0 lowIntegration with Human Gates
When CRITICAL or HIGH issues are found:
- Block the action
- Escalate to human review
- Provide fix recommendations
🚨 CRITICAL: Security issue detected
Issue: Hardcoded API key found
File: app/services/payment.py:23
Code: STRIPE_KEY = "sk_live_xxx..."
This requires human review before proceeding.
Would you like to:
1. Fix now (recommended)
2. Escalate to human
3. Skip (not recommended)Configuration
Scan Patterns
SENSITIVE_FILES = [
"auth/",
"login",
"password",
"jwt",
"token",
"secret",
"credential",
"payment",
"billing",
]
SKIP_PATTERNS = [
"test_",
"_test.py",
"mock_",
"fixture",
]False Positive Handling
Mark known false positives:
# security: ignore - test data only
TEST_API_KEY = "test-key-not-real"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

