How to turn existing fuzz tests into machine-checked no-crash proofs with Claude
Confirmed by source: Documented first-party research write-up by Anthropic's Frontier Red Team with concrete results on real open-source libraries, machine-checked proofs, and a published subset of the proofs and semantics for independent checking. Checked live on 2026-10-25. Not run by BranoLabs (needs the formal semantics pipeline and a very large token budget). (checked 2026-10-25)
The problem
Fuzzing only samples inputs, so a fuzzer that has run for years can still miss a crash that needs a huge or oddly shaped input. Formal verification would close that gap, but writing proofs by hand has historically cost many expert-years, so almost nobody outside safety-critical code does it. You want a repeatable way to get a proof that a library entry point cannot crash, reusing the tests your developers already wrote.
Tools needed
- Anthropic Claude (agentic proof writing and bug fixing)
- Existing fuzz-test entry points (for example from Google OSS-Fuzz)
- AddressSanitizer (ASan) instrumentation
- Rocq proof assistant and its proof checker
- Formal RISC-V and Linux process semantics (Theorem's, published with the project)
Step-by-step recipe
- Pick a library that already has fuzz-test entry points (any input that makes the entry point crash counts as a bug) and build them with AddressSanitizer so memory errors turn into crashes.
- Compile the library and its fuzz harness to a static binary for the machine model you have formal semantics for (the source used single-threaded static RISC-V Linux binaries).
- Generate the specification mechanically from the binary plus the machine and OS semantics: the program always exits normally, with no sanitizer error or failed assertion, for every input up to a size bound (the source used 64 MB).
- Give the agent the spec and let it write the proof; the proof checker, not a human reviewer, decides whether it is valid.
- When the proof gets stuck on a real bug, let the agent patch the code, regenerate the spec from the patched binary and keep proving. Log and audit every patch, and penalize patches that change behavior more than needed, so the agent cannot just make the program trivially crash-free.
- Run several agents in a shared workspace so they can copy and adapt each other's finished proofs; most of a proof covers runtime and sanitizer start-up code that every program shares.
- Review only the trusted pieces: the machine and OS models, the exact theorem statements and the proof checker. Report the bugs found along the way upstream.
Copyable prompt
You are proving a security property of [LIBRARY NAME], entry point [FUZZ TARGET NAME]. Specification file: [SPEC PATH] (generated from the compiled binary; do not edit it). Goal: a proof that the checker accepts showing the program exits normally for every input up to [SIZE BOUND]. Rules: - You may reuse and adapt finished proofs in [SHARED PROOFS DIRECTORY]. - If the proof fails because of a real bug, stop, describe the input that triggers it, and propose the smallest patch. Explain exactly which inputs the patch changes. Never rewrite the program to avoid doing its job. - After a patch, regenerate the spec with [REGENERATE COMMAND] and continue. Report: proof status, bugs found with triggering inputs, patches made, and tokens used.
Original template written by our AI agent for AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.
What the builder reported
Anthropic's Frontier Red Team, working with Theorem, reports that Claude proved no crash on any input up to 64 MB for 239 entry points across 123 OSS-Fuzz libraries over a few weeks, about 180 million lines of Rocq proofs, and found hundreds of bugs along the way, including ones that needed inputs of around 20 MB or 64 MB that fuzzers would be unlikely to hit and a rediscovered libexpat CVE. Agents sharing a proof workspace needed 17% fewer tokens, and Opus 5.5 proved half of 36 small tasks with about 40% fewer tokens than Opus 5. These figures are Anthropic's, not ours.
These are the source author's own claims. AgentRecipes has not run this recipe itself.
Watch out for
- A proof is only as good as its spec and machine model: these proofs assume a single-threaded static RISC-V binary on Linux with musl, while most users run x86 or ARM with glibc.
- ASan does not catch every memory-safety bug, and proving some entry points does not cover the whole library or callers that misuse it.
- Letting the agent patch code opens the door to reward hacking; audit every patch.
- Proofs can take hundreds of millions of tokens, so start with a small, high-value library and reuse proofs across projects.
- This needs formal semantics for your target machine; it is not a weekend setup unless someone (such as the source's partner Theorem) provides the pipeline.
Source
Original write-up: Anthropic research (2026-10-22) ↗
Found via Agent Use Cases: “Formally verify software at large scale with Claude”. This recipe summarises the source in words written by our AI agent; read the original for the full details. Link last checked 2026-10-25.
More engineering & security recipes
New agent recipes in your inbox
A short email with the newest automation recipes, each linked to its real-world source. No spam. Every email has a one-click unsubscribe link.