Anthropic and Theorem Use Claude to Automate Software Safety Proofs
A new collaboration has enabled an AI model to generate massive mathematical proofs for open-source code, identifying bugs that traditional testing methods had overlooked for years.
By Beatrice Gray ·

Anthropic has successfully demonstrated that its Claude AI model can automatically generate formal mathematical proofs to verify the safety of existing software, a milestone that could fundamentally change how developers trust code. By partnering with Theorem, the company moved beyond simple code generation to address the critical issue of proving that software behaves correctly under all conditions. This approach allows the AI to mathematically guarantee the integrity of specific software libraries, reducing the reliance on manual inspection and standard testing protocols. The initiative represents a significant shift in software engineering, where the focus is no longer just on writing code, but on verifying its correctness with a level of precision that was previously only achievable by human experts in niche fields.
Historically, formal verification was a prohibitively expensive endeavor reserved for high-stakes environments like aviation or defense. For example, a team of specialists required 20 person-years to formally verify the seL4 operating system kernel. Because of this high cost, the method was rarely used outside of extreme cases such as Airbus avionics. The new system changes this dynamic by allowing an AI to handle the heavy lifting. Instead of hiring armies of mathematicians, developers can now use Claude to process the verification work, making the technology accessible for a much wider range of software applications.
The scale of the recent project was substantial. Over a period of just a few weeks, Claude produced approximately 180 million lines of mathematical proof code. This work drew on test programs from 123 open-source libraries within Google’s OSS-Fuzz security project. The model did not write new software from scratch; rather, it verified existing code by translating crash tests into mathematical problems. It then analyzed the compiled machine code and generated the necessary proofs to demonstrate correctness. This process was designed to be as autonomous as possible, minimizing the need for human intervention in the proof generation phase.
An independent verification program named Rocq automatically checks the proofs generated by Claude. According to Anthropic, this setup requires almost no human reviewers, leading the researchers to describe the process as "fully autonomous" proof generation. However, it is important to note that while the execution is automated, the underlying tools and formal foundations were developed by humans at Theorem. This distinction highlights a collaborative model where human expertise builds the framework, and AI handles the execution of the complex logical tasks at scale.
A major benefit of this approach is its ability to uncover hidden flaws. During the proof generation process, Claude identified hundreds of bugs and was permitted to fix them independently. Many of these errors would have likely gone undetected by conventional testing methods because they only manifest under very specific conditions, such as unusually large input files or particular sequences of data access. The AI’s ability to explore these edge cases mathematically allows it to find vulnerabilities that slip through standard testing suites.
The effectiveness of this bug-finding capability was highlighted during the verification of a widely used PDF reader. In just one week, the team discovered as many security bugs as are typically reported for that specific software over an entire year. In another instance, Claude caught a logical error that had remained undetected for more than a decade. Anthropic notes that even when a complete proof fails, the attempt itself often surfaces real bugs, making the process valuable regardless of the final outcome.
Despite these successes, the team acknowledges the practical limits of the technology. "Formally verified" does not equate to "error-free" in every possible scenario. The proofs are only valid under strict conditions, including a specific processor architecture, single-threaded programs, and inputs under 64 MB. In real-world applications, these libraries often run on diverse hardware configurations. Additionally, the computational cost is significant, with individual proofs consuming hundreds of millions of tokens, though Anthropic has not disclosed the total project costs.
Efficiency is improving, however. A smaller test run indicated that proofs are reusable and that 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. This trend suggests that the cost barrier will continue to lower over time. If AI can verify its own code, developers can place greater trust in AI-generated software and spend less time on manual review, saving costs across the entire coding lifecycle.
The project strengthens the argument for broader software automation. The central question is shifting from whether AI can program to whether it can prove that its code is safe. Anthropic expects formal verification with AI to become as routine as standard testing in the near future. Theorem’s roadmap already targets critical infrastructure components like glibc, OpenSSL, and cURL, signaling that this technology is poised to impact the foundational layers of the software ecosystem.






