AI code security tools compared: what each kind catches
AI code security tools come in five kinds. What each catches in AI-written code, what it leaves untested, and the named products in each, with sources.

AI code security tools come in five kinds: review inside the coding assistant, static analysis, dependency scanning, dynamic testing, and adversarial testing of the whole product. Each kind looks at a different thing, so each catches a different class of flaw. Most teams run two or three and leave the rest untested.
This guide sets the five side by side: what each kind looks at, what it catches well, what it leaves untested, and the named products in each. Every product is described from its maker’s own pages, read on 25 November 2026. MATT makes a tool of the fifth kind, and that is said plainly where it comes up.
ExploitOps WeeklyStories like this one, by email every Friday.Subscribe
Why this matters now
A large share of new code is now drafted by a model. Sundar Pichai said in April 2026 that 75% of all new code at Google ↗ is AI-generated and approved by engineers. GitHub’s Octoverse 2026 ↗ found that by September more than 40% of pull requests began with an agent’s first draft, up from 17% in March.
The code is improving and still carries flaws. Veracode’s Fall 2026 report ↗ tested 18 models across four languages: about 38% of coding tasks introduced a vulnerability, down from about 44% earlier in the year. A Stanford study ↗ of 47 developers found that those with an AI assistant wrote significantly less secure code and were more likely to believe it was secure.
The five kinds at a glance
| Kind | Looks at | Catches well | Leaves untested |
|---|---|---|---|
| 1. Review inside the assistant | The change, as a model reads it | Common flaws in a diff: injection, a missing check, exposed data | How the running product behaves; whatever the reviewing model misses |
| 2. Static analysis | Source code, without running it | Known flaw patterns and untrusted data reaching a sensitive call | Access control and business logic, which OWASP lists as hard to find automatically |
| 3. Dependency scanning | The packages the code pulls in | Known-vulnerable and malicious packages, and invented package names | Flaws in the code your own team and its assistant wrote |
| 4. Dynamic testing | The running app and its APIs | What is reachable from outside: injection, misconfiguration, exposed endpoints | Multi-step logic, and areas behind roles the scanner cannot reach |
| 5. Adversarial testing | The whole product, as an attacker would | Chained paths across features, each with proof | Everything after the test date, unless the test is repeated |
1. Review inside the coding assistant
The assistant that wrote the change, or a second agent, reads it for security flaws before it merges. This is the cheapest check to switch on and it sits where the code is written.
- →Claude Code has a /security-review command ↗ that analyses the changes on the current branch, and a GitHub Action ↗ that reviews pull requests. The Action’s own README asks for it to be run on trusted pull requests only. Anthropic’s separate product, Claude Security ↗, scans a whole codebase and proposes fixes for a person to approve; it entered public beta on 30 April 2026.
- →GitHub Copilot offers code review ↗ on pull requests; GitHub’s documentation says it can miss problems and belongs beside human review. Copilot Autofix ↗ suggests fixes for alerts that CodeQL has already raised, and the documentation notes that a suggested fix can fail or add a new flaw.
- →Cursor has Bugbot ↗, an automatic pull request review for bugs, and a security reviewer ↗ announced in September 2026 that reads each change in the context of the whole codebase.
- →OpenAI Codex Security, formerly Aardvark, is described by OpenAI as an application security agent ↗ that builds context about a project, then finds, validates and proposes patches. It has been in research preview since March 2026.
What it leaves: a review reads code. It has no view of the deployed product, its configuration, or how two features behave together once real accounts exist.
2. Static analysis (SAST)
A static analyser reads source code without running it and matches it against rules: known flaw patterns, and paths where untrusted input reaches a sensitive call. It runs on every commit and gives the same answer each time.
- →Semgrep Code ↗: rule-based analysis with AI triage to cut false positives.
- →Snyk Code ↗: developer-focused static analysis that finds, ranks and auto-fixes issues.
- →GitHub CodeQL ↗: GitHub’s analysis engine; results appear as code scanning alerts.
- →SonarQube ↗: static analysis that applies the same rules whether a developer or an AI wrote the code.
What it leaves: OWASP’s page on source code analysis tools ↗ lists authentication problems, access control issues and insecure use of cryptography as hard to find automatically, and says such tools identify a relatively small share of flaws. A rule such as “a user must never read another user’s invoice” lives in the product’s design, and a pattern matcher has no copy of the design.
3. Dependency and supply‑chain scanning
These tools look at the packages a project installs. With AI-written code there is a newer risk: a model can name a package that does not exist. A USENIX Security 2025 paper ↗ generated 576,000 code samples with 16 models; at least 5.2% of the packages named by commercial models, and 21.7% from open-source models, were invented. An attacker can register an invented name and wait for it to be installed.
- →Socket Firewall ↗: sits between the developer and the package registry and blocks malicious packages before download.
- →Snyk Open Source ↗: finds known vulnerabilities in open-source dependencies.
- →GitHub Dependabot ↗: alerts on vulnerable dependencies and opens pull requests to update them.
- →Endor Labs ↗: keeps only the vulnerabilities the code can reach in the backlog, and blocks malicious packages at install.
What it leaves: the code your team and its assistant wrote. A project with spotless dependencies can still let one customer read another’s data.
4. Dynamic testing (DAST) and API testing
A dynamic scanner sends requests to the running application and watches what comes back. It finds what is reachable from outside, whoever or whatever wrote the code.
- →ZAP ↗: a free, open-source web application scanner, maintained as an independent project.
- →Burp Suite DAST ↗: PortSwigger’s automated scanner, built on the engine of Burp Suite Professional.
- →StackHawk ↗: runtime tests against the running app and its APIs, designed to sit in the development loop.
What it leaves: OWASP’s testing guide says of business logic flaws ↗ that a vulnerability scanner cannot detect them. A scanner also sees only the areas its test accounts can open.
5. Adversarial testing of the whole product
Someone, or something, attacks the product the way an outsider would and reports what worked. NIST defines penetration testing ↗ as security testing in which evaluators mimic real-world attacks. This is the kind that finds chains: three small weaknesses that add up to an account takeover.
- →Penetration tests by a specialist firm remain the standard. The UK’s NCSC notes that a test’s results hold for the issues known at the time of the test ↗.
- →Bug bounty platforms such as HackerOne ↗ and Bugcrowd ↗ pay outside researchers per finding.
- →XBOW ↗ runs autonomous AI agents against apps and APIs and reports findings as working exploits.
- →MATT, which publishes this guide, tests a product the way a modern, AI-assisted attacker does, writes each finding as a plain-English rule with a check, and re-proves the rules on every release. The method is on the AI security audit page and the patterns are in the attack library.
What it leaves: a single test is a photograph. The product changes the next day, so the value comes from repeating the test or turning its findings into checks that run on each release. A side-by-side comparison of MATT and an annual penetration test covers how the two fit together; MATT’s findings sit beside a pentest report, and many teams need both.
How to choose: start from what is untested
The useful question is which class of flaw nobody is looking for today. Four checks settle it for most teams.
- →Is every change read for security before it merges? If the answer is no, kind 1 or kind 2 is the first step, and both can be on by the end of the day.
- →Does anything stop an unknown package from installing? AI assistants add dependencies freely. Kind 3 covers this.
- →Has the running product been attacked from outside this quarter? Kinds 4 and 5 are the only ones that touch the deployed product.
- →Is there a written list of rules the product must hold, with a check for each? For example: a user must never act on another user’s account. Kinds 1 to 4 have no such list to test against. Kind 5 can produce one.
A sensible minimum for a team shipping AI‑written code
- →One review in the assistant or one static analyser on every pull request.
- →One dependency scanner with a block on unknown and malicious packages.
- →One adversarial test of the whole product each year at the least, and after any large change.
- →The findings of that test kept as rules and re-checked on every release, so a fixed flaw stays fixed.
OWASP’s Secure Coding with AI cheat sheet ↗ and NIST’s SP 800-218A ↗, the generative AI profile of its secure development framework, are the two neutral references to read next. MATT’s own view of the fifth kind is in what an AI security audit is and on the AI-written code page.
Sources
- →Google: Sundar Pichai at Cloud Next, 22 April 2026 ↗
- →GitHub: Octoverse 2026 ↗
- →Veracode: Fall 2026 GenAI Code Security update, 29 October 2026 ↗
- →Perry, Srivastava, Kumar and Boneh: Do Users Write More Insecure Code with AI Assistants? ↗, CCS 2023
- →Spracklen and others: We Have a Package for You! ↗, USENIX Security 2025
- →OWASP: Source Code Analysis Tools ↗, Introduction to Business Logic ↗, Secure Coding with AI Cheat Sheet ↗
- →NIST: penetration testing, glossary ↗, SP 800-218A ↗
- →NCSC: Penetration testing guidance ↗
Product descriptions come from each maker’s own pages, linked above and read on 25 November 2026. Product names and logos belong to their owners. The logos identify companies named in this comparison and imply no affiliation with MATT or endorsement by them.
Questions
What is AI code security?
The practice of finding and fixing security flaws in code written by AI coding assistants and agents. It uses the same five kinds of tool as any software security programme: review, static analysis, dependency scanning, dynamic testing and adversarial testing.
Which AI code security tool is best?
No single kind covers everything, because each looks at a different thing. A review or static analyser reads code, a dependency scanner reads packages, a dynamic scanner probes the running app, and an adversarial test attacks the whole product. Choose by the class of flaw nobody is testing for today.
Is AI‑generated code less secure than human code?
Veracode’s Fall 2026 report found about 38% of coding tasks given to 18 models introduced a vulnerability, down from about 44% earlier in 2026. A Stanford study of 47 developers found those using an assistant wrote less secure code and trusted it more.
Can an AI assistant review its own code for security?
Yes, and it is worth switching on. Claude Code, GitHub Copilot, Cursor and OpenAI Codex each offer a security review. A review reads code only, so it leaves the running product, its configuration and its access rules untested.
Do I still need a penetration test if I use these tools?
Yes. Scanners and reviews miss flaws in access control and business logic, which OWASP says automated tools find poorly. A penetration test or an AI security audit attacks the whole product and finds chains across features.