Home/Templates/Security Audit
Coding

Security Audit Prompt Template

Conduct a security audit of code or architecture covering OWASP top 10, authentication flaws, and injection risks.

The Prompt

ROLE: You are an application security engineer who has conducted penetration tests and security audits for fintech and healthcare companies — you think like an attacker who has already gotten inside the perimeter. CONTEXT: You are auditing code or an architecture description for security vulnerabilities. Security issues are not equally serious — a misconfigured Content Security Policy is not in the same category as an unauthenticated SQL injection endpoint. Every finding must be triaged by severity so the team can fix the critical issues first. TASK: Conduct a structured security audit of the code or architecture provided below. RULES: • Every finding must include: Severity (Critical/High/Medium/Low/Info), OWASP category, a description of the vulnerability, an example attack scenario, and a specific remediation • Critical and High findings must include a proof-of-concept attack payload or scenario (not just a description) • If the code appears to have no issues in a category, state "No issues found" — do not invent findings to appear thorough • Distinguish between "this is vulnerable as-is" and "this could become vulnerable if..." • End with a risk summary: the top 3 things to fix immediately and in what order CONSTRAINTS: Check against OWASP Top 10 at minimum. Assume a motivated external attacker with access to the public interface only — not insider threat. Flag any area that requires dynamic testing (can't be audited from code alone) with [DYNAMIC TEST REQUIRED]. EDITABLE VARIABLES: • [CODE_OR_ARCHITECTURE] — the code snippet or architecture description to audit • [LANGUAGE_FRAMEWORK] — e.g. Node.js/Express, Python/Django, Go • [APPLICATION_TYPE] — e.g. public REST API, internal admin panel, e-commerce checkout • [KNOWN_SENSITIVE_DATA] — what sensitive data the system handles (PII, payment data, health records) OUTPUT FORMAT: **Risk Summary:** [Top 3 immediate priorities] **Findings:** | Severity | OWASP | Description | Attack Scenario | Remediation | |----------|-------|-------------|-----------------|-------------| **[DYNAMIC TEST REQUIRED]** areas: [List] **Positive Security Controls:** [What the code does well] QUALITY BAR: A developer who implements all Critical and High remediations should be able to state in a security review that the application is not trivially exploitable by a script kiddie with a standard OWASP testing toolkit.

Make it specific to you

PromptITIN asks a few questions and builds a version tailored to your use case.

✦ Enhance with AI

How to use this template

1

Copy the template

Click the copy button to grab the full prompt text.

2

Fill in the placeholders

Replace anything in [BRACKETS] with your specific details.

3

Paste into any AI tool

Works with ChatGPT, Claude, Gemini, Cursor, and more.

4

Or enhance with AI

Sign in to PromptITIN and let AI tailor the prompt to your exact situation in seconds.

Why this prompt works

Requiring a proof-of-concept attack scenario for Critical and High findings forces the AI beyond vague warnings into concrete impact — 'an attacker could extract all user emails via this endpoint in a single request' is more actionable than 'SQL injection risk detected'. The positive security controls section prevents audit reports from being pure negativity.

Tips for best results

  • Never paste production secrets or credentials into this prompt — use sanitised/redacted versions of your code
  • Run this audit on your authentication code first — auth flaws compound every other vulnerability in the system
  • For APIs, add your authentication token format and session management approach to CONTEXT — many auth vulnerabilities are architectural, not code-level
  • After implementing remediations, run the prompt again on the fixed code and verify the AI no longer flags the same issues

More Coding templates

Code Review

Get a comprehensive AI code review covering bugs, performance issues, security vulnerabilities, best practice violations, and refactoring opportunities with specific line references.

View →

Debug an Error

Diagnose any code error with a structured breakdown: root cause analysis, step-by-step fix, and prevention strategies for the future.

View →

Explain Code Simply

Translate complex code into plain English with line-by-line explanations, real-world analogies, and edge-case analysis for any skill level.

View →
← Browse all 195 templates