AI security code review
Using AI models or agents to review code for security flaws, next to scanners and human reviewers, with every finding verified before it is trusted.
An AI security review asks a model or a coding agent to read code the way a security reviewer would: where user input reaches a query, who can call an endpoint, where secrets live, what an attacker could chain together. Unlike SAST rules, a model can follow business logic, such as a missing ownership check, which pattern scanners tend to miss. Ready-made steps exist, for example Anthropic’s open-source security review GitHub Action.
The weak points are known. Models report convincing false positives, miss different things between runs, and can be steered by comments in the code they review, an indirect prompt injection risk. So findings need verification, ideally a test that reproduces each one. It fits audit-driven development and pays off most after vibe coding, where nobody else has read the code. Run it before a pentest, so the tester spends time on what a model cannot find.
Sources
Related terms
- Audit-driven development: A loop for code you maintain: an AI agent audits it against a checklist, the findings become small fixes, and it audits again until nothing is left.
- Adversarial review (cross-model review): Asking a second AI model, or a fresh agent, to find what is wrong with a change before a person reviews it, instead of asking the author to check itself.
- SAST and DAST (static and dynamic security testing): Two kinds of automated security testing: SAST reads source code for risky patterns, DAST attacks the running app from outside like a scanner.
- Vibe coding: Building by prompting and accepting the result without reading the code closely.
- Coding agent: An agent that reads a repository, edits files, runs commands and tests, and opens pull requests.
- Threat modeling (STRIDE): A structured review of a design that asks what you are building, what can go wrong and what you will do about it, before the code is written.
