Detect vulnerabilities in a piece of code and get actionable suggestions to fix them. Modern applications are constantly under threat. This prompt helps you identify critical security flaws early and follow best practices (e.g., OWASP Top 10).
Pull Request review step
Static code analysis automation
CI/CD pipeline integration
Internal code quality audits
List of detected issues with explanations
Code-level fix suggestions
Explanations of risks and vulnerabilities
OWASP standards-based audit
This is the base template with placeholders. Replace the placeholders with your specific information:
Perform a security audit of the following code. Detect vulnerabilities such as XSS, SQL injections, hardcoded secrets, insecure authentication flows, unsafe dependencies, or bad practices. Suggest secure alternatives or fixes. Explain each issue found. {{language_block}} {{security_focus_block}} {{sensitivity_level_block}} {{additional_context_block}}
{{language}}
Programming language{{security_focus}}
Security focus area{{sensitivity_level}}
Audit sensitivity level{{additional_context}}
Context (framework used, expected usage, etc.) (optional) - ex: framework used, expected usage, specific constraintsHere's an example with filled-in values:
Perform a security audit of the following code. Detect vulnerabilities such as XSS, SQL injections, hardcoded secrets, insecure authentication flows, unsafe dependencies, or bad practices. Suggest secure alternatives or fixes. Explain each issue found. Focus on: Web vulnerabilities. Audit level: OWASP Top 10 coverage. Additional context: Python code with FastAPI, focus on SQL injections and insecure auth.
Help others discover this useful prompt by sharing it on social media