AlphaProof Code: The AI Wrote 6.5 Million Lines. Humans Had to Trust 26,000.

AlphaProof Code: The AI Wrote 6.5 Million Lines. Humans Had to Trust 26,000.
AlphaProof Code generated 6.5 million lines of machine-checked proof for Signal’s cryptographic implementation. The profound change is not that AI can write more code. It is that most of what it writes may no longer need to be trusted.

In short

  • Google DeepMind used AI agents to prove specific security properties of compiled Signal protocol code. The result covers an AArch64 binary built from unmodified libsignal v0.105.4 and SPQR code—not the entire Signal application.
  • The agents generated about 6.5 million lines of Lean proof. Those lines are untrusted: Lean’s kernel rejects a logically invalid proof. The roughly 26,000 lines of specifications and machine semantics remain inside the trust boundary.
  • A five-person team ran the project for four weeks. The paper says none of its authors wrote proof code; most human effort went into deciding and reviewing what should be proved.
  • For enterprises, the scarce artifact shifts from implementation to intent: precise invariants, threat models, assumptions and expert-reviewed specifications.

A message leaves one phone while its recipient is offline.

It passes through a server that does not need to be trusted with its contents. An attacker can watch the network, delay the message, replay old material and, in the security model, steal certain keys. The recipient eventually comes online. The message still has to be private, authentic and recoverable by the right person—while remaining useless to everyone else.

That promise sounds like a sentence. In production it becomes Rust, cryptographic primitives, mutable session files, protobuf encodings, an optimizing compiler, registers, stack frames, memory addresses and AArch64 machine instructions. Somewhere between “keep the message secret” and the bytes executed by a phone lies the space where implementation bugs live.

In November 2026, a five-person Google DeepMind and Google team set out to bridge that space for key parts of Signal’s protocol implementation. Four weeks later, its AI agents had produced approximately 6.5 million lines of Lean proof. [1] [2]

No security team could sensibly review 6.5 million generated lines one by one. That was the point. The lines were not asking to be trusted.

Human-reviewed boundary · theorem statements + definitions + machine semantics
Agent output · approximately 6,500,000 lines of Lean proof
Gatekeeper · Lean kernel → accept only if the proof checks

The researchers call the framework AlphaProof Code. It used agents to help write specifications, other agents to challenge them, and teams of Gemini 4 Carbon agents to construct the proofs. A small deterministic proof checker stood at the end. It did not care whether the agents were confident, persuasive or internally consistent. Either the proof established the approved theorem, or it did not compile.

AI made the proof enormous and cheap enough to generate. It did not make the promise automatic. Once proof-writing stopped being the bottleneck, deciding exactly what the software should guarantee became the hard part.

The difference between a test and a proof

Software testing asks a sequence of concrete questions. Does this input produce the expected output? Does the service reject an expired token? Does the database preserve the balance after these transfers? A good test suite asks thousands of them, including cases designed to break the system.

But a test always samples. If S is the set of inputs the team tried and P(x) is the property it wants, testing establishes:

for every x in the tested set S, P(x) held

A formal proof aims at a different statement:

for every x permitted by the formal model M, P(x) holds

The second claim is stronger and narrower at the same time. Stronger, because it covers every execution admitted by the model rather than the examples the testers happened to choose. Narrower, because it promises only the property that was written down, under the assumptions that were written down, inside the system boundary that was written down.

A proof that a payment ledger conserves money does not prove that its interface is usable. A proof that an authorization check blocks every unapproved account does not prove the service never runs out of memory. A proof of message confidentiality does not prove that a compromised phone cannot reveal what appears on its screen.

This is the first discipline required to understand AlphaProof Code. The work does not show that Signal has no bugs. It proves stated protocol-level security properties of a particular compiled implementation within two formal security models.

What was actually placed inside Lean

The target was not the entire Signal application. The team took unmodified libsignal v0.105.4 and SPQR crates, connected them to a small command-line harness, and compiled them with the stock Rust compiler into an AArch64 Linux executable. Lean then reasoned about that binary through a formal model of the processor. [2]

The proofs cover Signal’s post-quantum PQXDH handshake and Triple Ratchet for one-to-one sessions. The reported properties include message confidentiality and authenticity, forward secrecy, post-compromise security, handshake authentication and several forms of handshake secrecy. The adversary can control the network and server and, under specified conditions, compromise keys or session state.

Why descend to machine code? A source-level proof must ordinarily trust the compiler to preserve the relevant property. Compilers are immense pieces of software. A source program can be correct while a compiler bug changes the emitted binary. By proving facts about the compiler’s output, AlphaProof Code removes rustc and LLVM from this particular trust chain.

That choice creates its own cost. At machine level, a proof must care about registers, stack layout, addresses and every branch that a source-level abstraction would hide. This helps explain how a relatively small executable can produce millions of lines of proof.

The result can be pictured as a ladder:

Security goal · secrecy, authenticity, recovery after compromise
↓
Approved Lean specification · precise attacker, assumptions and theorem
↓
Execution model · AArch64 semantics + Linux process environment
↓
Compiled binary · the actual instructions checked against the executable
↓
Proof · every rung connected and checked by Lean

The agents could take any route through this ladder. They could write verbose proofs, rediscover existing lemmas or spend a day on a dead end. Their reliability was not the root of the final guarantee. The checker was.

Six and a half million lines that remain untrusted

The numerical contrast is the most arresting part of the paper. The complete Lean proofs occupy roughly 6.5 million lines. The statements and definitions that a reader must inspect and trust occupy about 18,000 lines in the repository, accompanied by roughly 8,000 lines of AArch64 semantics and symbol information.

6,500,000 ÷ (18,000 + 8,000) = 250

There are roughly 250 generated proof lines for each line in that stated trusted surface. This is not a 250× productivity result. A proof line and a specification line do different work; line counts do not measure difficulty; the trusted base includes assumptions and tooling beyond a simple file count. The ratio nevertheless captures the architectural inversion.

Traditional code review concentrates human attention on implementation because implementation is where correctness is believed to live. In this workflow, a vast implementation of the argument can be treated as hostile input. Lean’s small kernel checks it. Human attention moves toward the theorem statement, its definitions and its assumptions.

The paper makes this distinction unusually clear. A faulty generated proof does not weaken a theorem; it fails to establish it. A faulty specification can be much worse. It can make a weak theorem perfectly provable.

The specification trap

Imagine asking a system to prove that every withdrawal is authorised. A careless specification defines “authorised” as “the request contains a non-empty user ID.” The implementation satisfies the theorem. The proof is valid. The product is insecure.

Formal verification has not failed in that example. It has delivered exactly the guarantee requested. The error lives in the contract between human intent and mathematical statement.

AlphaProof Code therefore freezes the specification before the proof campaign. Agents draft Lean definitions and theorem statements from papers, standards and code. Reviewer agents from another model family challenge whether the draft matches its source, rules out plausible bugs and remains strong enough. Humans revise and approve it; the approved Git commit becomes the gatekeeper’s baseline.

The team also tests the specification itself. It proves that hypotheses can hold together, reducing the risk of a theorem that is vacuously true because its assumptions contradict one another. Agents introduce mutations—such as skipping a message-authentication check—and verify that the security theorem becomes false. These are tests of the promise, not merely the implementation.

The work exposed how difficult this layer is. The authors catalogued more than 200 departures between their computational Lean statements, reference literature and production code, plus about 35 in the symbolic formalisation. They report repairing 15 gaps or bugs in a published Double Ratchet analysis before the proofs could proceed. [2]

Most of the human effort went here. The paper says agent-written specifications were sometimes difficult to audit until people explicitly requested more legible rewrites. Proof code could be cheap and ugly. Trusted intent could not.

Two old bugs walk back into the binary

A theorem that never fails may be profound or toothless. The researchers needed to distinguish the two.

They took two real libsignal bugs found and fixed previously, reversed their repair commits in an isolated copy, compiled the altered binaries and asked whether the symbolic security theorem still held.

One bug could retain an unconfirmed session state containing a signed-prekey secret after an unusual decryption path. The other failed to reject a malformed X25519 public key, allowing a replayed handshake to create a second session with the same shared secret. For each modified binary, the system produced a complete Lean-checked demonstration that the security theorem was false, including concrete witness inputs and the relevant AArch64 execution. [2]

This does not mean AlphaProof Code discovered two new Signal vulnerabilities. It means the approved specification was sensitive to two historical implementation failures that mattered. Mutation testing connected the formal promise to defects already known to be real.

That is a useful enterprise pattern. A specification for a refund service should fail against previous double-refund bugs. An isolation theorem for a SaaS platform should fail when an old cross-tenant query is reintroduced. A proof campaign becomes more credible when yesterday’s incidents can break tomorrow’s theorem.

The agents did not behave like one enormous model

The “multi-agent” label can conceal more than it explains. Here, the division of labour is concrete.

Stage 1
Specify

An agent drafts definitions and theorem statements from research, standards and implementation behaviour.

Stage 2
Challenge

Reviewer agents test fidelity, strength, assumptions, satisfiability and exposure to known bugs.

Stage 3
Approve

Humans resolve ambiguity, assess security trade-offs and freeze the trusted specification.

Stage 4
Prove

An orchestrator divides obligations among worker agents that write and repair Lean proofs.

Stage 5
Gate

The gatekeeper rejects changed statements, unfinished obligations and proofs the Lean kernel cannot check.

Stage 6
Stress

Mutations and historical bugs test whether the theorem excludes behaviour it was meant to forbid.

A five-person team ran dozens of prover agents continuously on separate workstations for four weeks. Specification work used Gemini 4 Carbon and Claude Opus 5.5 in an iterative drafting and review loop. The proof teams used Gemini 4 Carbon. The paper says none of the authors wrote any proof code. [2]

Keeping the agents productive was itself an engineering project. They shared discoveries through a bulletin file, tried to refute goals before assigning them, batched memory-heavy Lean builds, watched for stalled workers and reused lemmas. Every new invariant needed a witness showing that it held in some reachable state, preventing progress through empty claims.

The impressive part is not that several chatbots talked to one another. It is that their work occurred inside an environment where incomplete, altered or logically invalid output could not silently become a result.

The proof has an edge

A formal guarantee is a shape with a boundary. AlphaProof Code’s boundary should be part of any serious account of the work.

Inside the reported resultOutside or still assumed
Unmodified libsignal v0.105.4 and SPQR compiled to an AArch64 CLI binaryThe whole Signal application, user interface and operating system
One-to-one PQXDH and Triple Ratchet flowsGroup messaging, sealed sender, server-side protocols and multi-device state
Classical computational security and specified symbolic post-quantum propertiesA general quantum computational guarantee and SPQR’s full post-quantum healing
Binary execution under formal AArch64 semanticsCorrectness of the trusted semantics, Lean kernel, build tooling and external contracts
Security properties in the approved modelsEvery possible bug, crash, side channel, availability or privacy failure

The computational model also simplifies the environment: fixed message lengths, one session per promotion and no multi-device state. Some low-level cryptographic routines are represented through idealised contracts. Two output functions and several library routines remain in the trusted base. The paper documents where its bound becomes uninformative at very large scales.

None of this negates the achievement. It tells an engineer precisely what was achieved. “Verified” is valuable when followed by four questions: which binary, which property, under which assumptions, against which adversary?

What enterprises should prove first

Most companies should not begin by translating their entire application into Lean. Formal verification pays first where a small invariant controls a large consequence.

A payments system can prove conservation: money entering and leaving a ledger must balance under every permitted transition. A permissions service can prove non-interference: one tenant’s actions cannot expose another tenant’s records. An agent platform can prove confinement: regardless of what the model requests, an irreversible tool cannot execute without a valid approval token. A database migration can prove that a transformed record preserves required fields and relationships.

The appropriate unit is not “prove the product.” It is “identify the property whose violation would be catastrophic, define the smallest boundary that contains it, and prove that boundary.”

This also changes evaluation data. An enterprise trying to train verification agents needs more than repositories labelled good or bad. It needs expert-authored invariants, threat models, proof obligations, counterexamples, rejected specifications, historical incidents and explanations of why an assumption is acceptable. Those are expensive because they encode professional judgement rather than syntax.

For Perit, this is the direct opportunity. The frontier dataset for reliable coding agents may be a corpus of reviewed intent: what must always remain true, what the system may assume, what an attacker may control, which exception is deliberate, and which plausible theorem is dangerously weak.

The source file may stop being the source

Software development has treated source code as the privileged object. Requirements are informal. Tests surround the implementation. Reviewers inspect diffs. The executable is trusted because enough humans and tools have looked upstream.

AlphaProof Code suggests a different hierarchy for critical systems. Humans review the specification. Agents generate or modify an implementation. Other agents produce a proof. A small checker decides whether the implementation still satisfies the approved promise. The generated code and proof can change freely so long as the theorem remains intact.

That future is not here in general. Specifications remain difficult, proof campaigns consume substantial compute, and many business requirements resist clean formalisation. The Signal work itself required cryptographers, established research models and repeated human intervention. It reports no universal cost estimate for applying the method elsewhere.

But the direction is visible. When code becomes abundant, reviewing every line becomes less plausible. Assurance has to move upward into the statement of intent and downward into deterministic checking.

The 6.5 million lines are spectacular because of their size. Their deeper significance is that they could be treated as untrusted.

The 26,000 lines are smaller. They are where the promise lives.

References

  1. Google DeepMind, “Introducing AlphaProof Code: a breakthrough in verifying complex software at depth”, 10 November 2026.
  2. Swarat Chaudhuri et al., “AlphaProof Code: Verifying Signal’s Security at the Machine-Code Level”, Google DeepMind, 10 November 2026.
  3. Google DeepMind, interactive paper and formal verification artifacts, accessed 13 November 2026.
  4. Google DeepMind, AlphaProof Code Lean development repository, accessed 13 November 2026.
Was this article helpful? No ratings yet