Sebastien Rousseau

FORMAL VERIFICATION

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

AlphaProof Code used teams of AI agents to write about 6.3 million lines of machine-checked Lean proof for libsignal, and the unmodified compiled binary is what those proofs speak about.

13 min read
Banner for: Proving Signal Correct at the Machine-Code Level with AlphaProof Code

AlphaProof Code used teams of AI agents to write about 6.3 million lines of machine-checked Lean proof for libsignal, and the unmodified compiled binary is what those proofs speak about.

Executive Summary

  • AlphaProof Code is a framework for human–AI collaboration on formal specification and verification of real-world software.
  • Applied to libsignal, agents generated about 6.3 million lines of machine-checked Lean proof, resting on about 27,000 lines of trusted specifications and AArch64 semantics.
  • The proofs cover key security properties of Signal's post-quantum PQXDH handshake and Triple Ratchet (forward secrecy, authentication, post-compromise security and handshake secrecy), and the authors claim they are the first to connect protocol-level security guarantees to the unmodified code of a widely used cryptographic protocol implementation.
  • Because Lean's kernel checks every proof, the reliability of results doesn't depend on the reliability of the proving agents. The specification, however, must be trusted, and a flaw in it weakens the guarantee.
  • The results suggest AI may make formal verification, historically too expensive for most software, practical for real-world systems. Human judgement stays in the loop.

Why this result matters to people who ship cryptographic software #

Signal is described as the de facto global standard for end-to-end encrypted messaging, with variants of the protocol deployed in WhatsApp, Meta's Messenger app, and Google Messages. When a protocol sits underneath that many conversations, the gap between a design proved secure on paper and the compiled code that actually runs stops being academic. A paper proof can be flawless while the implementation does something else entirely.

That gap is what this work targets. The authors give the first proofs of protocol-level security properties for a widely deployed, unmodified implementation of a cryptographic protocol. Read that sentence twice, because each qualifier is doing work. Protocol-level means the proofs address properties such as forward secrecy rather than only the absence of memory errors. Widely deployed means libsignal, not a research prototype. Unmodified means nobody rewrote the code into a friendlier shape for the prover.

For founders, the practical reading is about cost. The authors present formal verification as an alternative to reactive bug finding: one specifies the correctness and security properties a software system must enforce and then mathematically proves that the system satisfies them. They describe it as historically too expensive for most software. The authors' results suggest that AI can make it practical for real-world systems. That's a hedged claim, and I'll treat it as one: it's a suggestion supported by one large case study, not a settled economics result. Even so, a case study at this scale is a more serious piece of evidence than most claims in this area get.

The verification problem is harder than it looks #

The framework's source material points to a familiar benchmark for how demanding verification can be: the CompCert verified C compiler, which took six person-years to verify, according to the figure as reported here. Treat that number with some care, since the parenthetical about person-years is a construction of the source rather than a direct quote. The point survives regardless: verifying serious software has been a multi-year commitment.

Verifying pre-existing industrial-strength code is stated to be even harder, because the prover cannot modify the code to make the proof simpler. A production library as compiled by an optimising compiler is exactly this case. If you're free to restructure the program, you can shape it so the proof falls out naturally. If you must take the code as it is, you inherit every awkward idiom and compiler decision.

AlphaProof Code takes the harder route on purpose. The unmodified Rust code is compiled with the standard compiler, and the executable is loaded into Lean together with a semantics of AArch64. Concretely, the authors link libsignal into a small command-line harness and compile it with the stock rustc compiler to AArch64 Linux machine code. The object of proof is the machine code. That's a stronger target than source-level reasoning, since the compiler is no longer something you have to trust to preserve the properties you've shown.

How the framework divides the labour #

AlphaProof Code is a framework for human–AI collaboration on the formal specification and verification of real-world software. It rests on a principle that I find persuasive: the majority of human effort in software verification now lies in engineering the specification. Proof-writing, the part that used to consume specialist years, is increasingly something machines can do.

The authors argue, from their own results, that even large proofs about software can be written by teams of AI agents once a specification is fixed, and that the proof agents can work autonomously because the Lean kernel checks every proof in the end. Their framework splits the work in two. A human user and AI agents collaboratively write Lean specifications of real-world code, and, once the user has vetted a specification, a team of autonomous agents proves that the code satisfies it. The authors are explicit that, for large, complex systems, AI assistance can reduce the cost of specification writing and assurance but not completely replace human judgment and review.

The specification phase isn't a rubber stamp. A pool of reviewer agents checks that a draft is faithful to its sources and to the implementation. In the authors' process, the user reviews, revises and approves the specification before any proofs are written, and its git commit becomes the baseline that the gatekeeper later checks proofs against. They report that it can take many rounds of iteration between the user and the agents to arrive at a good specification, even when a model from the literature exists; for Signal, composing the prior handshake and ratchet models and covering the new post-quantum ratchet took several rounds of drafts and review. Anyone expecting a one-shot prompt to produce a trustworthy specification should adjust their expectations.

The authors propose a division of responsibility: human authors select what to prove, resolve ambiguities, evaluate security trade-offs and make all final decisions, while AI agents draft and test specifications under human direction. I'd call this the right stance. It assigns judgement to the party that can be held accountable for it.

All agents in AlphaProof Code, including the specification writer, are general-purpose coding agents whose behaviour is defined by skills, which are natural-language documents. There's no bespoke prover architecture described here. The behaviour is steered by prose documents, which makes the system comparatively easy to inspect and adjust.

Where trust actually lives #

The most important design decision in the framework is what it declines to trust. The multi-million-line proofs produced by AI agents are untrusted, because any logical error in a proof is rejected by Lean's kernel. Put differently, because the proof is ultimately checked by the Lean kernel, the reliability of the results does not depend on the reliability of the proving agents.

This matters because, as the authors put it, the reliability of the results does not depend on the reliability of the proving agents: the proof is ultimately checked by the Lean kernel. According to the paper, the gatekeeper agent accepts a proof only if Lean's kernel checks it and the Lean comparator confirms that it proves exactly a held-out copy of the specification. Two conditions, then. The proof must be valid, and it must be a proof of the right statement. The second condition is designed to guard against a subtle failure: an agent that changes the statement and proves something easier than what was asked. The comparator checks that the statement and every definition it depends on are identical to the held-out copy, and that the proof uses only Lean's standard axioms.

The trusted base is correspondingly small by the standards of the proof itself. About 27,000 lines of trusted specifications and AArch64 semantics support about 6.3 million lines of proof. A reviewer's attention is finite, and this ratio tells you where to spend it.

But the specification is the weak point, and the authors say so plainly. A specification in AlphaProof Code consists of a set of Lean theorem statements together with every definition they depend on. It must be trusted and cannot be automatically checked, and a flaw could weaken the guarantee the theorem provides. A theorem that makes overly restrictive assumptions on the inputs, asserts only weak properties of the output, or places too few constraints on existentially quantified witnesses can hold even for buggy code. If a mistake in the specification weakens the capability of the attacker, the security guarantee is weakened too.

Definitions can also include extern contracts that define assumptions about parts of the system outside the scope of the verification campaign. Those are honest boundaries, but they are boundaries: whatever sits behind an extern contract is assumed, not proved.

So the headline number, 6.3 million lines, is the least important figure for assessing whether you should trust the result. The 27,000 lines are the ones to read.

What was proved about Signal #

The proofs cover Signal's post-quantum PQXDH handshake and Triple Ratchet, establishing forward secrecy, authentication, post-compromise security and handshake secrecy. The PQXDH handshake and the Triple Ratchet are designed to ensure the security of messages even when some of the keys are compromised, and even against future adversaries with access to a quantum computer.

Two classical modelling traditions frame what "security" means here. The symbolic model, also known as the Dolev–Yao model, treats the cryptographic primitives as abstract "black boxes" achieving standard security properties. The computational model bounds an efficient attacker's success probability by the hardness of the underlying primitives. The computational security proof states that there exists a reduction from an attack on the protocol to a violation of an underlying assumption.

The two models give different guarantees, and the results are split accordingly. The agent-written proofs establish forward secrecy, post-compromise security, and message confidentiality and authenticity directly for the compiled binary against classical attackers. In the symbolic model, they establish handshake secrecy against a future quantum attacker. A careful reader should hold on to that distinction. The quantum-adversary result is stated in the symbolic model, and the classical-attacker results are the ones stated directly for the compiled binary.

There's a second wrinkle that explains why the specification work was hard. The existing specifications analyse the handshake and the ratchet separately and predate Signal's post-quantum ratchet; prior formal models of Signal analysed its initial handshake and its ratchet separately. A proof about the deployed protocol needs both together, along with the post-quantum ratchet. With human guidance, the agents extend the existing specifications to the protocol as deployed. This is a good illustration of the collaboration model in practice: the literature provides a starting point, humans steer, and agents do the extension.

The authors also state that their work shows AI can verify machine code against rich specifications from the research literature, including properties of the interaction between a stateful program and an adaptive adversary. That's a notable class of property. A stateful program facing an adaptive adversary is precisely the situation a messaging client is in.

The authors claim priority: in their words, these are the first proofs connecting protocol-level security guarantees to the unmodified code of a widely used cryptographic protocol implementation. It's their own claim, not an independent finding, and I report it as such. They describe the results as a significant milestone towards a grand challenge launched in April 2026.

Do the specifications catch real mistakes? #

A specification that can't distinguish correct code from broken code is worthless, and a proof against it is worth even less. The authors tested for this directly. They re-introduced two previously fixed libsignal bugs and built a suite of 17 synthetic mutants to check that the specifications catch real mistakes.

The outcome, as the authors report it: for both historical bugs and, so far, 16 of the 17 synthetic mutants, Lean proves that a recorded trace (one witness trace each) cannot be explained by the symbolic specification under a concrete primitive interpretation matching the recorded run. Full binary refutations of both historical bugs were kernel-checked only against an earlier (36-hook) untrusted placed variant of the statement; retargeting them to the main theorem's trusted statement remains open.

I want to be precise about what this does and doesn't say. Sixteen of seventeen is not seventeen of seventeen, and the case study gives no account of the remaining mutant, so I won't speculate about it. Also note the qualifier on the historical bugs: the full binary refutations were checked against an earlier, 36-hook untrusted placed variant of the statement, not necessarily the final one. That's a detail worth knowing before anyone cites the result as a clean sweep.

Still, this is the right kind of test. It attacks the specification, which is where the framework says the residual risk lives, rather than showing off the proof volume. Mutation testing of a specification is cheap relative to the verification campaign, and it answers a question that no amount of kernel-checked proof can: would this statement have noticed a real bug?

What this means for practice #

The limits deserve as much attention as the milestone. For large, complex systems, AI assistance can reduce the cost of specification writing and assurance but not completely replace human judgement and review. The authors don't claim otherwise. The economics shift, but they don't collapse to zero, and the part that remains human is the part that determines whether the guarantee means anything.

I think that division is correct, and it suggests a sensible way for a team to read this work. Don't ask whether agents can write proofs; the libsignal result, at about 6.3 million lines, answers that. Ask who on your team can write and vet a specification of the kind described here: Lean theorem statements plus every definition they depend on, with extern contracts marking what's assumed. That person, and the review process around their work, is the scarce resource.

There's also a design lesson in how the system treats unreliable components. It doesn't try to make agents trustworthy. It makes their trustworthiness irrelevant to the outcome by routing everything through a small, fixed checker. Teams building agentic systems in other domains could ask the same question of their own pipelines: what is the equivalent of the Lean kernel, and is the gatekeeper checking the right statement?

For readers outside cryptography, the generalisable point is the shape of the workflow, not the specific protocol. In the authors' design, humans and agents draft the specification together, reviewer agents check it for faithfulness, a human approves it, a commit freezes it as the baseline, autonomous agents prove it, and a gatekeeper checks both that each proof is valid and that it proves exactly the approved statement. Each stage targets a different failure mode.

None of this should be oversold. The suggestion that AI makes verification practical for real-world systems is hedged in the source, and one flagship case, however impressive, is one case. The specification remains a trusted artefact that no tool checks for you. And the quantum-adversary guarantee is a symbolic-model result for handshake secrecy, not a computational one.

The open question the case study raises is the one the authors point toward by calling this a milestone towards a grand challenge launched in April 2026: if proof-writing is now cheap once a specification exists, does specification engineering become the next bottleneck to attack? The mutation results suggest the specification can be tested, and the "many rounds of iteration" finding suggests it's still slow. How much of that slowness can agents absorb, while humans keep the final decisions? That's the number worth watching in the next case study.

Frequently Asked Questions #

What is AlphaProof Code? A framework from Google DeepMind and Google for human–AI collaboration on the formal specification and verification of real-world software. A human user and AI agents write Lean specifications together; once the user has vetted a specification, a team of autonomous agents proves that the code satisfies it.

What exactly was verified in libsignal? The unmodified Rust code of libsignal, compiled with the stock rustc compiler to AArch64 Linux machine code. The proofs cover forward secrecy, authentication, post-compromise security and handshake secrecy for Signal's post-quantum PQXDH handshake and Triple Ratchet.

Why don't the AI agents need to be trusted? Every proof is checked by Lean's kernel, and the gatekeeper accepts a proof only if the Lean comparator confirms that it proves exactly a held-out copy of the approved specification. A logical error is rejected, and so is a proof of an easier statement.

What still has to be trusted? About 27,000 lines of specifications and AArch64 semantics, plus any extern contracts that describe parts of the system outside the campaign. The specification cannot be checked automatically, and a flaw in it weakens the guarantee the theorem provides.

Does the work prove security against quantum attackers? Partly. Handshake secrecy against a future quantum attacker is established in the symbolic model. Forward secrecy, post-compromise security, and message confidentiality and authenticity are established directly for the compiled binary against classical attackers.

References #

Last reviewed .

Syndicate this article

Format for Medium

# Proving Signal Correct at the Machine-Code Level with AlphaProof Code

> Originally published at [https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/](https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/)

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

Read the full article on sebastienrousseau.com: https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/

Format for Mastodon

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/

Copy formatted for LinkedIn

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

Here are the key strategic takeaways:

- Why this result matters to people who ship cryptographic software. Signal is described as the de facto global standard for end-to-end encrypted messaging, with variants of the protocol deployed in WhatsApp, Meta's Messenger app, and Google Messages.
- The verification problem is harder than it looks. The framework's source material points to a familiar benchmark for how demanding verification can be: the CompCert verified C compiler, which took six person-years to verify, according to the figure as reported here.
- How the framework divides the labour. AlphaProof Code is a framework for human–AI collaboration on the formal specification and verification of real-world software.
- Where trust actually lives. The most important design decision in the framework is what it declines to trust.

What is your organisation's approach to the challenges outlined in this piece?

→ https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/

#FormalVerification #AlphaproofCode #LeanTheoremProver #Libsignal #SignalProtocol

Sebastien Rousseau | CC-BY-4.0
Cite this article

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

BibTeX

@online{rousseau2026proving,
  author  = {Rousseau, Sebastien},
  title   = {{Proving Signal Correct at the Machine-Code Level with AlphaProof Code}},
  year    = {2026},
  url     = {https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/},
  urldate = {2026}
}

RIS

TY  - GEN
AU  - Rousseau, Sebastien
TI  - Proving Signal Correct at the Machine-Code Level with AlphaProof Code
PY  - 2026
UR  - https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/
ER  -

Vancouver

Rousseau S. Proving Signal Correct at the Machine-Code Level with AlphaProof Code. sebastienrousseau.com. 2026 Nov 28. Available from: https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/

Chicago

Rousseau, Sebastien. "Proving Signal Correct at the Machine-Code Level with AlphaProof Code." sebastienrousseau.com. November 28, 2026. https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/.

APA

Rousseau, S. (2026, November 28). Proving Signal Correct at the Machine-Code Level with AlphaProof Code. sebastienrousseau.com. https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/

Republish this article

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

This article is licensed under Creative Commons Attribution 4.0 International. Republication requires attribution to the canonical URL.

Proving Signal Correct at the Machine-Code Level with AlphaProof Code

Google DeepMind's AlphaProof Code had AI agents write 6.3 million lines of Lean proof for libsignal's compiled binary. The specification is what you trust.

Originally published at https://sebastienrousseau.com/2026-11-28-alphaproof-code-signal-machine-code-verification/ by Sebastien Rousseau.
Licensed under CC-BY-4.0.