AI defect detection in software finds a real share of bugs before they reach production, but 2026 benchmarks show it misses many others. The benchmarks below also show where it falls short.
This article explains what the term covers in software, how detection works at each stage, what recent evidence says about accuracy, and which controls teams commonly place around it. Cleverbit designs and implements agentic AI development practices with the controls built in from the start, and the sections below describe the field in general.
What AI defect detection means in software
Software defect detection identifies and localises flaws in programs. A 2025 academic review of large language model approaches separates two families. Dynamic detection generates and mutates test cases during execution. Static detection analyses the code itself to find likely issues.
The defects themselves fall into three groups, according to an IEEE Security & Privacy article by Marjanov, Pashchenko and Massacci. Syntactic defects are grammar errors caught at compile or run time. Semantic defects are wrong behaviour, such as misused variables or APIs and swapped arguments. Vulnerabilities are security-relevant semantic defects, such as buffer overflows.
The same article notes a long-standing trade-off. Static analysis tends to produce many false positives, while dynamic analysis is prone to false negatives. AI does not remove that trade-off. It changes where the noise appears.
Where detection happens in the delivery pipeline
The delivery pipeline is the automated path that takes application code from commit to release. AI detection can sit at several points along it.
Requirements and planning
Agents can read a specification and flag contradictions or missing cases before code exists.
Code review
Review agents comment on a pull request and point to likely bugs. This is the most studied use. The authoring engineer remains the author of the change, whether the code was typed by hand or produced by an agent.
Testing
LLMs generate test cases, guide test feedback and assess outputs, as the literature review in Frontiers of Computer Science describes. Generated tests need review too.
Test selection in CI
A 2026 single-author preprint (KG-AST) examined 155 open-source projects in 11 languages. A static call-graph selector ran about 8% of a test suite while including a test written for the fix in 85% of 67 fix commits. A single cross-language model ranked commits so that the riskiest 20% covered 49 to 64% of bug-introducing commits, against 20% for random selection. The paper reports these as research results on open-source code, not as guaranteed outcomes for a given codebase.
What the 2026 benchmarks show about accuracy
Benchmarks give the clearest picture of review agents, and they point in two directions at once.
Microsoft’s CRBugBench study covered 1,000 review tasks across 98 open-source repositories plus 800 proprietary industry tasks. The best review agent caught 71.9% of bugs within its top five comments, up from 47.7% five months earlier. Yet agents still missed more than 20% of the bugs humans found. Performance dropped by up to 25.5% on proprietary repositories, where project context matters.
CR-Bench-v2 used 584 pull-request review instances derived from SWE-Bench. Even the strongest agents detected only about one third of known defects. One commercial assistant detected 8.1% of known defects, although 78% of its comments were rated useful. The authors conclude that agents should assist human reviewers and not gate merges.
The gap between useful comments and caught defects is worth noting. A reviewer can sound helpful and still miss the defect that causes the incident.
Context is the common limit
The same pre-print found that a blind AI reviewer, seeing only the diff, found 26% of later-fixed defects exactly. Graph context raised that to 32%. About 65% were missed by all four context slices. The Frontiers review links weaker results on complex multi-function code to restricted input window length, and also reports inconsistent answers to duplicate queries.
A 2026 study cited in the OpenSSF guide tested LLM-based and traditional tools on 24 active open-source projects. It found high false discovery rates on real-world projects, mostly from truncated interprocedural context.
Reading published results carefully
The OpenSSF guide, written by David A. Wheeler and contributors, observes that many published results come from tool developers, use inconsistent codebases and report findings rather than validated vulnerabilities. It cites a 2025 study in which only 25 to 60% of functions labelled vulnerable in popular auto-labelled datasets were labelled correctly on manual checks.
The SQRBOK handbook on machine-learning defect prediction shows how accuracy misleads on imbalanced data. One model reached 0.97 accuracy on the jEdit dataset with 0.00 precision and recall, so it flagged no defective module correctly. Precision and recall are the figures that describe whether defects are actually found.
Defects introduced by AI versus defects found by AI
AI sits on both sides of the defect question. It finds defects, and it also writes code that contains them.
A 2026 systematic review at International Hellenic University analysed 32 studies and 8 specialist interviews. Five of the eight interviewees said AI-generated code often looks correct but hides logical and performance issues. QA engineers noted that such code can fail static analysis even when unit tests pass. The review found that LLMs raise developer productivity more reliably than they raise intrinsic code quality.
Evidence on production outcomes
Evidence that detection lowers production defects is growing but uneven. A systematic review in Acta Informatica Pragensia covered 72 papers on AI in software testing. Only 3 were industrial and 10 hybrid, and just 4 of 72 were industrial or hybrid, open and metric-reporting at once.
The Software Quality Journal study by Gheventer and colleagues identified 24 potentially usable solutions but described low technological maturity. Most are academic prototypes facing a last-mile problem in reaching production tooling.
One industrial report stands out. An ACM paper on the ARC-V multi-agent system reports a 79% early defect discovery rate, identifying most production-escaping bugs before testing.
The largest production dataset comes from Meta’s RADAR paper. At Meta, significant lines of code per human-landed diff grew 105.9% year on year, and agentic AI drove over 80% of that growth. RADAR reviewed 535,290 diffs and landed 331,720. Its revert rate was one third that of non-RADAR diffs, and its production incident rate was one fiftieth. Median review wall time fell 35%. These results come from a funnel that automated only eligible low-risk changes and diffs were not randomly assigned, so the comparison is not like for like.
How teams place controls around detection
The Meta design illustrates a common pattern: a risk-stratified funnel. RADAR classifies diffs by authorship and source type, applies eligibility gates and static heuristics, scores risk, runs LLM review with deterministic validation, and auto-accepts only changes with at least 8 out of 10 confidence and no risk signals. A complexity score of 4 or above, an identified bug, a performance risk or a security vulnerability such as exposed secrets disqualifies a diff. The paper frames the underlying problem as review capacity: human attention is fixed while agentic code creation accelerates.

The Microsoft authors reach a similar view. They argue the evidence supports fully autonomous review only for narrow, low-consequence pull requests. For consequential changes, review agents act as scalable peers while an accountable human keeps the final decision. They add that trust should rest on repository-specific, continuously monitored evidence rather than aggregate benchmarks.
Deterministic verifiers
The OpenSSF guide states that agents work far better with tools: code search, fuzzers, static analysers, the ability to compile code and run tests, all inside a sandboxed, representative test bed. It adds that CI/CD must be sound before AI systems make code changes. Task verifiers become part of the trusted computing base. A broken test or a verifier checking the wrong property can confidently approve an incorrect result. The guide advises keeping verifiers deterministic, explicit about what they prove and periodically tested with known-good and known-bad cases.
Access and approval
The same guide sets out least-privilege practice. Agents receive no secrets or write tokens on untrusted pull requests and use short-lived scoped credentials. Agent output is treated as untrusted data, with a human gate and a kill switch before privileged actions, and analysis is separated from action. It calls for human review of AI-generated code where failures can cause serious problems, and of each AI-drafted false-positive suppression. The pragmatic guidance adds that humans approve security-relevant, architectural and production-proximate changes.
For a deeper treatment of these controls, Cleverbit has written on AI code guardrails for secure delivery and on an AI governance operating model. The article on AI branch strategy covers how teams manage agent-written branches.
Frequently asked questions
Can AI review replace human code review?
The 2026 evidence does not support that for consequential changes. CR-Bench-v2 authors conclude agents should assist human reviewers, not gate merges. Microsoft’s researchers reserve autonomous review for narrow, low-consequence pull requests.
How accurate is AI defect detection?
It varies by benchmark and context. The best agent in CRBugBench caught 71.9% of bugs in its top five comments, while CR-Bench-v2 found about one third of known defects detected. Results fall on proprietary repositories.
Does AI-generated code carry more defects?
One SSRN study of manufacturing enterprises found 1.9 times the defect density in AI-assisted changes. Teams above roughly 45% automated test coverage saw defect density decline. Findings depend on the population studied.
Which defects are hardest for AI to find?
The studies point to complex changes and bugs needing non-local reasoning. In the KG-AST study, about 65% of later-fixed defects were missed by every context slice tested.
Sources
-
Software defect detection using large language models, Frontiers of Computer Science
-
Machine Learning for Source Code Vulnerability Detection, IEEE Security & Privacy
-
(When) Should a Software Factory be Lights-off?, Microsoft CRBugBench
-
Finding and Fixing Software Vulnerabilities Using AI, OpenSSF
-
Generative AI solutions for software quality, Software Quality Journal
-
Artificial Intelligence in Software Testing and Beyond, Acta Informatica Pragensia
-
Impact of AI Coding Assistants on Code Quality Evolution, SSRN
-
Large Language Models in Software Quality Assurance, International Hellenic University