AI Proved Signal's Encryption Mathematically for the First Time: 6.5 Million Lines of Proof in Four Weeks
Google DeepMind used AI agents to mathematically prove key security properties of Signal's core code — about 6.5 million lines of machine-checked Lean proof, produced in four weeks. It is a genuine milestone, but the proof covers one-to-one sessions only, and the specification itself still has to be written by humans.

Security that is proven, not tested into existence
On November 10, Google DeepMind announced a result the software security field has waited years for: researchers used AI agents to mathematically prove key security properties of the core code of the Signal cryptographic protocol. The work uses a new framework called AlphaProof Code. The blog post is titled "Formal Verification of Signal's Protocol with Gemini", and its subtitle is even more direct — "a breakthrough in verifying complex software at depth". DeepMind's claim is that this is the first time AI has formally verified a widely deployed cryptographic protocol at this depth, and the first time anyone, with or without AI, has formally verified the actual implementation of such a protocol rather than just its design.

The term "formal verification" needs explaining first, because it is the threshold for the whole story. Normally we assure code safety through testing, bug hunting, and code review — all of which are sampling: the scenarios you tested came back clean, which says nothing about the ones you did not test. Formal verification takes a different road: first write down, as a rigorous mathematical specification, exactly which security properties the code must satisfy, and then prove mathematically that the code satisfies them in every case. Once a proof passes, bugs and attacks that would violate those properties are ruled out together — not "probably absent", but "impossible under the specification". The price is that it is famously difficult and famously expensive, which is why, after decades, only a handful of systems have ever been formally verified. The news value of AlphaProof Code is that it hands this job — long reserved for the most critical systems — to AI agents for the first time, and does so at production-code scale.
So what exactly was proven? The target is libsignal, the reference implementation of the Signal protocol — the same code the Signal app itself uses, and the origin of the end-to-end encryption in WhatsApp, Messenger, and Google Messages. The proofs cover the two most central parts of the protocol: the post-quantum PQXDH handshake and the Triple Ratchet. The properties proven include message confidentiality and authenticity, forward secrecy (past messages stay safe even if today's keys leak), post-compromise security (security recovers after a device is temporarily compromised), and handshake authentication and handshake secrecy. The scope comes with a firm qualifier: one-to-one sessions, the core handshake and ratchet — not the whole Signal app, not group chats, and not the security of the phone or operating system underneath. DeepMind does not blur this in the blog, and the paper states the scope just as strictly. The first thing to discard when reading this story is "Signal has been proven unhackable".
More worth discussing is the depth of the proof. For decades, formal verification of cryptographic protocols mostly stopped at the design level: the blueprint was verified while the code was assumed to follow it. But real-world vulnerabilities often hide in the gap between design and implementation — how the code is written and how the compiler compiles it can both introduce problems the blueprint never had. AlphaProof Code's agents went further: they proved properties of the compiled code itself. According to the paper, the researchers took the unmodified Rust code, compiled it with the stock compiler into AArch64 machine code, and proved that this machine code satisfies the security properties — without needing to trust the compiler. The blog puts it in one key sentence: the agents proved whether "the exact code running on devices" delivers the security protections the experts specified. Because bridging the gap between design and implementation makes the proofs vastly more complex, that is also what backs DeepMind's "first time" claim.
How does the work divide up? AlphaProof Code is a multi-LLM agentic framework whose division of labor deliberately mirrors a research team. First, human experts work with a mix of models to translate Signal's security goals into formal mathematical specifications written in Lean — a language in which a machine can check whether a proof is correct — with human experts reviewing every one. The final word on whether a proof holds belongs to Lean's kernel, not to the agents that wrote it. Second, teams of agents powered by Gemini Carbon write the proofs, producing about 6.5 million lines of machine-checked Lean proof code. Third, the agents audit the proof themselves and flag the areas that need a second look by a human — just one percent of the codebase; the rest is checked automatically by Lean, so experts focus their review where human judgment matters most. Finally there is a gatekeeper: a proof is accepted only if Lean's kernel checks it and confirms it proves exactly the locked-in copy of the specification. The paper states the principle plainly: humans decide what to prove, resolve ambiguities, evaluate security trade-offs, and make all final decisions; agents draft and test specifications under human direction, and once a specification is fixed, they write the proofs autonomously.
The numbers travel fastest and need the most careful checking. Per the paper, the proofs total about 6.5 million lines of Lean; against that, the specifications and semantics a reader must actually read and trust amount to only about 26,000 lines (roughly 18,000 lines of specification theorems plus about 8,000 lines of AArch64 semantics), with the remaining millions of lines machine-generated and machine-checked. The whole verification took just four weeks, where historically this kind of work takes expert teams years: the paper names two benchmarks — the seL4 microkernel, one of formal verification's greatest successes, took twenty person-years, and the verified C compiler CompCert took six — and both of those systems were written specifically to be verified, while AlphaProof Code faced unmodified production code. One inconsistency is worth recording: the blog's body text says "over six million lines of Lean", but the page's own summary says "over three million lines". The paper's figure of 6.5 million lines is the most complete, so this article uses the paper's number and records the blog's internal mismatch in the evidence file.
How do we know a proof that calls itself "correct" is not just talking to itself? DeepMind used a classic, hard-nosed technique from software testing: mutation testing. The researchers reintroduced two real, previously fixed libsignal bugs into an isolated copy of Signal's code, and asked the system to verify the buggy code. In both cases the system produced a machine-checked proof that the buggy version was insecure. In other words, the specifications are not an empty shell that proves anything put in front of them — they can tell correct code from buggy code. The paper describes two further safeguards: reviewer agents critique specification drafts from a skeptical perspective, and prover agents actively prove that the specification itself is not vacuous — for example, by proving that its premises are jointly satisfiable and met by concrete executions, guarding against the case where contradictory premises make a theorem trivially true. These details matter more than the 6.5-million-line figure: the value of a proof lies not in its length, but in whether it can be falsified.
But honesty requires stating the boundaries just as clearly, and not only the good news. First, the specification itself is written by humans, and it is the one part of the whole result that cannot be machine-checked: if the specification is wrong, the proof is worthless. The paper says this outright — the specification must be "trusted", and the validity of the final result depends on getting the security properties right and complete; no matter how reliable the proof-writing agents are, they cannot fix that gap. Second, the cryptographic primitives themselves are assumed secure: the proofs rest on the premise that the underlying algorithms hold, idealized as black boxes in the symbolic model and tied to the hardness of the underlying problems in the computational model. Third, the scope is limited: one-to-one sessions, the handshake and the ratchet only — no group chats, no whole app, no device or operating system, and no complete post-quantum guarantee (the paper states explicitly that no post-quantum guarantee is established for SPQR's healing property). Fourth, no cost was disclosed: four weeks is a duration, not a bill, and DeepMind has not said how much compute those four weeks consumed. Fifth, AlphaProof Code is not a product you can call: it has no API and no price — it is a research framework plus a set of open-sourced verification artifacts, with the paper and code published openly.
For vibe-coding developers, the significance of this story is not Signal itself, but the direction it points. Over the past two years, AI has learned to write code faster than humans can review it: one person can have agents produce thousands of lines a day, with no matching capacity to check them. Testing catches some of it, code review catches some more, but things slip through. AlphaProof Code demonstrates a third path: AI does not only write code, it can also prove code — replacing sampling with mathematical proof for the small slice of code where safety matters most. That matters most for code where one mistake is catastrophic: payments, encryption, authentication, medical device firmware, power grid software. DeepMind makes the same point at the end of the blog: verifying Signal's core cryptography lays the groundwork for securing other vital systems, from medical device firmware to power grid software, and paired with automated defense agents like CodeMender, formal verification can help counter cyber threats whose speed and scale are unlike anything before.
Do not expect to run AlphaProof Code on your own project tomorrow. Today it is still research: specifications must be written and reviewed by humans, and the framework is not packaged as an out-of-the-box tool. But two things are already delivered. First, all verification artifacts are open-sourced — the paper and the Lean development are public at google-deepmind.github.io/code-verification, downloadable, checkable, and reproducible by anyone, which is far more credible than a blog post with conclusions only. Second, it offers a replicable division of labor: humans decide what to prove, agents do the grueling proof work, and a machine kernel delivers the final verdict. The paper also notes that this work answers a "grand challenge" launched in April 2026, with Signal as only the first stop; following this route, the next things verified could be payment systems, browser engines, or the open-source libraries you use every day.
Why Lean, of all languages? There is more than one language for formal verification, and DeepMind's choice of Lean has two practical reasons. First, Lean's kernel is small: the final verdict on whether a proof is correct comes from a short, battle-tested piece of code, not from the huge model that wrote the proof. The model can err and hallucinate, but once the kernel says "pass", the proof holds mathematically; if the model gets it wrong, the kernel rejects it outright. Second, Lean has an active mathematics community with a large library of existing mathematics, so writing specifications does not start from zero. For developers, the choice itself is a methodology: concentrate "trust" in the smallest auditable core possible, and let the unreliable but powerful generator handle the rest. That idea belongs to more than formal verification — writing tests, doing code review, setting up CI are all, at bottom, searches for the smallest verdict point worth trusting.
How do formal verification, testing, fuzzing, and auditing relate? Not as replacements, but as layers. Testing answers "these scenarios are fine"; fuzzing answers "random inputs did not crash it"; auditing answers "experts looked and found nothing"; formal verification answers "under this specification, every scenario is fine". Their costs rise from low to high, and so does the strength of the guarantee. The historical problem was that the strongest tier was so expensive only aerospace, chips, and operating system kernels could afford it, and most projects never dared consider it. AlphaProof Code changes the cost curve, not the nature of the guarantee: the specification still has to be written correctly by a human, and the scope still has to be drawn in advance — but "writing the proof", the most labor-intensive step, can now be handed to agents. For ordinary projects, the realistic lesson is not "formally verify the whole repository tomorrow", but to pick out the few dozen lines where it matters most — permission checks, money math, encryption calls — and guarantee those with stronger means.
One easily missed detail: of the framework's four components, the most "human" part is precisely the most critical. The specification-writing agent drafts, reviewer agents pick holes, prover agents do the work, and a gatekeeper agent delivers the verdict — but humans decide what to prove, review every draft of the specification, and make the final decisions. The paper spends considerable space on specification quality: reviewers must critique from a skeptical perspective, provers must actively prove the specification is not vacuous, and mutation testing injects bugs into the code to see whether the specification catches them. That workflow carries a direct lesson for vibe-coding developers: in the AI era, human work is shifting from "writing implementations" to "writing specifications and delivering verdicts". When you have an agent write code, you are already doing this — your prompt is an informal specification, and your code review is the verdict. AlphaProof Code simply pushes that division of labor to its strictest form.
Finally, three concrete things anyone can do today. First, read the paper: the paper and the Lean code at google-deepmind.github.io/code-verification are fully public, and even without knowing Lean you can read the abstract and the first chapter — they build an intuition for the difference between "proof" and "testing". Second, try the mutation-testing idea in your own project: no Lean required — deliberately change a boundary condition or delete a validation line in a critical function, and see whether your test suite catches it; if it does not, the tests themselves have a blind spot. Third, bring "specification first" to your next feature: before writing code, state in one sentence what the function must guarantee for which inputs, then have the agent implement it, and verify against that sentence. None of these requires waiting for AlphaProof Code to become a product, but they share one idea: the most reliable way to make code correct is not to write more of it, but to state clearly what "correct" means first.
Why Signal, and why now? Consider the target's value first: the Signal protocol protects the conversations of billions of people, with WhatsApp, Messenger, and Google Messages all running variants of it — breaking it once would affect billions at the same time. Then consider its difficulty: PQXDH is a post-quantum handshake, the Triple Ratchet is a stateful, complex protocol, and together they would take years to prove by hand. DeepMind chose it as the first stop for a clear reason — pick the hardest, most valuable target and show the road can be walked. Then consider the timing: the engine behind the proofs is Gemini Carbon, which became generally available the very same day, and by 2026 agents had matured enough to take on long, rigorous work like "writing proofs"; the paper also notes that the work answers a "grand challenge" launched in April 2026, going from inception to result in just over half a year. For developers, the timing means this: formal verification is moving from "an academic specialty" to "an engineering option", driven not by any single new algorithm, but by agents finally being able to do long work reliably.
One knock-on effect is worth noting: formal verification is becoming a new piece in the AI security contest. The blog closes by pairing AlphaProof Code with automated defense agents like CodeMender, and the message is clear — attackers are already using agents to find vulnerabilities and write exploits at scale, and defenders relying on manual audits alone will lose on speed. In that context, the value of formal verification is not only "proving a piece of code correct", but giving defenders a tool that can keep up with attack speed: for the first time, agents write proofs as fast as agents write attack code. The race has only just begun, of course: the proven scope is still narrow, the cost is undisclosed, and DeepMind has not said whether it will sell formal verification as a service. But the direction is set — future security contests may no longer be about who runs more tests, but about who can produce a mathematical proof for the code that matters most.
If you want to verify this story yourself, three places are directly checkable. First, the DeepMind blog itself is only two pages, with the conclusions stated plainly. Second, the technical paper's abstract and first chapter state "what was proven and what was not" more strictly than the blog, including the distinction between the symbolic and computational models and which assumptions are openly admitted. Third, all the Lean code and specifications are public at google-deepmind.github.io/code-verification, where readers who know Lean can run the kernel check themselves. One more detail worth noting: Signal itself took part in the work — the blog's acknowledgements name Signal's Rolfe Schmidt, Michael Rosenberg, and Ehren Kret, who gave feedback on the methodology. The verified party cooperating rather than objecting afterward is itself a small signal about the result's credibility.
Here is the final judgment. The numbers most worth remembering in this story are not "6.5 million lines", but what "four weeks" and "one percent" imply about a changed division of labor: humans move from "people who write proofs" to "people who define specifications and deliver verdicts"; machines move from "the thing being verified" to "the workers writing the proofs"; and the Lean kernel becomes the impartial judge. Once the cost structure of formal verification is rewritten this way, a security guarantee stops being a luxury only nation-scale projects can afford. For indie developers, the practical lessons are twofold. First, there is always a small part of your code where mistakes are unaffordable — payment callbacks, permission checks, encryption logic — so concentrate your testing and review firepower there instead of spreading it evenly. Second, start watching the "AI proves code" track: today it is still research, but it solves exactly what the vibe-coding era lacks most — a way to be sure that the code one person writes in a day is actually right.
Comments (0)
Sources
Related articles
On 18 November 2026, Google Research and co-authors posted BuggyMLE to arXiv: bugs injected into 222 working ML repositories, and 14 models slide from 95% on the easiest tier to 9% on the hardest. A 9-billion-parameter model trained easy-to-hard beats Claude Opus 5.5 on the 10-bug tier.
On 11 November 2026, AWS open-sourced UAEF: adapters turn traces from LangGraph, LangChain, Strands and Bedrock AgentCore into one format, then 36 metrics across 7 dimensions score them, flagging regressions past 5%. The judge model is hardened too — scores must cite verbatim evidence, and never decide safety.
On 17 November 2026, Microsoft launched MAI Code 2 and Code 2 Flash: the larger model has 77 billion active parameters and a one-million-token context, averaging 63.2% across four benchmarks — close to GPT-6.1 Sol and Claude Opus 5.5 — at $0.309 per task. Read the three caveats first: promotional pricing, the lowest score of the three, and no long-horizon work.