All Guides

AI Coding

AI Security Scanning Checklist

53 things to test and 15 copy-paste prompts for finding vulnerabilities in your code with Claude. Includes a 30-minute quickstart, scoping tips for large codebases, and honest limitations.

AI Security Scanning Checklist

53 Things to Test + 15 Prompts for Security Scanning with Claude

πŸ“₯ Download this guide as Markdown β€” save it, share it, drop it in your team's repo.

As AI-generated code becomes the norm, automated security scanning becomes essential. Most developers using AI to write code aren't security experts. These tools close that gap.


🎯 WHERE AI SCANNING ADDS THE MOST VALUE

Traditional static analysis tools are great at pattern-matching known vulnerability signatures. AI scanning shines where they can't β€” understanding how your code actually works:

AI Scanning Sweet SpotWhat It Catches
Business logic flawsRace conditions, state transition bypasses, duplicate processing bugs
Broken access controlHorizontal privilege escalation, IDOR, authorization gaps across components
Complex data flow issuesTracing untrusted input across multiple files and trust boundaries
Cross-component interaction bugsVulnerabilities that only appear when you understand how pieces connect

If you're short on time, focus your AI scanning here. These are the vulnerabilities that slip past traditional tools and human code review.


⚑ QUICKSTART β€” 30 MINUTES, 3 PROMPTS

Don't have time for the full guide? Run these 3 in order:

StepPromptTimeWhy First
1Secrets Scan (Prompt 6)~5 minAlmost always finds something
2API Endpoint Audit (Prompt 5)~10 min/serviceFinds auth and validation gaps
3Auth Deep Dive (Prompt 4)~15 minYour highest-value attack surface

Once you've fixed what these find, come back and work through the full checklist.


SECTION 1: THE 53-POINT CHECKLIST

πŸ”΄ Business Logic & Access Control β€” AI's Sweet Spot

#Check
1Race conditions in payment or inventory flows
2Business logic bypass (skipping steps in multi-step processes)
3Integer overflow in quantity or pricing calculations
4Time-of-check to time-of-use (TOCTOU) bugs (value changes between validation and use)
5Insufficient validation of state transitions
6Duplicate transaction processing
7Role-based access control bypass (horizontal privilege escalation)
8Broken object-level authorization (IDOR)

🟠 Authentication & Session Management

#Check
9SQL injection in login forms (parameterized queries?)
10Brute force protection on auth endpoints
11Session token entropy and expiration
12Password reset flow vulnerabilities (token reuse, email enumeration)
13JWT validation (signature verification, algorithm confusion)
14OAuth redirect URI validation
15API key exposure in client-side code or logs

🟑 Input Validation & Injection

#Check
16Cross-site scripting (XSS) in all user inputs
17Stored XSS in database-rendered fields
18SQL injection in search, filter, and sort parameters
19Command injection in file upload handlers
20Path traversal in file access endpoints
21Server-side request forgery (SSRF) in URL parameters
22XML external entity (XXE) in parsers
23Template injection in server-side rendering

πŸ”΅ API Security

#Check
24Missing rate limiting on sensitive endpoints
25Mass assignment vulnerabilities (extra fields in POST/PUT)
26Verbose error messages leaking stack traces
27Missing input validation on API parameters
28GraphQL introspection enabled in production
29Unauthenticated endpoints exposing data

🟣 Data Handling

#Check
30Secrets hardcoded in source code
31PII stored unencrypted in database
32Sensitive data in URL parameters (logged by proxies)
33Missing encryption in transit (HTTP endpoints)
34Insecure deserialization
35Database credentials in config files committed to git

βš™οΈ Infrastructure & Config

#Check
36Debug mode enabled in production
37Default credentials on admin panels
38Missing security headers (CORS, CSP, HSTS)
39Exposed admin or monitoring endpoints
40Outdated dependencies with known CVEs
41Docker container running as root

πŸ“ File Uploads & Storage

#Check
42Content-type validation (don't trust client-provided MIME types)
43Filename sanitization (path traversal via crafted filenames)
44File size limits and zip bomb protection
45Storage permissions (uploaded files shouldn't be publicly executable)

πŸ–₯️ Frontend Security

#Check
46Dangerous rendering patterns (React's dangerouslySetInnerHTML, Vue's v-html)
47Sensitive data in client-side state or localStorage
48Client-side routing auth bypasses

πŸ“¦ Supply Chain & Dependencies

#Check
49Dependency confusion (private vs public package names)
50Typosquatting risk in package imports
51Pinned vs floating dependency versions
52Build pipeline injection points
53Third-party script integrity (SRI hashes)

SECTION 2: 15 COPY-PASTE PROMPTS

Each prompt is in a code block β€” copy it directly into Claude Code, ChatGPT, or your AI tool of choice.

Prompt 1: Full Codebase Investigation

Investigate this codebase for security vulnerabilities. Start by mapping the
architecture and data flows, then systematically examine each attack surface.
For complex findings, trace the full exploitation path from entry point to
impact. Prioritize vulnerabilities that are difficult for static analysis
tools to catch β€” business logic flaws, race conditions, and cross-component
interaction bugs. For each finding: explain the attack vector in plain
English, rate severity (critical/high/medium/low), and provide a specific
code fix.
πŸ’‘ Tip: For large codebases, this broad prompt can produce noisy results. Break it down β€” scan by module, service, or file group instead. For smaller codebases (<5K lines), running it all at once works well.

Prompt 2: Data Flow Tracing

Trace all data flows from user input to database and output in this codebase.
Identify every point where untrusted data crosses a trust boundary without
proper validation or sanitization. Map the complete attack surface. Show me
the path each type of user input takes through the system, and flag anywhere
it's used without being properly escaped or validated.

Prompt 3: False Positive Verification

For each vulnerability you identified, attempt to disprove it. Could this be
a false positive? What conditions would need to be true for this to actually
be exploitable? Are there mitigating controls elsewhere in the codebase that
prevent exploitation? Re-examine each finding and drop anything you can't
confidently confirm is a real, exploitable issue.

Prompt 4: Authentication Deep Dive

Focus specifically on authentication and authorization in this codebase.
Check for: SQL injection in login, session management issues, JWT validation
problems, password reset vulnerabilities, and any way to escalate privileges.
Trace the complete auth flow from login to session creation to permission
checks.

Prompt 5: API Endpoint Audit

Review every API endpoint in this codebase. For each one, check: is it
authenticated? Is there rate limiting? Are inputs validated? Can an attacker
access other users' data by changing IDs? List every endpoint with its
security status.

Prompt 6: Secrets and Credential Scan

Search this entire codebase for hardcoded secrets, API keys, passwords,
tokens, and credentials. Check source code, config files, environment
templates, and comments. Flag anything that should be in environment
variables instead.

Prompt 7: Input Validation Sweep

Find every place in this codebase where user input is processed. For each
one, check: is it sanitized? Could it be used for XSS, SQL injection,
command injection, or path traversal? Provide the specific fix for each
vulnerability found.

Prompt 8: Race Condition Hunter

Analyze this codebase for race conditions, especially in: payment processing,
inventory management, account balance updates, file operations, and any
shared resource access. Explain each race condition with a concrete attack
scenario. Note: static analysis has a high false positive rate for race
conditions β€” flag only cases where you can demonstrate a realistic
exploitation path, not every non-atomic operation.

Prompt 9: Payment & Billing Security

Review all payment-related code in this codebase. Check for: webhook
signature verification, price manipulation in client-to-server flows (can a
user modify the amount sent to the payment processor?), idempotency key
handling, proper error handling for failed charges, and secure storage of
payment-related data. Verify that pricing logic lives server-side, not
client-side.

Prompt 10: Dependency Risk Review

Review all dependencies in this project. Check for: dependency confusion
risks (private package names that could be squatted), packages that should be
pinned to specific versions, unmaintained packages, and any unusual or
unnecessary dependencies that increase attack surface. Prioritize by risk.
⚠️ Important: For actual CVE scanning, use dedicated tools like npm audit, pip-audit, Trivy, or Snyk. AI models have a training data cutoff and cannot reliably identify recently published vulnerabilities. Use this prompt for structural dependency risks, not CVE lookups.

Prompt 11: Before-Deploy Checklist

I am about to deploy this to production. Run a pre-deployment security check.
Verify: debug mode is off, error messages don't leak internals, security
headers are set, admin endpoints are protected, and no test credentials
remain. Give me a go/no-go.

Prompt 12: Patch Writer

For each vulnerability you found, write the exact code patch I need to apply.
Include the file path, the current vulnerable code, and the fixed version.
Make each patch minimal and targeted so I can review and apply them one at a
time.

Prompt 13: Attack Scenario Generator

For the top 5 most critical vulnerabilities in this codebase, write a
detailed attack scenario. How would an attacker find it? What would they do?
What data could they access? What is the business impact? This helps me
prioritize fixes.

Prompt 14: Delta Scan (Changes Since Last Review)

Review the codebase focusing only on changes made since [date/commit hash].
Identify any new vulnerabilities introduced and verify whether previously
identified issues in [list areas] have been resolved. If using Claude Code,
it can access git history directly. Otherwise, provide the relevant diff or
changed files for context.

Prompt 15: Security Review for New PR

Review this pull request diff for security implications. Check for: new
vulnerabilities introduced, security best practices violations, missing input
validation, and any changes to authentication or authorization logic. Approve
or flag specific concerns.

⚠️ LIMITATIONS β€” WHAT AI SCANNING CAN'T DO

Be honest about the boundaries:

LimitationDetails
Not a replacement for penetration testingAI scans code, not running systems. It can't test actual network configs, firewall rules, or real-world attack chains.
Runtime vulnerabilities need running codeCSRF token handling, actual session behavior, and environment-specific issues require dynamic testing tools.
AI can hallucinate vulnerabilitiesAlways verify findings before acting. Use Prompt 3 to filter noise.
Environment-specific issues are out of scopeMisconfigured cloud IAM, firewall rules, and infrastructure settings need dedicated tools.
Compiled dependencies can't be analyzedAI can only review code it can read.
Context window limits are realLarge codebases (50K+ lines) won't fit in one scan. Break into modules. Findings may miss cross-module vulnerabilities.
Results vary between runsSame prompt, same code, different findings. Run critical scans more than once.
Language and framework biasStronger at Python/JS/TypeScript than Rust/Go/C++. Adjust trust accordingly.
AI augments, doesn't replace expertiseHuman researchers are still better at sophisticated, multi-step vulnerability chains.

πŸ—ΊοΈ HOW TO USE THIS

For a focused security review (highest ROI first):

StepActionWhy
1Prompt 6 β€” Secrets scanQuick wins, almost always finds something
2Prompt 5 β€” API audit (one service at a time)Find obvious auth and validation holes
3Prompt 4 β€” Auth deep diveYour most critical attack surface
4Prompt 8 β€” Race conditions (scoped to payments)Biggest business risk
5Prompt 2 β€” Data flow tracingTrace specific flows you're worried about
6Checklist β€” Verify coverageDid you miss anything?
7Prompt 3 β€” False positive verificationFilter noise from findings
8Prompt 12 β€” PatchesGenerate fixes for confirmed vulnerabilities

For ongoing security hygiene:

WhenAction
Every PRPrompt 15 β€” PR security review. This is where the daily value lives.
Every deployPrompt 11 β€” Pre-deploy checklist.
Every sprintPrompt 14 β€” Delta scan on what changed since last review.

Scoping tips for large codebases:

  • Don't scan everything at once. Break it down by service, module, or domain boundary.
  • Start with your highest-risk surfaces: auth, payments, file uploads, admin endpoints.
  • Scan one chunk, fix what you find, move to the next. Don't try to boil the ocean.

TOOL LANDSCAPE

Claude Code Security isn't the only AI scanning tool. OpenAI's Aardvark (launched October 2025) offers similar capabilities with sandboxed exploit validation. GitHub's CodeQL and Copilot Autofix are widely adopted for AI-assisted security in CI/CD pipelines. Traditional tools like Snyk, SonarQube, and Semgrep remain valuable for pattern-matching known vulnerabilities at scale. The best security setup combines AI scanning (for logic flaws and complex bugs) with traditional tools (for known CVE patterns and dependency checks).


v1.0 β€” February 2026

Free to share. Built by Mike Molinet β€” with AI, of course.

  • Substack: mikemolinet.substack.com
  • LinkedIn: linkedin.com/in/mikemolinet
  • GitHub: github.com/mikemolinet
  • Twitter: @mikemolinet
Found this useful?

Get notified when we publish new guides. No spam, just useful stuff.