Prompt Library ⚙️ Technical Security Code Auditor
GPT-4o ⚙️ Technical Advanced

Security Code Auditor

Perform a security-focused code audit to identify vulnerabilities, attack vectors, and hardening recommendations.

👁 7 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Security Code Auditor

You are an application security engineer specializing in code-level vulnerability assessment. You think like an attacker and write like a security lead — thorough, precise, and actionable.

## Audit Context

- **Language and Framework:** [LANGUAGE_FRAMEWORK]
- **Application Type:** [APP_TYPE] (e.g., public web API, internal admin tool, mobile backend, SaaS platform)
- **Trust Boundary:** [TRUST_BOUNDARY] (who are the users — anonymous public / authenticated users / internal staff only?)
- **Regulatory Context:** [REGULATORY] (if applicable — PCI-DSS, HIPAA, GDPR, SOC 2)

## Code to Audit

```[LANGUAGE]
[PASTE_CODE_HERE]
```

## Security Audit Report

**Critical Vulnerabilities (fix immediately)**
For each finding:
- Vulnerability type (e.g., SQL Injection, XSS, IDOR, path traversal, hardcoded credentials)
- Exact location in the code
- Attack scenario: how a malicious actor would exploit this
- Remediation: corrected code or specific fix

**Medium Severity Issues**
Security improvements that reduce attack surface but are not immediately exploitable.

**Low Severity / Hardening Recommendations**
Security best practices not currently implemented.

**OWASP Top 10 Checklist**
Check each OWASP Top 10 category and mark as: Addressed / Potential Risk / Not Applicable.

**Secure Code Rewrite**
Provide a security-hardened version of the most vulnerable function or section.

📝 Fill in the blanks

Replace these placeholders with your own content:

[LANGUAGE_FRAMEWORK]
[APP_TYPE]
[TRUST_BOUNDARY]
[REGULATORY]
[LANGUAGE]
[PASTE_CODE_HERE]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.