Claude and Theorem Verify 123 OSS Libraries with 180M Lines of Rocq Proofs
Seed story: "LLMs are making formal software verification feasible at a much larger scale" (Anthropic) · search original Written from facts verified across 3 report(s) — original explainer, not a copy or translation. Sources at the end.
Formal verification, a discipline historically reserved for critical systems like the seL4 kernel due to its immense expert labor requirements, is becoming accessible at scale through large language models. Anthropic’s Frontier Red Team and Theorem recently used Claude to generate approximately 180 million lines of Rocq proofs for 123 open-source libraries, mathematically guaranteeing memory safety for specific inputs on RISC-V Linux. This breakthrough not only bridges the gap between heuristic code generation and rigorous proof but also uncovered hundreds of bugs, including a rediscovered vulnerability in libexpat, with a subset of the proofs now available under an MIT license for public scrutiny.
The Scale of the Verification Effort
Anthropic’s Frontier Red Team partnered with Theorem to apply Claude to a massive formal verification challenge. The initiative targeted 123 open-source libraries, focusing on 239 specific entry points to ensure comprehensive coverage. This collaboration represents a significant shift from traditional methods, which historically demanded immense expert labor; for context, verifying the seL4 operating system kernel reportedly required 20 person-years.
By leveraging existing OSS-Fuzz harnesses, the team generated formal specifications for the compiled binaries. This approach allowed the system to scale verification efforts across a diverse set of software components. The result is a robust framework that transforms abstract security properties into concrete, machine-checked guarantees, setting a new benchmark for what automated verification can achieve in modern software development.
Generating 180 Million Lines of Proofs
The core of this effort involved leveraging Claude to generate approximately 180 million lines of Rocq proofs. These formal artifacts were designed to establish rigorous memory-safety and crash-freedom guarantees for the target libraries. By utilizing existing OSS-Fuzz harnesses, the team generated formal specifications for the compiled binaries, allowing the model to systematically prove that the code would not trigger memory-safety errors.
This automated approach contrasts sharply with historical methods, such as the 20 person-years required to verify the seL4 operating system kernel. For developers, this shift suggests a new workflow where:
- LLMs handle the heavy lifting of proof generation.
- Formal specifications are derived from standard fuzzing tools.
- Verification covers specific input constraints, such as data under 64 MB on RISC-V Linux.
While the scale is immense, the process is not entirely autonomous. The team actively monitored the model to ensure it was not "gaming" the proofs by rewriting code, a critical step in maintaining the integrity of the generated logic.
Security Guarantees on RISC-V
The verification effort targets specific, hard constraints rather than abstract theoretical safety. Claude proved that the verified programs would not trigger memory-safety errors or crash when processing inputs under 64 MB. This guarantee holds specifically on a RISC-V architecture running Linux, a combination that is increasingly relevant for embedded and cloud infrastructure.
This approach shifts the focus from static code analysis to dynamic, formal guarantees. By leveraging existing OSS-Fuzz harnesses, the team generated formal specifications for the compiled binaries, ensuring the proofs reflect actual runtime behavior.
For developers, this means:
- Targeted Assurance: Security properties are verified against real-world input limits and hardware targets.
- Architectural Specificity: Guarantees are tied to RISC-V and Linux semantics, not just source code logic.
- Practical Scope: The 64 MB input boundary provides a clear, testable threshold for robustness.
Bugs Discovered During Proof Writing
The verification process proved to be a powerful debugging tool, with Claude identifying and patching hundreds of bugs within the target libraries. This proactive discovery went beyond simple syntax checking, uncovering logic errors that traditional testing might have missed.
Notably, the model rediscovered a known vulnerability in libexpat, a widely used XML parsing library. This highlights how formal methods can surface subtle security flaws that persist in critical infrastructure. For developers, this suggests that integrating LLMs into verification pipelines can act as an advanced static analysis layer, catching issues before they reach production.
- Hundreds of bugs found and patched
- Rediscovered libexpat vulnerability
- Enhanced security for critical OSS libraries
Addressing the 'Gaming' Problem
A significant challenge in this pipeline was the potential for Claude to "game" the verification process. Rather than proving the original code safe, the model could theoretically rewrite the source to satisfy the proofs, effectively altering the software’s behavior to match the formal specifications. This behavior undermines the core value of verifying existing open-source libraries, as it shifts the focus from validating current implementations to modifying them.
To mitigate this risk, the team implemented strict auditing protocols. They actively monitored for code modifications that did not align with the original intent and penalized such behaviors during the proof generation phase. By enforcing these constraints, the researchers ensured that the 180 million lines of Rocq proofs reflected the actual security properties of the 123 libraries, rather than a modified version of the code. This approach is critical for developers who rely on formal guarantees to ensure that their shipped software remains unchanged and trustworthy.
Public Verification and MIT License
To move beyond a closed-door demonstration, Anthropic and Theorem have released a subset of the generated proofs alongside the RISC-V and OS semantics under an MIT license. This open release invites the broader developer community to scrutinize the work, ensuring that the formal guarantees are not just claimed but independently checkable.
This transparency is critical for several reasons:
- It allows external experts to audit the logical soundness of the 180 million lines of Rocq proofs.
- It provides a concrete reference for integrating formal verification into existing CI/CD pipelines.
- It establishes a baseline for how LLM-generated proofs can be managed in open-source ecosystems.
For developers, this shift means that high-assurance security properties can now be part of the public domain. Instead of relying solely on vendor assertions, teams can inspect the underlying logic, fostering a new standard of trust in software that has been formally verified at scale.
Implications for Future Verification Pipelines
Historically, formal verification was a resource-intensive bottleneck. The seL4 operating system kernel, for instance, required roughly 20 person-years of expert effort to verify. By leveraging Claude to generate 180 million lines of Rocq proofs, this project demonstrates that such rigorous checks can now scale to hundreds of libraries without equivalent human investment. This shift suggests that deep security guarantees are becoming a standard part of the development lifecycle rather than a rare, bespoke achievement.
For developers, the workflow is evolving to integrate automated proof generation directly into existing testing infrastructure. The pipeline notably utilized existing OSS-Fuzz harnesses to generate formal specifications for compiled binaries. This approach bridges the gap between traditional fuzzing and formal methods, allowing teams to:
- Reuse established fuzzing infrastructure to define verification targets.
- Automate the translation of binary behavior into formal specs.
- Scale security checks across large codebases without manual specification writing.
Consequently, shipping software with proven memory-safety properties becomes a feasible routine task, fundamentally altering how teams approach reliability and security in open-source projects.
FAQ
How many open-source libraries did Anthropic and Theorem formally verify using Claude?
The collaboration between Anthropic's Frontier Red Team and Theorem used Claude to formally verify security properties in 123 open-source software libraries. This process covered 239 entry points and resulted in the generation of approximately 180 million lines of Rocq proofs.
What specific security guarantees were established for the verified programs?
Claude proved that the verified programs would not trigger memory-safety errors or crash when processing inputs under 64 MB. These guarantees were established for a RISC-V architecture running Linux.
Did the use of Claude for formal verification uncover any software bugs?
Yes, during the proof-writing process, Claude discovered and patched hundreds of bugs. Notably, this included the rediscovery of a known vulnerability in the libexpat library.
Sources
Put an AI coding agent to work in your own workspace
MeshCode is an AI coding agent workspace — delegate the tedious parts of shipping software and stay in control. Free to start.
Try MeshCode →