AI Math Proofs Verify Legacy Code
Anthropic's Claude model generated vast mathematical proofs to validate the safety of existing software libraries in a matter of weeks.
By Amelia Clarke ·

Anthropic has demonstrated a new capability for its Claude large language model by using it to mathematically prove that established software code functions as intended. This approach addresses a long-standing challenge in the technology industry where ensuring software reliability has traditionally required immense human expertise. The company positions this breakthrough as a critical step toward building greater confidence in software generated or maintained by artificial intelligence. However, the firm emphasizes that these proofs come with specific technical limitations regarding the conditions under which they hold true.
The cost of formal verification has historically been a major barrier to widespread adoption. This method involves proving that software runs without errors in all possible scenarios. In the past, specialists required twenty person-years to verify seL4, a small operating system kernel. Due to these high resource demands, the technique was largely reserved for critical systems such as Airbus avionics. Anthropic's Frontier Red Team collaborated with a partner named Theorem to shift this workload to an AI model. In just a few weeks, Claude generated approximately 180 million lines of mathematical proof code.
The team drew upon test programs from 123 open-source libraries within Google's OSS-Fuzz security project. Claude did not write new software from scratch. Instead, it analyzed existing code by converting crash tests into mathematical problems. The model examined compiled machine code and constructed extensive proofs to validate behavior. A separate verification program called Rocq automatically checks these proofs. Anthropic states that the process requires almost no human reviewers, though researchers note that humans built the underlying formal foundations and tools. The proof generation itself is described as fully autonomous.
During the verification process, Claude identified hundreds of bugs and was authorized to fix them. Researchers indicate that many of these issues would likely have escaped conventional testing methods. These bugs often appear only under narrow conditions, such as unusually large input files or specific sequences of data access. In one notable instance, the team verified a widely used PDF reader. They discovered as many security bugs in a single week as are typically reported for that software over an entire year. In another application, the model identified a logical error that had gone unnoticed for more than a decade. Anthropic adds that even when a complete proof fails, the attempt can still reveal real bugs.
The company is precise about what the results mean. Formally verified does not equate to error-free in every possible context. The proofs are valid only under defined conditions. These include a particular processor architecture, single-threaded programs, and inputs smaller than 64 MB. Real-world deployments often run on different hardware and configurations, which may fall outside these specific proof boundaries. This distinction is crucial for engineers evaluating the reliability of the verified code in production environments.
Cost remains a significant constraint for the process. Individual proofs consume hundreds of millions of tokens, and Anthropic has not published the total project costs. Nevertheless, the company argues that if AI can verify its own code, developers can trust AI-generated software more readily. This could reduce the time spent on manual reviews and lower costs across the coding process. A smaller test run indicated that proofs can be reused, improving efficiency. Opus 5.5 solves half the proofs using about 40 percent fewer tokens than its predecessor, Opus 5.
The project shifts the focus of AI development from programming ability to the capacity to prove safety. Anthropic expects formal verification with AI to become as practical as standard testing methods. Theorem's roadmap already targets critical infrastructure libraries, including glibc, OpenSSL, and cURL. This expansion suggests a broader effort to integrate mathematical certainty into the core components of the digital economy.
Source: The Decoder





