The standard defenses against cyberattacks are no longer sufficient: we need ways to prove that code is free of bugs. Formal software verification could provide this guarantee, but it has historically required years of expert effort, making it impractical for most real-world projects. In a collaboration with Theorem, however, we show this is no longer the case: LLMs can now produce formal proofs at large scale, enabling new software development workflows that include proven security guarantees.
Why formal verification has been out of reach for most developers
Even mature heavily tested software contains bugs and LLMs are increasingly adept at finding them. The Linux kernel one of the most well tested pieces of software today deployed on billions of devices worldwide recently had over 1000 vulnerabilities disclosed. With frontier models becoming more capable of chaining seemingly benign bugs into critical exploits we need techniques that can detect and fix these bugs before they can be exploited in the wild. Ideally such techniques could find and patch all bugs and then provide some proof that there are no more to be found. In formal verification developers translate their code into a mathematical model then try to prove that it always follows some defined set of security rules. If they fail to prove this that means there could be a bug in the code that would violate a rule and the nature of the failure implies what the bug might be. Repeating this process after eliminating the cause of failure each time will ultimately yield proof that the code is devoid of any bug that would violate those rules. However formal verification is not easy. Proofs can be many times larger than the original code and writing them requires significant effort and a niche highly specialized skill set. For instance it took two person years to implement the seL4 operating system kernel but 20 person years to formally verify it. Accordingly formal verification has been practical only in truly mission critical applications such as Airbuses avionics code.
How LLMs are changing the verification landscape
But LLMs are making it far easier. Frontier models can now produce correctness proofs for real world software fully autonomously. To demonstrate this the authors asked Claude to prove useful security properties across 123 open source libraries including showing that some of their executable artifacts can never crash under certain conditions. Specifically Claude proved that these programs will always exit normally without triggering memory safety errors or failing assertions for every input less than 64 MB and every modeled Linux operating system OS response and memory layout under certain assumptions namely that the program runs as a single threaded static binary with a fixed memory budget on a RISC V CPU using Linux OS. This is still far away from fixing all possible bugs but it does get us much closer than before and provides a roadmap toward that end.
Over the span of a few weeks Claude successfully patched the bugs it found and then proved that there are no crashes on any input up to 64 MB for 239 entry points across 123 different OSS Fuzz libraries. These proofs operate on the compiled RISC V instructions i e executable binaries and they comprise about 180 million lines of Rocq with a typical proof running to about 600 000 lines to provide security guarantees on binaries with a median length of 18 000 RISC V instructions. These proofs are built by translating the RISC V assembly code to a mathematical model using Theorem s RISC V instruction and Linux process semantics. This means these proofs currently assume that the program runs as a single threaded static binary with a fixed memory budget on a RISC V CPU using Linux OS. Expanding the scope of these proofs is well within reach as it would involve standardizing semantics for more assembly architectures and other operating system processes. The only artifacts that a developer needs to trust are the formal models of RISC V and of Linux processes the exact theorem statements that were proved and the Rocq proof checker itself. This does not mean these libraries contain no bugs. Any remaining bugs either are to be found within the artifacts listed above or are outside the scope of Claude s proof. Hardening those still possibly buggy trusted components Rocq RISC V and Linux semantics is not insignificant but it is a far more tractable task than debugging every line of code the scaled out proofs cover especially as this approach can secure an arbitrary number of projects without increasing the size of the trusted components.
Bugs discovered during the proof process
Many bugs showed up during Claude s attempts to prove hundreds of entry points. To ensure that Claude did not have to stop for a human every time this happened the authors let Claude fix the bugs it found: it patched the code which caused the spec to be regenerated with that patched code and then Claude proceeded to prove that new spec. Many of the bugs we found are ones that a fuzzer would be unlikely to ever find. Fuzzers mutate small inputs typically capped at 1 MB and typically rely on code coverage to guide them toward bugs. While proving an entry point in one library Claude found a counter underflow in its copy of a decompressor that led to an out of bounds write but only on inputs of around 20 MB that had one rare specific layout. Other bugs include an out of bounds read in an image decoder that needed a 64 MB input and over 2 GB of memory an out of bounds read in another library that needed a particular sequence of calls across two handles to the same file and a rediscovery of CVE 2026 56132 in libexpat which needed deeply nested input. Claude also found logic bugs that never crash at all. While proving that one library was memory safe for example it noticed that a feature for restricting which files an application can load is not always enforced. The ultimate goal of this project was to achieve a proof that the RISC V compiled fuzz tests had no remaining crashes to find. However bugs like the above show that the process has another benefit regardless of whether that goal is achieved even just attempting this process yields real bugs that need to be fixed.
Proving high level properties beyond memory safety
Proving that a fuzz test has no more crashes to find is more significant than it sounds. It is common for fuzz tests in real world code to test for violations of meaningful high level properties such as encode decode roundtripping idempotence algebraic laws differential testing self consistency or equivalence to reference implementations. For example a fuzz test for the LZO compression algorithm asserts that if you compress an input then decompress it the result is the same as the original. If the property does not hold the program crashes so proving the test never crashes is equivalent to proving the property itself. This can also occur even when the properties are not directly specified by the developer. For example in order for Claude to complete its OSS Fuzz proof for cpp httplib it was necessary to rule out the possibility of a stack overflow due to too much recursion in the std set destructor. This recursion depth is bounded by the maximum depth of a tree so Claude had to prove on machine code that libc s red black tree rebalancing algorithm is correctly optimized to keep the tree s depth logarithmically bounded.
Other formal verification case studies
Formal verification is an expansive domain. The fuzz test to proof example above is one instance of LLMs making formal verification more widely usable by directly applying proofs to machine code. The authors also saw success using LLMs with formal verification in other ways. For example they asked Claude to write a formal spec of RFC 1950 the technical document that defines the zlib compression file format then had Claude prove that the zlib implementation in the Linux kernel correctly implements that spec. As with the examples above Claude proved this property at the binary level except instead of RISC V Claude directly proved the x86 compiled binary using Claude generated and heavily tested formal semantics of the x86 ISA. Along the way they found some minor unexploitable bugs in corner cases which are in the process of being filed upstream. They draw two conclusions from this exercise first these extremely well tested codebases are already almost fully correct and second it is possible to prove end to end correctness properties about real existing codebases.
In another experiment the authors asked Claude to develop an interpreter for a large subset of Python in Rust and to prove using Verus a verification tool for Rust that it adheres to the CPython semantics outlined in an academic paper. They then measured the adherence to CPython s behavior empirically running over 1.7 million randomly generated Python programs finding ident similar adherence rates. These experiments demonstrate that extremely well tested codebases are already almost fully correct and that it is possible to prove end to end correctness properties about real existing codebases.
What this means for developers and teams
As model capabilities continue to improve the authors expect formal verification to become an essential part of secure software development. The cost of writing proofs is falling as models become more intelligent Moreover as more code is formalized and methods of achieving security guarantees become more standardized the ability to reuse or modify proofs across codebases will amortize the cost. Theorem our collaborator on this project is also offering to run the same pipeline for other open source projects and is publishing a Claude skill to help developers get started with verifying their own code. We encourage all developers to explore formal verification with LLMs especially those who previously tried it with less capable models and found it didn t work. The road ahead for formal verification is promising.