All posts

Blog

Anthropic and Theorem use Claude to prove 239 entry points in 123 open-source libraries cannot crash

FindAmNow
AnthropicClaudeTheoremformal verificationcybersecurityopen source

Claude wrote about 180 million lines of machine-checked Rocq proofs covering RISC-V builds of 123 libraries, finding hundreds of bugs along the way, under narrow stated limits.

Anthropic says it has used its Claude models to write machine-checked proofs that parts of more than 100 widely used open-source libraries cannot crash under stated conditions. The work, done with the formal-verification company Theorem, was published by Anthropic's Frontier Red Team on 22 October 2026.

Anthropic calls it, to its knowledge, the first large-scale effort to use AI to formally verify production software at the assembly-code level. It also stresses that "formally verified" does not mean "bug-free".

What was proved

The team started from fuzz tests in Google's OSS-Fuzz programme. A fuzz test is an entry point that developers write so a testing engine can throw huge numbers of random inputs at their code; any input that causes a crash is a bug. Fuzzing can never try every input, so it can never show that no bugs are left.

Anthropic and Theorem turned those fuzz tests into formal specifications written against the compiled RISC-V machine code. Claude then wrote proofs in the Rocq proof assistant, and Rocq's checker confirmed them. According to Anthropic, over a few weeks Claude proved that 239 entry points across 123 libraries always exit normally, with no memory-safety errors caught by AddressSanitizer and no failed assertions, for every input under 64 MB.

The company says the proofs total about 180 million lines of Rocq. A typical proof runs to about 600,000 lines and covers a binary with a median length of 18,000 RISC-V instructions. Because the checker verifies the proofs, Anthropic says people do not need to read them. They need to trust the RISC-V and Linux process models, the exact theorem statements, and the Rocq checker itself.

Bugs found along the way

Trying to complete the proofs turned up hundreds of bugs, Anthropic says. Claude was allowed to patch them, and the specification was then regenerated for the patched code. Examples in the post include an out-of-bounds write in a decompressor that only appeared on inputs of about 20 MB with one rare layout, an out-of-bounds read in an image decoder that needed a 64 MB input, and a rediscovery of a known libexpat flaw.

Anthropic notes that letting the model patch code could invite "reward hacking", where code is changed so it trivially never crashes. It says it penalised patches, rewarded proofs showing how few inputs a patch changes, and logged and audited the patches.

The limits

The guarantees are narrow, and both companies say so. The proofs assume a single-threaded, statically linked RISC-V binary linked with musl libc, running on Linux with a fixed memory budget. Most people run these libraries on x86 or ARM, dynamically linked against glibc, and the proofs do not carry over to those builds automatically.

AddressSanitizer does not detect every memory-safety bug, not every entry point in each library was verified, and code an entry point cannot reach is outside the proof. Theorem's public repository also says its Linux process model is "best effort and not complete".

What is public

Anthropic is not releasing the full set. It says it is withholding proofs that could reveal bugs that have not yet been patched. Theorem's public oss-verify-proofs repository currently lists proofs for 60 entry points in 25 libraries, including parts of OpenSSL, simdjson, bzip2 and libpcap, checked with Rocq 9.2.0.

Theorem is also offering to run the same pipeline for other open-source projects through a programme called OSS Verify, where maintainers can enrol a project.

Cost and next steps

Proofs can take hundreds of millions of tokens to produce, which Anthropic names as a key limitation. On a separate set of 36 small verification tasks, it says Opus 5.5 proved half of them using about 40% fewer tokens than Opus 5. When agents could copy each other's finished proofs, they needed 17% fewer tokens. Anthropic expects formal verification to become a normal part of secure software development as costs fall.

Sources

Source