Dev.to Security 🔐 Cybersecurity 👁 0 📖 5 min read

7,546,996 lines of Lean: I counted DeepMind's Signal proof

7,546,996 lines of Lean: I counted DeepMind's Signal proof Google DeepMind says its AlphaProof Code framework generated about 6.5 million lines of Lean proof to verify Signal's cryptography down to the compiled machine

7,546,996 lines of Lean: I counted DeepMind's Signal proof

Google DeepMind says its AlphaProof Code framework generated about 6.5 million lines of Lean proof to verify Signal's cryptography down to the compiled machine code, in four weeks. I cloned the public repository and counted every line myself. The total is 7,546,996 lines across 11,377 files — and the interesting part is not that the headline number is roughly right, but where the extra half-million lines live.

What I counted

The repository is google-deepmind/code-verification, the artifact set behind the November 10, 2026 paper "AlphaProof Code: Verifying Signal's Security at the Machine-Code Level." I cloned it shallow on November 15, 2026 (HEAD b0f729a, November 11) and counted lines in every .lean file, splitting blank lines and full-line comments from code:

directory         files    total lines   code lines
LibsignalBinary    8,020    5,530,904    5,248,825
Computational      1,205    1,102,470    1,034,873
Symbolic           1,408      501,577      459,304
arm64-semantics      726      407,549      371,142
comparator            10          387          387
third_party            1           40           40
TOTAL             11,377    7,546,996    7,118,361

The clone is 530 MB on disk. For scale: the thing being proved is about 560 KB of libsignal code, roughly 140,000 AArch64 instructions. The proof is about 13,000 times larger than the code, by line count.

Where my count agrees with the paper, and where it doesn't

The paper's own breakdown, from section 7: "nearly 7 million lines of Lean, counting comments and blank lines. About 6.5 million of them are proofs: 5.3 million about the binary, which both security proofs share, about 860,000 for the computational proof and about 350,000 for the symbolic proof. Another 140,000 lines prove the reintroduced bugs, and 70,000 verify the allocator."

Against my count:

  • Binary proofs: match. LibsignalBinary has 5,248,825 code lines — the paper's 5.3 million, within rounding.
  • Total: mine is higher. 7,546,996 vs "nearly 7 million." The likeliest explanation is not an error on either side: the paper is dated November 10 and the repository kept moving — HEAD is November 11, with the commit message "Verify 10 more library routines in the binary; trusted hooks 37 → 27." A living repo outgrows its paper within a day. My number is a count of the repo as it stands, not a refutation.
  • Computational and Symbolic: mine are higher than the paper's proof-only figures. Computational holds 1,034,873 code lines vs the paper's ~860,000 "for the computational proof"; Symbolic holds 459,304 vs ~350,000. The gap is a counting-scope difference, not a contradiction: those directories contain specifications and shared infrastructure alongside proofs, while the paper counts proof files. The paper is explicit that its 6.5M is proofs only.
  • The trusted base is small, and that's the point. The paper says the specification directories hold about 54,000 lines, but reading every definition the headline theorems depend on means reading about 18,000 lines (about 28,000 with documentation), plus about 8,000 lines of AArch64 semantics and a ~95,000-line Lean representation of the compiled machine code that a tool extracts from the object files. The 6.5 million lines of proof rest on ~26,000 lines of trusted specification and semantics. That ratio — roughly 250 proof lines per trusted line — is the real cost table. The proofs are checked by Lean's kernel; the specifications are where human judgment lives, and the paper says the majority of the team's effort went into specifications, not proofs.

What was actually proved

The target is libsignal v0.105.4 with spqr v1.6.0, built by stock rustc 1.98.1 into a single AArch64 Linux executable, with cryptographic primitives hooked. The proofs cover Signal's post-quantum PQXDH handshake and Triple Ratchet, establishing forward secrecy, authentication, post-compromise security, and handshake secrecy — ten symbolic theorems, with the main result named signal_session_secure_placed. This is the first proof connecting protocol-level guarantees to the unmodified code of a widely used implementation, rather than to a model of the protocol.

Two things keep the claim honest, and both are in the paper rather than the press release. First, the verification is scoped to selected properties of a CLI harness under stated models and cryptographic assumptions — it does not make the Signal app "unhackable." Second, the Rust compiler is explicitly not trusted: a compiler bug that compromised the formalized properties would make the theorems false and the proofs fail.

The control experiment is the part worth stealing

The strongest section of the paper is section 6, "Finding Historical Bugs," and it's the part other teams should copy. To check whether their specifications were strong enough to catch real bugs, the team reintroduced two previously fixed libsignal bugs — "weak state" (fix cd36118) and "small subgroup" (fix 5293caa) — by reverse-applying the upstream fix commits and recompiling, then proved in Lean that the resulting binaries violate the symbolic security theorem. Each disproof exhibits concrete witness inputs: for the small-subgroup bug, an attacker flips bit 255 of the X25519 base key, producing a distinct encoding with the same Diffie-Hellman outputs, which the model rejects but the buggy binary accepts. About 140,000 lines of the repo prove these two reintroduced bugs.

That is a negative control, run at the level of the compiled binary, and it's what separates this from a 6.5-million-line flex. A proof system that can't fail on a known-bad binary is a very expensive linter. This one can, and the paper shows the receipts.

The cost, in people and time

Five researchers, four weeks, agents running nonstop on their own workstations, working in parallel on symbolic and computational proofs. The specification work was done by humans and agents powered by Gemini 4 Carbon and Claude Opus 5.5, with an agent from a different model family reviewing each draft for faithfulness and strength. DeepMind's blog says agents flagged about 1% of the codebase for a second human look.

What I did not do: I did not re-run Lean over 6.5 million lines of proof — that would take a build farm and days, and the kernel check is the part Lean itself guarantees. I counted lines, verified the directory structure against the paper's breakdown, and read the paper's claims against the repository as published. The headline survives that audit with one footnote: the repo has already grown past the paper's count, by about half a million lines in a day.

The takeaway is not "AI wrote 6.5 million lines." It's that the expensive part moved: once proofs are cheap, the hard question is what to prove, and the trust sits in 18,000 lines of specification that humans still have to read. The proof count is a vanity metric; the spec-to-proof ratio and the negative control are the numbers that matter.

Sources: Google DeepMind, "AlphaProof Code: Verifying Signal's Security at the Machine-Code Level" (November 10, 2026); Google DeepMind blog, "Introducing AlphaProof Code" (November 10, 2026); google-deepmind/code-verification (cloned November 15, 2026, HEAD b0f729a). All line counts are my own, run on the clone described above.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.