AgentRecipes
Recipes › Engineering & security

How to turn existing fuzz tests into machine-checked no-crash proofs with Claude

Engineering & securityClaude✓ Confirmed by source

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

Step-by-step recipe

  1. 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.
  2. 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).
  3. 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).
  4. Give the agent the spec and let it write the proof; the proof checker, not a human reviewer, decides whether it is valid.
  5. 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.
  6. 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.
  7. 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

Prompt template
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

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

Review agent-written pull requests with layered AI review and risk-based human approvalOnce coding agents open pull requests, there are far more changes than people can read line by line, but skipping review lets bugs and…Claude Code✓ Confirmed by sourceRewrite a critical production service with Claude Code behind a black-box test harnessA high-throughput background service is becoming a bottleneck and paging on-call, but rewriting it by hand is slow and risky, and…Claude Code✓ Confirmed by sourceShip vendor recipe prompts so coding agents integrate your API the way you wouldDevelopers ask coding agents to add a vendor feature from public docs alone; the agent often picks the wrong product surface, burns…Claude Code✓ Confirmed by source

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.