agentleFS
neoforge-devneoforge-dev/forge/.claude/skills/auto-security-scan/SKILL.md

auto-security-scan

Skill0 starsChanged 7 months agoMITView on GitHub

Scan code changes for security vulnerabilities (model-invoked)

  • Reads credentials

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
  1. Very specific:

    After editing authentication code (auth/, login, jwt)

    line 16
  2. Distinctive:

    After editing API routes handling user data

    line 17
  3. Distinctive:

    After modifying database queries

    line 18
  4. Distinctive:

    After adding new dependencies

    line 19
  5. Distinctive:

    Look for string formatting in SQL:

    line 39
  6. Distinctive:

    Check for unsanitized output:

    line 50
  7. Distinctive:

    When CRITICAL or HIGH issues are found:

    line 112

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 tokens

2. 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_auth decorators
  • Endpoints without product access checks
  • Hardcoded user IDs in routes

5. Dependency Vulnerabilities

# Python
pip-audit --strict

# Node
npm audit

Severity Levels

LevelDescriptionAction
CRITICALImmediate exploit riskBlock commit
HIGHSignificant vulnerabilityRequire fix
MEDIUMPotential issueWarn, suggest fix
LOWBest practiceInfo 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 low

Integration with Human Gates

When CRITICAL or HIGH issues are found:

  1. Block the action
  2. Escalate to human review
  3. 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"

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.