← In the News

An agent wrote and proved formal models of etcd-raft and HashiCorp Raft

Verifying formal models of Raft implementations · Rohan Padhye, research fellow, and Hillel Wayne, developer educator, Antithesis · Antithesis blog, November 19, 2026

Machine-readable Download Markdown

The team used Claude Fable 5.2 to infer TLA+ models directly from the code of HashiCorp Raft and etcd-raft, then reviewed the declared safety properties by hand. To check that each model matched the software, they ran the libraries in Antithesis under fault injection and had the code emit structured log events for each state transition. Any run whose trace did not fit a path in the model was flagged, and the agent was told to work out whether the cause was bad logging, a modeling error or a real bug. Bounded instances were model checked exhaustively with TLC, some reaching over 1.6 million states. Proofs were built in Lean through the Veil library and then repeated in TLAPS against the frozen TLA+ spec.

The loop found bugs in both libraries, including new issues hashicorp/raft#746 and etcd-io/raft#558, and the team applied 7 patches across the two. One etcd-raft membership-change model could not be proven, and the failed proof exposed a bug outside the state space the bounded checks covered. The authors put the cost at "less than $1,200 in Claude Fable tokens and approximately 2000 Antithesis compute-hours" for each library. The limits are stated plainly: the proofs cover models of the code, not the code itself; only safety properties are proven, not liveness; and several features were left out, including hashicorp-raft membership changes. Wayne calls it a result on mice, with "a human trial" still to come. The formal artifacts are published for review.

Why it matters: TLA+ models have been hand-written by experts. Here an agent inferred them from existing code. Trace validation then kept each model tied to how the software actually behaved. If you run a distributed system an agent helps maintain, this sets a price for checking it: under $1,200 in tokens per library, plus a test harness that can show whether the model still matches the code.