AI Formal Verification: 6.5M Lines of Proof on 26,000 Lines of Trust
On 10 November 2026 Google DeepMind published AlphaProof Code and a companion paper claiming something that has never been claimed before: the first proofs of protocol-level security properties for a widely deployed, unmodified implementation of a cryptographic protocol. The target was Signal. The output was roughly 6.5 million lines of machine-checked Lean. It hit 643 points and 185 comments on Hacker News the same day.
The thread's top-voted objection was a good one: they verified a library with a bug history and found zero bugs? That reads like a red flag, and the usual follow-up — "they must have proved something narrow" — is partly right and mostly beside the point.
This page is the practitioner read. Not "AI can prove code correct now," which is false, and not "it's all hype," which is also false. The interesting content is in the trust arithmetic: what is actually machine-checked, what is assumed, and which part of this a team outside DeepMind can copy today.
- Avoid the naming trap: AlphaProof Code shares a brand with 2024's AlphaProof and almost nothing of its architecture — no reinforcement learning, no tree search
- Understand why proving things about an ELF binary instead of Rust source puts the Rust compiler OUTSIDE the trusted base — and what that buys and costs
- Do the trust arithmetic: 6.5M lines of untrusted proof resting on ~26,000 lines of specification that a human has to read and believe
- Know why zero bugs were found, why that was never the goal, and what the two reinjected bugs actually tested
- Steal the anti-cheating architecture — the held-out spec directory, the critic that never sees a proof attempt, and the amendment protocol — which is the transferable engineering idea
- Read the scope table honestly: no constant-time claim, no concurrency, no group messaging, no keygen, and not Signal's shipped apps
- Apply a six-step protocol to the next 'AI verified our code' announcement
The one-sentence version
A team of five humans, directing 40–80 agents powered by Gemini 4 Carbon on a single machine over four weeks, produced two independent machine-checked security proofs — one symbolic, one computational — about the AArch64 binary of a purpose-built CLI harness around libsignal-protocol v0.105.4's one-to-one session path, resting on about 26,000 lines of trusted specification and machine semantics, with the Lean kernel as the only thing that has to be right for the proofs themselves.
Every clause in that sentence is doing work. Here is why.
1. This is not the AlphaProof you remember
The 2024 AlphaProof was a reinforcement-learning system: a language model coupled to AlphaZero, training itself on Lean proofs, which got 28/42 at IMO 2024 (silver-medal level, solving 4 of 6 problems) and published its methodology in Nature in November 2025.
AlphaProof Code has none of that machinery. No AlphaZero loop, no RL, no proof-search tree is described anywhere in the paper. It is a multi-agent framework in which "general-purpose coding agents whose behavior is defined by skills: natural-language documents" write Lean, and Lean's kernel checks it. The agents are ordinary LLM agents with role prompts. The reliability comes from the checker, not the prover.
Two systems, one brand, different architectures. If you cite "AlphaProof" as evidence that RL-trained provers now verify production code, you have merged two unrelated results. Nothing in the 2026 paper claims the 2024 system is a component.
That distinction matters for forecasting. A scaling story about self-play does not transfer here. What transfers is a story about agent orchestration against a sound checker — which is a much more copyable thing, and the reason this page exists.
2. The proof is about a binary, and that is the clever part
Most verification work proves things about source code, which means you then have to trust the compiler — hence CompCert, hence years of work.
AlphaProof Code went the other way. The unmodified Rust crates are compiled by stock rustc to an AArch64 Linux ELF, and the theorems are about that binary, interpreted by a formal semantics of AArch64 written in Lean covering 467 instructions and 31 system calls in 7,578 lines.
The consequence is stated flatly in the paper's trusted-base discussion: "The Rust compiler is not trusted." You do not need to believe rustc is correct, because you never reason about Rust.
The price is equally sharp, and an HN commenter put it better than most coverage did: the guarantee attaches to that ELF. Change a compiler flag, bump rustc, relink — and you have a different binary that the theorem says nothing about. The reproduction instructions pin rustc 1.98.1 and warn not to override it, because the generated Lean depends on exact compiler output.
Two further limits live in the semantics itself. It does not model threads, signals, the vDSO, dynamic linking, or files outside the working directory — so this is a single-threaded, statically linked process, and nothing about concurrency is proven. And soundness of the semantics cannot be proved, since hardware and kernels are not formal objects; it is validated by differential testing against Unicorn, ARM's Sail Armv9.4-A model, and qemu-aarch64.
3. Zero bugs were found — because it was never a bug hunt
No new defect in libsignal was found or reported. That is not a hidden failure; it is a category error in how the result was read.
What DeepMind did instead was mutation testing of the specification. Two real, previously fixed libsignal bugs were reintroduced into an isolated copy, and the system produced machine-checked proofs that the buggy versions were insecure:
| Reinjected bug | What went wrong | Upstream fix commit |
|---|---|---|
| weak state | A prekey message that decrypted only under an archived session still caused libsignal to store the new session state — including a copy of the signed prekey's secret | cd361186fba60c83186262d91b03af608fb8c7c3 |
| small subgroup | The PQXDH responder did not check that the initiator's X25519 base key was torsion-free and in range, so a replayed handshake with a mangled base key creates a second session sharing the same secret | 5293caa6cad81566b80f3c3731857bedaa78737b |
Both bugs were discovered by prior human research (Cheval et al., 2026), not by AlphaProof Code. Their role here is to answer the only question that makes a specification credible: would this spec have caught a real bug?
The repo is more careful than the blog post. Per the project's own PAPER_MAP.md, the four symbolic mutant disproofs are proved against an earlier statement, and retargeting them to the final headline theorem is pending (tracked as T-12(d)); the computational disproofs live on unmerged branches; ten synthetic bug-injection obligations remain sorry-exempt stubs on main; and the mutant disproofs get no comparator replay against a held-out challenge. If you repeat the blog's "in both cases, the system produced a machine-checked proof that the buggy version was insecure," repeat this caveat with it.
That gap between a blog's summary and a repo's issue tracker is the single most reusable habit from this page: the artifacts were published, so the caveats are checkable. Most AI-verification announcements do not give you that.
4. The trust arithmetic: 6.5 million lines resting on 26,000
Here is the shape of the result, from the paper's own counts:
| Layer | Size | Who has to be right |
|---|---|---|
| Proofs (untrusted) | ~6.5M lines of Lean — 5.3M about the binary (shared by both proofs), ~860k computational, ~350k symbolic | Nobody. The Lean kernel checks them |
| Reinjected-bug proofs | ~140,000 lines | Nobody |
| Allocator proofs | ~70,000 lines | Nobody |
| Specification directories | ~54,000 lines total | — |
| Trusted spec you must read | ~18,000 lines in the repo + ~8,000 lines of AArch64 semantics ≈ 26,000 | You |
| Verified code | ~560 KB, ~140,000 AArch64 instructions | — |
The 6.5 million is the number that travelled, and it is the least important one. Proofs are untrusted by construction: the gatekeeper requires that Lean's kernel accept them and that only Lean's three standard axioms are used — propext, Quot.sound, Classical.choice. A wrong proof does not typecheck.
The 26,000 is the number that decides whether the result means anything, because a specification "must be trusted … and it cannot be automatically checked—a flaw could weaken the guarantee the theorem provides." This is the specification gap, and the paper is unusually candid about it, listing five mitigations: skeptical reviewer agents, machine-checked satisfiability and vacuity theorems, mutation testing, historical-bug disproofs, and human review — while conceding that "human review is not expected to detect all bugs in a large codebase."
Note the two 140,000s in that table are different units: 140,000 lines of Lean for the bug proofs, and 140,000 AArch64 instructions of verified code. They are unrelated.
One detail worth knowing, because it is the kind of thing that never makes a press release: the specifications themselves were "developed through an intense back-and-forth between humans and agents powered by Gemini 4 Carbon and Claude Opus 5.5." The proofs were produced entirely by Gemini 4 Carbon teams. And "none of the authors wrote any proof code."
5. The architecture worth stealing
The obvious attack on any AI verification system is: the agent will just weaken the spec until the code verifies. Hacker News raised exactly this. The paper's design is a direct, mechanical answer, and it is the part a team outside DeepMind can copy this week — in Lean, in a property-test suite, or in a CI gate.
- Seven roles with disjoint powers: an orchestrator that schedules but never edits Lean, proof workers, a team lead for context management, an architect that decomposes proofs, an integrator that is the only role allowed to commit, a critic, and a gatekeeper. The division is the control, not a convenience.
- The spec is copied into a held-out directory that no agent can write to. Provers work against their own copy and can never silently edit the thing they are being measured against.
- A tool called comparator must confirm that the headline theorem statement AND every definition it transitively depends on are byte-identical to the held-out copy — not merely that a theorem with that name typechecks. This is the step that closes the 'agent edited the goalpost' hole.
- Provers cannot edit the spec; they may propose an amendment to a critic. The critic requires demonstrated necessity (a machine-checked disproof or a concrete counterexample), no weakening of any security property, and a small diff. A real accepted example: memcpy may copy from read-only memory.
- The critic approves amendments and never sees proof attempts. It cannot be argued into relaxing a property because a particular proof is almost working — the most natural way such a review gets captured.
- Lean's kernel is the trust anchor, and the gate asserts that only propext, Quot.sound and Classical.choice were used. An agent cannot smuggle in an axiom that makes the goal trivial.
- The Lean proofs, specs, build pins and a paper-to-repo map are public. This is why the gaps in section 3 above are knowable at all — and it is the standard to hold the next announcement to.
Generalise step 3 and you have a rule that applies far outside Lean: a passing check is only evidence if the checked property is byte-identical to one you wrote and stored out of reach. The same failure mode is why agents edit tests instead of code — see Reward hacking in coding agents.
6. What was proven, and what was not
The scope is far narrower than "Signal is now verified." Two independent proofs were produced about the libsignal-cli harness covering only init (process_prekey_bundle), send (message_encrypt) and recv (message_decrypt).
Proven — symbolic (Dolev–Yao) model. Ten theorems holding on every collision-free execution: forward secrecy, post-compromise security of message keys, handshake authentication, KCI resistance, handshake secrecy including against an attacker who later breaks Diffie–Hellman, session independence, and "no run faults or diverges."
Proven — computational model. Confidentiality and authenticity with forward secrecy and post-compromise security for PQXDH composed with the Triple Ratchet, stated as a concrete bound on the attacker's advantage.
Because the normal-termination requirement rules out faulting runs, memory-safety-style faults are excluded as a side effect — writes to executable memory, unmapped access, permission violations — for the modelled runs only.
Now the other column, which is longer:
| Not covered | Detail |
|---|---|
| Constant-time / side channels | No timing, cache or power-analysis claim appears anywhere. Do not let anyone imply one |
| Concurrency | The semantics models no threads and no signals |
| The rest of libsignal | poksho, zkgroup, zkcredential, signal-crypto, attest, usernames, media are entirely out of scope |
| Key generation | keygen is unverified |
| Group messaging | Future work. More than two parties is explicitly out |
| The primitives themselves | Specified by contracts, not proven — 37 external hooks plus 18 panic externs. If a real routine does not honour its modelled contract, the guarantee does not hold |
| Signal's shipped apps | The result is about their build of libsignal-cli run as a fresh process. Extending to Android or iOS is conditional on trusting those environments preserve the code's behaviour |
| Quantum attackers, multi-device state | Named in the paper's own "not covered" row, along with SPQR's post-quantum healing and adversarial first messages to later-promoted sessions |
And the limit that deserves its own paragraph: the computational bound goes vacuous at scale. If nearly every message starts a new epoch, the statistical terms make the bound vacuous for single sessions of about 25,000 messages, or for 2^20 sessions of 2^10 messages. Keep the conditional clause attached — the threshold only bites under that near-every-message assumption, and quoting the number bare overstates it.
The symbolic proof also carries hard input caps baked into the statements: stdin at most 2^20 bytes, send plaintext at most 10^6 bytes, exactly two provisioned honest parties with fixed roles, one active session per file, canonical protobuf encoding only, and 1 GiB of modelled physical memory.
7. It was already stale on announcement day
Verified: libsignal-protocol v0.105.4 (released 22 October 2026) with spqr v1.6.0.
Shipped since: v0.106.0, v0.106.1, v0.106.2 and v0.107.0 — and v0.107.0 landed on 10 November 2026, the same day as the announcement. v0.106.0 changed session management from Sesame to Tahini and cut archived sessions from 40 to 3, which is exactly the area the "weak state" bug lived in.
This is the structural cost of binary-level verification, not a scheduling slip. The proof is pinned to one compiled artifact; the library it describes moves on its own release cadence. Any "our code is formally verified" claim needs a version number next to it, and a story for what happens at the next release.
8. The numbers that actually reframe things
| Measure | AlphaProof Code | For comparison |
|---|---|---|
| Human team | 5 people, 4 weeks (proof work) | seL4: ~20 person-years. CompCert: ~6 |
| Proof code written by authors | None | — |
| Agents per campaign | 40–80, on a single machine, 24–72 hours | — |
| Compute cost | Not reported anywhere — no GPU/TPU hours, no token counts, no dollars | — |
| Human review targeting | Agents flagged "just one percent of the codebase" for a second human look — blog-only claim, not restated in the paper | — |
| Clean proof rebuild | Several hours, 15–34 GiB peak RAM | — |
The seL4 comparison is the honest headline. Even taking every number at face value, an HN commenter's arithmetic stands: a 10x productivity gain still leaves Linux-scale verification needing decades or very large expert teams. What changed is not that verification became cheap — it is that a four-week, five-person budget now reaches a target that previously needed a multi-year research programme.
Reproduce it yourself
You cannot run AlphaProof Code — there is no product, API, preview, waitlist or pricing. What you can do is re-check the proofs, which is a genuinely useful exercise if you are evaluating this class of claim. The artifacts are at google-deepmind/code-verification (Apache-2.0 for Google's code; third_party/libsignal/ remains AGPL-3.0-only).
Re-check the published Lean proofs (Linux, several hours, 15–34 GiB RAM)
# Toolchain pins are exact — the generated Lean depends on precise rustc output
# Lean 4 via elan, pinned to leanprover/lean4:v4.34.0
# Rust 1.98.1 exactly, targets aarch64-unknown-linux-{gnu,musl}
# plus protoc, LLVM ld.lld 22.1.8, Zig 0.16.0
git clone https://github.com/google-deepmind/code-verification
cd code-verification
lake exe cache get
ulimit -S -s 524288
LAKE_RESTORE_ARTIFACTS=true lake build
# Rebuild the verified binary from stock rustc and confirm it matches the pin
./scripts/cli-elf-stock --stdbin --build
./scripts/cli-elf-stock --verify-pin
lake build CliElfLib
lake script run checkCliElfOwner
# Tune threads to RAM: roughly one thread per 4 GiB free
# export LEAN_NUM_THREADS=4The comparator replay tool is Linux-only — it sandboxes builds with landrun/Landlock. And the thing actually worth reading is not the 6.5M lines; it is the ~18,000 lines of trusted specification, because that is the part no machine checked for you.
The transferable half is the review discipline. You can run the same adversarial shape against a specification in any language:
Adversarial specification review — run this against your own spec, tests or acceptance criteria
You are a skeptical reviewer. Here is a specification that a system claims to satisfy.
Your job is NOT to confirm it. Your job is to find the gap between what it states
and what a reader will believe it states.
<specification>
{paste the spec, property test, or acceptance criteria}
</specification>
Answer in five numbered sections, concretely and with no hedging:
1. VACUITY. Is there a trivial model that satisfies every clause? Describe a system
that passes this spec and is obviously useless or insecure.
2. SCOPE. List every behaviour a reader would ASSUME is covered that is not actually
stated. Be specific about concurrency, failure paths, resource limits and timing.
3. ASSUMPTIONS. Enumerate what is assumed rather than established, including anything
hooked, mocked, stubbed or specified by contract instead of verified.
4. MUTATION TEST. Propose three concrete bugs that this spec would NOT reject.
For each, say exactly which clause fails to bite and why.
5. SCALE. Identify any bound, budget or quantifier that becomes vacuous or
unenforceable as inputs, sessions or message counts grow. Give the threshold.
Do not suggest improvements. Report only what is missing or unenforceable.Vocabulary
How to read the next claim of this shape
There will be more of these, and most will be weaker. Six questions, in order of how much they tell you:
- What is in the trusted base, and how many lines is it? If nobody publishes this number, there is no result to evaluate. "6.5 million lines of proof" is marketing; "26,000 lines you must read" is the claim.
- What exactly was the subject? A binary, a source tree, a module, a function? Which version? Pin it against the project's current release — if the verified version is several releases behind, say so.
- What properties, stated as theorems? "Secure" is not a property. Forward secrecy, KCI resistance and normal termination are. Demand the "not covered" column, and check specifically for constant-time, concurrency and multi-party claims, which are the three most often silently absent.
- Was the specification tested, not just satisfied? Look for mutation testing, vacuity and satisfiability theorems, and historical-bug disproofs. A spec nothing can fail is a spec that proves nothing.
- Could the prover touch the specification? If there is no held-out copy and no mechanical diff of the statement and its dependencies, assume the goalpost moved.
- Are the artifacts public and the caveats auditable? This result's real weaknesses — the pending retarget, the unmerged branches, the
sorrystubs — are knowable only because the repo shipped. Treat an unpublished proof as an unverified claim.
Check yourself
0/5- AlphaProof Code shares a name with 2024's AlphaProof and almost nothing else: no RL, no AlphaZero, no tree search. It is LLM agents writing Lean against a sound kernel — a far more copyable design than self-play.
- The headline number is the wrong one. 6.5M lines of proof are untrusted by construction; ~26,000 lines of specification are what a human must read and believe. Ask for that number first, every time.
- Proving things about the ELF binary keeps rustc out of the trusted base — and pins the guarantee to one build. The verified version, v0.105.4, was already four releases behind on announcement day.
- Scope is much narrower than 'Signal is verified': one-to-one init/send/recv only, primitives hooked by contract, no constant-time claim, no concurrency, no groups, no keygen, not the shipped apps.
- The computational bound goes vacuous at roughly 25,000 messages in a single session when nearly every message starts a new epoch. Quote the threshold with its condition attached.
- Steal the architecture, not the headline: a held-out spec directory, a comparator that diffs the statement and all its dependencies, a blind critic for amendments, and an enumerated axiom allowlist. That pattern generalises to any check an agent could otherwise edit.
- Five people, four weeks, 40–80 agents on one machine, and none of the authors wrote proof code — against seL4's ~20 person-years. Verification did not become cheap; it became reachable on a sprint budget.
Sources & further reading
- Introducing AlphaProof Code — Google DeepMind — the announcement: the four-week framing, "powered by Gemini Carbon", the reinjected-bug claim, the one-percent human-review figure, and the forward look toward medical-device firmware and grid software
- AlphaProof Code: Verifying Signal's Security at the Machine-Code Level — the paper in full HTML. Source for the four components, the seven agent roles, the 40–80 agents / 24–72 hours figure, the line-count breakdown, Table 1's covered/not-covered split, the AArch64 semantics scope (467 instructions, 31 syscalls, 7,578 lines), the trusted-base discussion including "the Rust compiler is not trusted", and the vacuity threshold
- PDF edition of the paper — same content, citable form
- google-deepmind/code-verification — the Lean artifacts:
Computational/,Symbolic/,LibsignalBinary/,arm64-semantics/,comparator/. Apache-2.0 withthird_party/libsignal/AGPL-3.0-only; "not an official Google product"; in scope for Google's OSS VRP - docs/PAPER_MAP.md — the paper-to-repo map, and the most honest document in the set: the 37 hooks and 18 panic externs, the
T-12(d)pending retarget, the conditional ROM corollary, and the symbolic model's hard input caps - Symbolic/BugInjection/README.md — the two reinjected bugs with their upstream fix commits
- signalapp/libsignal — the real library and its crate list, which is how you see that only
libsignal-protocolplusspqrwere in scope. Releases confirm v0.105.4 (22 Oct 2026) and the v0.106.x / v0.107.0 line that followed - leanprover/comparator — the held-out-spec diff tool, sandboxed with Landlock
- leanprover/lean4 — the kernel that is the actual trust anchor; this work pins v4.34.0
- AlphaProof (2024): AI solves IMO problems at silver-medal level — the other AlphaProof: RL plus AlphaZero, 28/42 at IMO 2024, methodology published in Nature in November 2025
- Introducing CodeMender — the repair-side agent the blog pairs this with
- Hacker News discussion, 10 November 2026 — 643 points, 185 comments. The "found zero bugs?" objection, the layered "trust us" critique, the correct observation that the guarantee is bit-for-bit to one binary, and the seL4 scaling arithmetic
- Related on AILmanac: The Verification Bottleneck · Reward hacking in coding agents · The capability–reliability gap · Reviewing third-party code
Next
- The Verification Bottleneck — the constraint this result is aimed at: why trusting code, not writing it, is what limits an AI-heavy team
- Reward hacking in coding agents — the same failure mode without the gatekeeper: what happens when the agent can edit the thing that grades it
- Code Erosion — the empirical other end of the spectrum: what agents do to working code when nothing machine-checks the result