180 million lines: Anthropic's Claude generates massive safety proofs for code
A collaboration between Anthropic and Theorem has used AI to mathematically verify 123 open-source libraries, uncovering hundreds of hidden bugs in the process.
By Jonathan Pierce ·

Anthropic has demonstrated a new capability for its Claude model by using it to generate mathematical proofs of software correctness. Working alongside partner Theorem, the company utilized AI to verify existing codebases rather than writing new software from scratch. The primary goal is to make formal verification a routine part of the development cycle, a process that has historically been too expensive and labor-intensive for widespread use.
The core claim of this project is that AI can automate the heavy lifting of safety verification. Previously, proving that a specific piece of code is error-free required vast amounts of human effort. For example, a team of specialists required 20 person-years to verify the small seL4 operating system kernel. In contrast, Claude generated approximately 180 million lines of proof code in just a few weeks. This work covered 123 open-source libraries from Google's OSS-Fuzz security project, translating crash tests into mathematical problems and analyzing compiled machine code to produce extensive proofs.
The results suggest a significant leap in software automation. As Claude generated these proofs, it identified hundreds of bugs that conventional testing had missed. These errors often only appear under highly specific conditions, such as unusually large input files or particular sequences of accesses. In one instance, the team found as many security bugs in a widely used PDF reader in a single week as are typically reported for that software in an entire year. In another case, the model caught a logical error that had gone undetected for over a decade. Anthropic describes the process as fully autonomous, though it notes that the underlying tools and formal foundations were built by humans at Theorem.
However, the approach comes with strict practical limitations. Anthropic acknowledges that a formally verified status does not guarantee the software is error-free in every real-world scenario. The proofs only hold under specific conditions, including a defined processor architecture, single-threaded execution, and input sizes under 64 megabytes. Since these libraries often run on different hardware and in various configurations, the verification is not a universal guarantee of safety.
The computational cost of this method is also significant. Individual proofs can consume hundreds of millions of tokens, and Anthropic has not disclosed the total cost of the project. Despite this, the company argues that if AI can verify its own code, developers can trust AI-generated software more and reduce time spent on manual review. A smaller test run indicated that proofs are reusable, and newer models are becoming more efficient. Opus 5.5, for instance, solves half the proofs with about 40 percent fewer tokens than its predecessor, Opus 5.
The long-term vision is for formal verification with AI to become as standard as traditional testing. Theorem's roadmap already targets critical infrastructure components such as glibc, OpenSSL, and cURL. If successful, the industry's focus may shift from asking if AI can program to asking if it can prove that its code is safe. This could have consequences that extend well beyond current coding tools, potentially transforming how software reliability is managed in critical systems.
Source: The Decoder


