AlphaProof Code

AlphaProof Code

Pushmeet Kohli and Swarat Chaudhuri

Pushmeet Kohli 和 Swarat Chaudhuri

How Google DeepMind researchers built a new agentic framework that formally verified the code of Signal’s cryptographic protocol — long considered to be a grand security challenge

Google DeepMind 的研究人员如何构建了一个新的智能体框架,对 Signal 加密协议的代码进行了形式化验证——这长期以来一直被视为一项重大的安全挑战。

Today, we’re sharing a milestone in software security long considered to be a grand challenge: Google DeepMind researchers guided AI agents to mathematically prove key security properties of the actual code underlying the Signal protocol, the technology that protects billions of private conversations in apps like Signal and Google Messages.

今天,我们分享了软件安全领域一个长期被视为重大挑战的里程碑:Google DeepMind 的研究人员引导 AI 智能体,从数学上证明了 Signal 协议底层实际代码的关键安全属性。该技术保护着 Signal 和 Google Messages 等应用中数十亿次的私人对话。

This breakthrough discovery was made using AlphaProof Code, a novel agentic framework for formal verification at unprecedented depth that combines human expertise with AI agents. Formal verification—mathematically proving code runs correctly without flaws—is the highest standard of security assurance; however, it is difficult and often labor-intensive.

这一突破性发现是使用 AlphaProof Code 实现的。这是一个用于前所未有的深度形式化验证的新型智能体框架,它将人类专业知识与 AI 智能体相结合。形式化验证(即从数学上证明代码运行正确且无缺陷)是安全保障的最高标准;然而,它难度大且通常非常耗费人力。

Our work marks the first time AI has been used to formally verify a widely deployed cryptographic protocol at this depth. It’s also the first time the implementation of a widely deployed protocol like this has been formally verified by any method, with or without AI.

我们的工作标志着 AI 首次被用于对广泛部署的加密协议进行如此深度的形式化验证。这也是此类广泛部署的协议的实现首次通过任何方法(无论是否使用 AI)进行形式化验证。

AlphaProof Code is a multi-LLM agentic framework that splits the work of formal verification the way a research team would: human experts work with AI to decide what to prove, and a group of AI agents does it.

AlphaProof Code 是一个多大语言模型(Multi-LLM)智能体框架,它像研究团队一样分配形式化验证工作:人类专家与 AI 合作决定要证明什么,然后由一组 AI 智能体来执行。

First, our researchers collaborated with a mix of models to translate Signal’s security goals into formal mathematical specifications, with human experts reviewing every one. From there, agents powered by Gemini Carbon did the proofs, generating over six million lines of Lean, a computer language that mathematically proves the accuracy of code.

首先,我们的研究人员与多种模型协作,将 Signal 的安全目标转化为形式化的数学规范,并由人类专家对每一项进行审查。随后,由 Gemini Carbon 驱动的智能体进行了证明,生成了超过 600 万行的 Lean 代码——这是一种从数学上证明代码准确性的计算机语言。

Next, the agents audited the proof and highlighted areas that needed a second look by a human – just one percent of the codebase, a massive time savings. Because Lean automatically checks the rest, our experts could focus their review where human judgment matters most.

接下来,智能体对证明进行了审计,并标注出需要人类二次审查的区域——仅占代码库的 1%,极大地节省了时间。由于 Lean 会自动检查其余部分,我们的专家可以将精力集中在最需要人类判断的地方。

Cryptographic protocols underpin nearly all digital communication, from online banking to web browsing, and a single flaw can expose millions of people at once. That’s why experts have spent decades formally analyzing them.

加密协议支撑着几乎所有的数字通信,从网上银行到网页浏览,任何一个缺陷都可能同时让数百万人面临风险。这就是为什么专家们花费了数十年时间对其进行形式化分析。

But most protocol verification stops at the design level. Our agents went further, proving that the compiled code fulfills the key security properties – such as keeping messages protected before and after a device is temporarily compromised – down to the exact code running on devices. Because real-world vulnerabilities often hide in the gap between design and implementation, bridging this gap makes these proofs vastly more complex.

但大多数协议验证仅停留在设计层面。我们的智能体更进一步,证明了编译后的代码满足关键的安全属性——例如在设备被临时入侵前后保持消息受保护——一直深入到设备上运行的确切代码。由于现实世界的漏洞往往隐藏在设计与实现之间的差距中,弥合这一差距使得这些证明变得极其复杂。

Even at this complexity, our verification process took just four weeks – a task that historically takes expert teams years – proving that Signal’s core cryptographic code delivers the security protections our experts specified.

即使在如此复杂的程度下,我们的验证过程也仅用了四周时间——这在过去通常需要专家团队花费数年时间——证明了 Signal 的核心加密代码提供了我们专家所指定的安全保护。

To confirm that AlphaProof Code can tell correct code from buggy code, we reintroduced two real, previously fixed bugs into an isolated version of Signal’s code. In both cases, the system produced a machine-checked proof that the buggy version was insecure.

为了确认 AlphaProof Code 能够区分正确代码和有缺陷的代码,我们将两个之前已修复的真实漏洞重新引入到 Signal 代码的隔离版本中。在这两种情况下,系统都生成了机器检查证明,证实了有缺陷的版本是不安全的。

In AlphaProof Code, AI agents help users write a specification, then autonomously prove that the implementation meets it. Every proof is checked by Lean to verify the agents’ work.

在 AlphaProof Code 中,AI 智能体帮助用户编写规范,然后自主证明实现符合该规范。每一项证明都由 Lean 进行检查,以验证智能体的工作。

While prior formal verification focused on smaller portions of the code, Google DeepMind’s approach enables significant expansion,” said Ehren Kret, Chief Technology Officer of Signal. “Using AI agents to translate live code into valid Lean theorems is a major breakthrough. As AI-driven security threats grow, rigorously verifying the Signal protocol implementation gives us even greater confidence in our code’s privacy guarantees.

“虽然之前的形式化验证侧重于代码的较小部分,但 Google DeepMind 的方法实现了显著的扩展,”Signal 首席技术官 Ehren Kret 表示。“使用 AI 智能体将实时代码转换为有效的 Lean 定理是一个重大突破。随着 AI 驱动的安全威胁不断增加,对 Signal 协议实现进行严格验证,使我们对代码的隐私保证有了更大的信心。”

While prior formal verification work has necessarily focused on smaller scopes, this new approach enables a significant expansion. Traditionally, verifying that production code strictly matches its cryptographic design required extensive manual effort, making the use of AI agents to automatically translate live code into valid Lean theorems a great breakthrough. As AI-driven security threats grow, having the core Signal protocol rigorously verified with automated theorem proving gives us even greater confidence that our code delivers on its privacy guarantees.

虽然之前的形式化验证工作不得不局限于较小的范围,但这种新方法实现了显著的扩展。传统上,验证生产代码是否严格符合其加密设计需要大量的人工投入,因此使用 AI 智能体自动将实时代码转换为有效的 Lean 定理是一个巨大的突破。随着 AI 驱动的安全威胁不断增加,通过自动定理证明对核心 Signal 协议进行严格验证,使我们更加确信我们的代码能够实现其隐私保证。

Achieving this long-standing challenge demonstrates how AI can bring elite security assurance to businesses, governments, and critical infrastructure, helping defend against agent-driven cyber threats.

实现这一长期挑战证明了 AI 如何为企业、政府和关键基础设施带来顶级的安全保障,从而帮助抵御由智能体驱动的网络威胁。

Verifying Signal’s core cryptography lays the groundwork to secure other vital systems, from medical device firmware to power grid software.

验证 Signal 的核心加密技术为保护其他重要系统奠定了基础,从医疗设备固件到电网软件。

Scaling these techniques requires continued research. Paired with automated defense agents like CodeMender, formal verification can help counter the speed and scale of modern cyber threats to create software with mathematical proof that its protections work.

扩展这些技术需要持续的研究。结合像 CodeMender 这样的自动化防御智能体,形式化验证可以帮助对抗现代网络威胁的速度和规模,从而创建出具有数学证明其保护机制有效的软件。

We are open-sourcing our formal verification artifacts for community use. Read the technical paper below.

我们正在开源我们的形式化验证工件供社区使用。请阅读下方的技术论文。

This research was developed by Swarat Chaudhuri, Andrew Ferraiuolo, Anton Kovsharov, Tej Chajed, Sam Schlesinger, Karn Seth, Jonathan Katz, Charles Sutton, and Pushmeet Kohli.

这项研究由 Swarat Chaudhuri、Andrew Ferraiuolo、Anton Kovsharov、Tej Chajed、Sam Schlesinger、Karn Seth、Jonathan Katz、Charles Sutton 和 Pushmeet Kohli 开发。

We thank Eric Wieser for help with open-sourcing our code, Owen Jones for program management support, and Martín Abadi, Christopher Henson, Katerina Hristova, Henryk Michalewski, Jonathan Protzenko and George Tsoukalas for helpful discussions. We thank Signal’s Rolfe Schmidt, Michael Rosenberg, and Ehren Kret for their feedback on our methodology. We also thank Tulsee Doshi, Four Flynn, Kate Olszewska, Alicia Huang, Andy Liu, Benoit Schillings, Raluca Ada Popa, Melvin Johnson, Koray Kavukcuoglu, Demis Hassabis, and Sundar Pichai for their support of the project.

我们感谢 Eric Wieser 在代码开源方面提供的帮助,感谢 Owen Jones 提供的项目管理支持,并感谢 Martín Abadi、Christopher Henson、Katerina Hristova、Henryk Michalewski、Jonathan Protzenko 和 George Tsoukalas 提供的有益讨论。我们感谢 Signal 的 Rolfe Schmidt、Michael Rosenberg 和 Ehren Kret 对我们的方法论提出的反馈。我们还要感谢 Tulsee Doshi、Four Flynn、Kate Olszewska、Alicia Huang、Andy Liu、Benoit Schillings、Raluca Ada Popa、Melvin Johnson、Koray Kavukcuoglu、Demis Hassabis 和 Sundar Pichai 对该项目的支持。