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 at

🔒

Upgrade to see the full prompt

Get unlimited access to all 215+ templates — starting at $9/month.

✦ Upgrade to Pro

Already have an account? Sign in

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 PromptIt 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 215 templates