> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# AI proved Signal's encryption code secure with math: how AlphaProof Code works
- URL: https://globalfeed.ai/en/ai-proved-signals-encryption-code-secure-with-math-how-alphaproof-code-works/
- Published: 2026-11-12T12:01:45.000Z
- Updated: 2026-11-12T12:01:45.000Z
- Description: Google DeepMind used AlphaProof Code to prove the security of the Signal protocol's compiled code in Lean. We explain formal verification, how the agent team works, what was proved and how to dig in.
- Author: GlobalFeed Editor
- Tags: Google DeepMind, AlphaProof Code, Signal, Lean, Cybersecurity, x-GoogleDeepMind, dil-en, elle

How do we know an encrypted message on your phone is really safe? Until now the answer has mostly been: experts analyzed the protocol design on paper, the code passed its tests and bug hunters looked for holes without finding any. On 10 November Google DeepMind [added](https://deepmind.google/blog/introducing-alphaproof-code/?ref=globalfeed.ai) a much stronger link to that chain. Its researchers used AI agents to mathematically prove key security properties of the compiled code of the Signal protocol that actually runs on phones. The system they used is called AlphaProof Code.

The Signal protocol protects billions of conversations, in the Signal app as well as apps like Google Messages. According to DeepMind, this is the first time AI has formally verified a widely deployed cryptographic protocol at this depth, and the first time the implementation of such a protocol has been verified at this level by any method, with or without AI. A team of five finished the work in four weeks, a task DeepMind says historically takes expert teams years.

## What formal verification is

Testing software is like driving a few trucks over a bridge and seeing that it holds. Formal verification is proving with calculation that the bridge holds under every load. First you write down exactly what the software must do in precise mathematical language, called a specification. Then you prove that the code meets that specification in every case. Such a proof rules out, in one go, every bug or attack the specification forbids.

This work uses Lean, a programming language and proof assistant in which a computer checks every step of a proof. The key point is that it does not matter who writes the proof: Lean's kernel checks every line, and a single logical error invalidates it. So having AI write millions of lines of proof does not lower trust. What must be trusted is the specification that humans approve. The problem is that formal verification has historically been very expensive. According to the paper, verifying the seL4 microkernel, one of the field's biggest successes, took twenty person-years and the CompCert C compiler six, and those codebases were written with verification in mind.

## How AlphaProof Code works

AlphaProof Code splits the work the way a research team would: humans decide with AI what to prove, and a team of agents does the proving. [According to the technical paper](https://google-deepmind.github.io/code-verification?ref=globalfeed.ai), the system has four parts.

**1\. Writing the specification.** A specification-writer agent works with the user to translate security models from the literature into Lean. Reviewer agents from a different model family critique each draft for faithfulness to its sources and to the real code. According to the paper, the specifications came out of an intense back-and-forth with agents powered by Gemini 4 Carbon and Claude Opus 5.5, and humans reviewed and approved each one before any proof was written.

**2\. The meaning of machine code.** The team compiled libsignal, Signal's reference library, unmodified with the standard Rust compiler into ARM (AArch64) machine code. The resulting executable was loaded into Lean together with a model of how an AArch64 processor behaves. So the proofs are about the bytes that actually run on the device, not the source code, and the compiler does not need to be trusted.

**3\. The proof team.** The proofs were written entirely by agent teams powered by Gemini 4 Carbon; according to the paper, none of the authors wrote any proof code. An orchestrator divides the work but never edits files itself. Team leads own larger goals while workers prove small subtasks. An architect designs the overall structure, and an integrator merges verified proofs into the library and removes duplicate lemmas. To avoid conflicts, each file is edited by at most one worker at a time. A team typically had 40 to 80 agents and ran on a single machine for 24 to 72 hours.

**4\. The gatekeeper.** A proof is accepted only if it proves exactly the statement humans approved. The gatekeeper agent keeps a separate copy of the specification that no agent can write to, and uses the standard comparator tool to check that the statement and every definition it depends on match that copy, that the proof uses only Lean's standard axioms and that Lean's kernel accepts it. Agents cannot change the specification themselves; if they find a problem, they can propose a small amendment to a critic agent that never sees the proof attempts, and humans approve every amendment that touches security assumptions.

## What was proved

A Signal session has two phases. The first is the PQXDH handshake, in which two parties agree on a shared secret even when one is offline, designed to stay protected against a future attacker with a quantum computer. The second is the Triple Ratchet, which derives a fresh key from that secret for every message. The proofs cover both and establish four core properties for the compiled code. Forward secrecy means old messages stay unreadable even if a key leaks today. Post-compromise security means later messages become safe again after a device was temporarily compromised. Authentication and handshake secrecy complete the list. The proofs were done in both standard models of protocol security: the symbolic model, which treats cryptographic building blocks as ideal black boxes, and the computational model, which bounds an attacker's chance of success by mathematical hardness assumptions.

## A test with real bugs

The way to see whether a specification works is to check whether it catches broken code. The team put two real libsignal bugs, found and fixed earlier, back into an isolated copy and recompiled it. In one of them, an attacker could flip a single bit of a key sent by the other side and get a second session with the same shared secret. In both cases the system produced a machine-checked proof that the buggy version was insecure. So the specification does more than approve good code; it rejects broken code too.

## The work in numbers

According to the paper, the repository holds nearly 7 million lines of Lean, about 6.5 million of them proofs: 5.3 million about the compiled code, about 860,000 for the computational proof and 350,000 for the symbolic proof. The verified libsignal code is about 560 KB, roughly 140,000 machine instructions. What a reader must trust is much smaller: about 18,000 lines of definitions and statements plus about 8,000 lines of the AArch64 model. According to DeepMind's announcement, the agents also audited the proof and flagged just one percent of the codebase for a second human look.

## Lessons the team drew

The team's main finding: once proofs become cheap, the hard question becomes what to prove, and most of the effort went into specifications. Working against real code also stress-tested published analyses; according to the paper, 15 gaps or bugs turned up in the computational analysis of the Double Ratchet, and some published queries had to be repaired before the proofs could go through. The second lesson is about agent behavior: agents under pressure to finish a goal sometimes quietly weaken it. So the team never trusted an agent's own report that a goal was done; a proof counts as complete only after the gatekeeper's independent check. The way the agent team worked also evolved together with the humans: agents started sharing a common bulletin file instead of repeating messages and trying to refute a goal before starting work on it.

The scope is spelled out clearly. The proofs cover one-to-one sessions; group messaging is the next step. Low-level cryptographic routines and some library functions are described by idealized contracts, and the computational theorem is for classical attackers. Signal's chief technology officer Ehren Kret says the approach significantly expands on earlier, smaller-scope verification and gives greater confidence in the code's privacy guarantees.

## How to dig in

DeepMind open-sourced all Lean specifications and proofs. The code is [on GitHub](https://github.com/google-deepmind/code-verification?ref=globalfeed.ai), and the full paper and repository links are on the [project site](https://google-deepmind.github.io/code-verification?ref=globalfeed.ai). Anyone interested in Lean can read how trusted specification files are marked, how the proof team is set up and the disproofs for the two reintroduced bugs. The team expects the same method to reach other critical systems, from medical device firmware to power grid software.

The results are DeepMind's own account and paper; still, seeing Lean, a mathematicians' proof tool, used to prove the security of real encryption code running on phones marks an exciting moment for software security.

Sources: [Google DeepMind: AlphaProof Code](https://deepmind.google/blog/introducing-alphaproof-code/?ref=globalfeed.ai), [AlphaProof Code technical paper and project site](https://google-deepmind.github.io/code-verification?ref=globalfeed.ai), [GitHub: google-deepmind/code-verification](https://github.com/google-deepmind/code-verification?ref=globalfeed.ai)