AI Security Review Workflow
Review code for what an attacker would do, not just what tests catch — anchor the model as a security engineer, run a threat-focused review, then back the findings with auth and input tests.
The problem
A normal review optimizes for correctness and readability, and a security bug sails right through it because nobody was looking for one. Security review is a different lens: you assume an attacker, you go looking for the input that isn't validated and the auth check that isn't there, and you treat 'it works' as beside the point. Doing that with AI means first putting the model in a security mindset instead of a general-helper one, reviewing against the failure classes that actually cause breaches, and proving the risky paths with tests rather than trusting a clean read.
Recommended workflow
Each step uses an existing NewPrompt tool, pre-filled by a matching resource. Open the resource to read it, or jump straight into the tool with the inputs ready.
-
Put the model in a security mindset
A general assistant reviews for bugs; a security engineer reviews for attackers. Anchor the model in that role first, so the review ranks threats by likelihood and impact instead of listing style nits.
Goal The model reviewing as a security engineer, not a generalist.
Open this step in Role Prompt GeneratorResource Security Engineer Role Prompt -
Review for the threats that cause breaches
Run the review against the real failure classes — injection, broken auth, unvalidated input, leaked secrets, unsafe deserialization — and rank findings by exploitability, not by how easy they are to spot.
Goal Risk-ranked security findings, each with an attack path.
Open this step in Code Review Prompt GeneratorResource Security Code Review Prompt -
Prove the risky paths with tests
For the auth and input paths the review flagged, write tests that try to break them — wrong credentials, missing tokens, malformed input — so a fix is provable and a regression gets caught.
Goal Tests that exercise the attack paths, not just the happy one.
Open this step in Test Case Prompt GeneratorResource Authentication Test Prompt
Expected outcome
A review that surfaces the vulnerabilities a correctness pass misses, ranked by exploitability, with tests guarding the auth and input paths — so the risky change is defensible, not just 'looks fine'.
Best for
- Reviewing auth, input handling, or anything internet-facing
- A security pass before a release or audit
- Reviewing changes that touch sensitive data
Not for
- A routine correctness review — use the AI Code Review Workflow
- Designing security architecture from scratch — this reviews existing code
FAQ
How is this different from the AI Code Review Workflow?
Code review optimizes for correctness, maintainability, and tests — security is one focus among several. This is a dedicated security pass: a security-engineer mindset, a threat-class review, and tests for the attack paths. Different lens, different output.
Do I still need a normal review?
Usually yes. This catches security issues a correctness review misses; it doesn't replace the broader review for logic and maintainability. Run both on changes where security matters.
Does it find every vulnerability?
No tool does. It puts the model in the right mindset and points it at the failure classes that actually cause breaches, which catches far more than a generic review — but security review assists human judgment; it doesn't replace a real audit for high-stakes systems.
Part of these blueprints
Complete build journeys that include this workflow as a stage.
Where to go next
Related workflows