☰ SectionsToday’s news, without the noise.
Tech · AI

Claude verifies code safety automatically

Anthropic and Theorem used AI to generate mathematical proofs for open-source libraries, revealing bugs that traditional testing had overlooked.

By Mei Lin ·

Anthropic has deployed its Claude model to mathematically verify the correctness of existing software, a move that marks a significant shift in how code safety is assessed. Working in partnership with Theorem, the company utilized the AI to generate formal proofs for a large set of open-source libraries. This initiative aims to address the high cost and complexity of traditional formal verification, which has historically been reserved for critical systems like aviation software.

The primary claim of the project is that AI can now handle the labor-intensive process of proving software correctness. For this specific effort, the Frontier Red Team at Anthropic collaborated with Theorem to allow Claude to take over the proof generation work. The model produced approximately 180 million lines of mathematical proof code over a period of just a few weeks. This work drew upon test programs from 123 open-source libraries within Google's OSS-Fuzz security project.

The process did not involve writing new code from scratch. Instead, Claude translated existing crash tests into mathematical problems and analyzed the compiled machine code to produce extensive proofs. An independent verification program named Rocq automatically checks the validity of these proofs. According to Anthropic, the workflow requires minimal human review, a capability the researchers describe as fully autonomous proof generation, although the underlying formal foundations were built by human experts at Theorem.

During the verification process, Claude identified hundreds of bugs that had evaded conventional testing for years. Many of these errors only surfaced under specific conditions, such as unusually large input files or particular sequences of data access. In one notable instance, the team found as many security bugs in a single week for a widely used PDF reader as are typically reported for that software in an entire year. In another case, the model detected a logical error that had remained undetected for more than a decade.

However, the project comes with strict practical limitations. Anthropic acknowledges that formal verification does not guarantee that software is entirely error-free in all scenarios. The proofs are valid only under specific conditions, including a defined processor architecture, single-threaded execution, and input sizes under 64 megabytes. In real-world applications, these libraries often run on diverse hardware and configurations, which may not align with these strict constraints.

The computational cost of the project is also a significant factor. Individual proofs can require hundreds of millions of tokens to complete, and Anthropic has not disclosed the total cost of the entire initiative. Despite these expenses, the company suggests that if AI can verify its own code, developers can place greater trust in AI-generated software. This could reduce time spent on manual reviews and lower costs across the entire development cycle.

Efficiency is also improving with newer model versions. A smaller test run demonstrated that proofs are reusable and that more recent models are more efficient. Specifically, Opus 5.5 solved half of the proofs using approximately 40 percent fewer tokens than its predecessor, Opus 5. This trend suggests that the computational burden of formal verification may decrease over time.

The project strengthens the argument for broader software automation. If AI can write code and guarantee its correctness under defined conditions, the focus of the industry may shift from merely generating code to proving its safety. Anthropic expects that formal verification using AI will soon become as routine as standard testing. Theorem’s roadmap already targets critical infrastructure components such as glibc, OpenSSL, and cURL, indicating a long-term vision for this technology.

While the results are promising, open questions remain about scalability and cost. The current approach works well for specific libraries and conditions, but applying it to the entire software ecosystem will require further development. For now, the collaboration between Anthropic and Theorem provides a concrete example of how AI can enhance software reliability, potentially changing how developers and organizations approach code safety in the coming years.

Source: The Decoder

More Tech · Report a business

Get United Flash in your inboxToday’s news, without the noise. Free, a few times a week, unsubscribe any time.

Related stories

Get United Flash in your inboxToday’s news, without the noise. Free, a few times a week, unsubscribe any time.