Anthropic finds simple AI code review beats fuzzing at uncovering logic bugs
Logic bugs are flaws where software behaves in conflict with the unwritten rules that govern how it should work. They are hard to find because common detection tools rely on general-purpose "bug oracles", automated checks that spot obvious failures such as crashes or invalid memory access. Logic bugs rarely trigger those failures, so discovery usually depends on human code review, which does not scale to large codebases.
Anthropic researchers tested several ways of using large language models (LLMs) to fill that gap. They built a benchmark of 21 since-patched logic bugs drawn from the change history of open-source projects: SQLite (9), zstd (3), brotli (1) and image-png (8), disclosed between 2016 and 2026. The model received only the unpatched source code and had to submit an input that triggered each bug. A submission counted as a success if the code behaved differently between the unpatched and patched versions.
Tests ran in two settings. In the blind setting the model was given no information about the bug and had to infer the violated rule from the code alone. In the informed setting it was also told the invariant that had been broken. Each technique was run three times per bug.
The headline result favoured simplicity. Claude running in a standard agentic harness (Claude Code) rediscovered 11 of the 21 bugs with no hints, while the more complex techniques that relied on fuzzing or symbolic execution rediscovered none in the same setting. The team also tested previously unknown bugs on four targets and describes logic bugs found in Caliptra (an open-source silicon root of trust), macOS, eBPF and the Rust compiler. Their recommendation is that defenders try simple LLM-driven code review on their own codebases before investing in specialised tooling.
Why it matters
Logic flaws have been a blind spot because automated testing tools such as fuzzers and sanitizers only catch crashes and memory errors, leaving code review as the main safeguard. This result suggests that assumption is weakening: a general-purpose model with no hints or custom tooling can surface these flaws, which attackers could also try. Teams that build or maintain software should expect logic bugs to be found faster and consider running such reviews first.
What to do
- Run an agentic LLM code review on your own codebase to look for logic bugs before investing in specialised tooling.
- Try the review in a blind setting first, with no hints, then repeat with known invariants stated to compare results.
- Verify any reported bug by crafting an input that behaves differently before and after a fix.