Anthropic disclosed previously hidden defects in macOS, Linux, and the Rust compiler after experimenting with four distinct techniques that employ large language models to hunt for logic errors in software.
The technique that produced the highest return was called agentic code review. In this mode the model examined only the raw source files, without any supplemental documentation. This strategy revealed problems in the Caliptra firmware, the macOS operating system, the Linux eBPF verifier, and the Rust compilation pipeline.
What are logic bugs?
Logic bugs arise when a program behaves in a way that contradicts an expected rule, often an implicit invariant that the code assumes to be true for correct operation.
According to the study’s authors, “LLMs are highly capable at reasoning about (and inferring the intent of) source code and its invariants.” That ability lets the models generate and test hypotheses, which in turn leads to the spotting of logical mistakes.
Testing methodology
The benchmark compiled a set of twenty-one bugs that had been publicly disclosed between 2016 and 2026. For each case the model received the unpatched source and was not shown the corrective patch. A bug counted as rediscovered when the model’s input caused a different return value or output between the patched and unpatched versions.
The team executed each approach three times for every bug, allowing up to one thousand distinct inputs per run. After each run, the results were evaluated to determine whether a bug had been identified.
Results and findings
During blind trials, agentic code review managed to rediscover eleven of the previously mentioned bugs, while informal correctness proofs uncovered eight. When the researchers supplied the invariants alongside the code, informal correctness proofs located the entire collection, and agentic code review identified twenty of them.
The same benchmark runs also surfaced three hundred sixteen distinct bugs that were not part of the original list. Anthropic reported that one hundred eighty-nine of those had already been addressed or were known to the maintainers, leaving one hundred twenty-seven newly reported issues.
Agentic code review pinpointed a vulnerability in Caliptra’s firmware-update routine. That weakness could let an attacker replace the chip’s root of trust with unverified code, effectively compromising the device’s foundational security.
The same method exposed a macOS flaw that could enable a local user to raise privileges and obtain full system access. By exploiting this bug, an attacker could gain root rights without needing additional credentials.
Informal correctness proofs revealed several dozen type-safety problems inside the Rust compiler. In addition, the analysis uncovered more than one hundred bugs within the Linux eBPF verifier, indicating a broader set of safety concerns for kernel-level code verification.
The researchers concluded that the latest generation of language models can locate logic bugs without direct human direction or specialized analysis tools. Nevertheless, they noted that forming accurate hypotheses when only the source code is available continues to pose a significant challenge.
Model performance in blind and recall tests
Researchers evaluated nine models using agentic code review in a blind setting. Claude Sonnet 4.5 identified one benchmark bug, Claude Opus 4.5 found five, and Claude Mythos 5.2 discovered 15.
In the recall test, nine benchmark bugs were not recognized by any model.
Leave a Reply