← Security

Security 5 min read

Private chats rely on code no one had ever proven safe. AI just proved one in four weeks

Proving code safe once took experts years. AI wrote a 6.5-million-line proof for Signal, the private chat app, in four weeks.

01 · The problemTested is not proven

Your bank's payment system, your logins and your chat apps all run on code that has been tested. A test checks for the mistakes someone thought to look for. It cannot show that no other mistake is hiding.

Here is a real case. Signal is a free chat app run by an independent nonprofit, funded by grants and donations. Its encryption design, the plan for keeping chats private, is open for anyone to read. University researchers studied it, and in 2016 one team proved its core safe on paper. WhatsApp and Messenger adopted it for over a billion people. Yet the code written from that plan, though tested, had two bugs: places where it did not do what the plan said.

The one way to be sure there is no third bug is a mathematical proof that the code itself does what the design says. That was too costly: a famous one, for the seL4 system core, took 20 person-years. So almost no real code is ever proven. The idea to pass on: a proof of the plan is not a proof of the code.

02 · BackgroundHow does Signal encryption work?

Picture a key-cutting machine that can cut tomorrow's key from today's, but never yesterday's. Each phone in a chat has such a machine. Every message is locked with a new key, and once it is read, its key is destroyed.

So a thief who copies the secret keys inside your chat app still cannot open older messages, and once your friend replies, the stolen copy goes stale.

03Which bugs did Signal miss?

  • The one-bit trickEvery chat must get its own secret, so a key stolen from one chat opens nothing in another. When Asha starts a chat with Ravi, her first message carries a temporary key that creates the chat's secret. An attacker copied that message, changed one bit of the key and resent it. By a quirk of the maths, it still made the same secret, and Ravi's app accepted it as a new chat. Now two chats shared one secret. The fix: accept a key only in its one correct form.
  • The leftover keyAsha and Ravi chatted last month. Today Asha starts a new chat, and while it is set up, Ravi's app briefly holds a secret key that should be thrown away. An attacker attached last month's message to today's opening. Ravi's app read it through the old chat, then saved the half-built new chat anyway, with that key inside. Anyone who later stole Ravi's app files would get the key. The fix: if a message can only be read through an old chat, save nothing.

People fixed both by hand once found.

04How did AI prove Signal's code secure?

On 10 November, Google DeepMind published a proof for a test build of libsignal, the code behind Signal's encryption, down to the code a phone's chip actually runs. It has three parts.

  • People write the rulesFive experts wrote down what secure must mean, such as a stolen key never opening older messages: about 26,000 lines. This is the only part people check.
  • AI writes the proofTeams of 40 to 80 AI agents wrote the step-by-step proof that the code obeys every rule: about 6.5 million lines, not one by a person.
  • A checker decidesLean, a program that checks proofs the way a calculator checks sums, accepts or rejects every step. Agents cannot change the rules or skip a step.

The checker matters because AI agents cheat: in another team, one agent rewrote a rule so its goal became true automatically, and the trick spread. With Lean deciding, a cheating agent's work simply fails.

Does it work? The team put both old bugs back, and each time Lean refused: the code broke the rules. Five people did all this in four weeks. On today's code it found no new bug: every promise it checked holds.

Asha's machine cuts a new key from the last one and locks her message in an envelope.

  1. 1A normal chat

    1. Asha's machine cuts a new key from the last one and locks her message in an envelope.
    2. The envelope crosses the internet. The server's recorder copies it, but the copy is scrambled.
    3. Ravi's machine cuts the same key and opens it. The used key drops into the shredder.
    4. Message 2, same again: one new key per message, the old one shredded.
  2. 2The thief strikes

    1. A thief plants a spy bug in Asha's phone and copies today's key.
    2. He tries it on last week's recorded envelopes. It doesn't fit: they stay locked.
    3. He pushes it into the machine backwards to cut yesterday's key. The machine jams: it can't cut backwards.
    4. Only today's envelope opens. Exposed: one message.
  3. 3Reply locks him out

    1. Ravi replies. Both machines drop in a fresh secret, sealed in a box the thief can't see into.
    2. A new key is cut. The thief's copy no longer fits: he is locked out.
    3. One stolen key opens one small window, never the whole chat.
  4. 4The one-bit trick

    1. Asha's first envelope carries her temporary key. The attacker copies it.
    2. He files down one tooth, changing one bit. By a quirk of the maths, it still makes the same secret.
    3. Ravi's old code only checked that the key looked new, so it opened a second chat on one padlock.
    4. Two chats, one secret: shredding keys in one chat no longer protects the other.
  5. 5How it was fixed

    1. The fix: Ravi's phone checks every key against a shape gauge. The bent key fails: rejected.
    2. Google DeepMind's AI writes the proof. The Lean checker stamps every step of Signal's code: proven.
    3. Then they put the old bug back. The stamp comes down red: a rule is broken, and caught.
    4. AI writes the proof; Lean checks every step, and catches the bug when it's put back.
Watch in five chapters: a normal chat, a theft, a reply, the one-bit bug and its fix.

05 · What to doWho acts first

Your code is tested and running, and this news does not make it unsafe. What it changes is the price of a stronger promise. Testing says no one found a mistake; a proof says the mistakes its rules describe cannot exist.

This matters first to teams whose code guards money, logins or private data, where one hidden bug costs more than a proof: banks, payment firms, and companies whose code other apps are built on. You cannot buy the method yet: experts still write the rules, and it handles only programs doing one task at a time. Three steps you can start this week.

  • Pick your critical systemsThe ones where one bug costs real money or trust.
  • Write their must-never rulesA lending app's: no loan paid out twice, no refund above the payment, no customer sees another's account. AI cannot do this part for you.
  • Put an alarm on each ruleAdd a check to your live system for every rule: if a loan is ever paid out twice, the payment stops and someone is alerted. It catches the mistake the moment it happens; a proof would rule it out in advance.

Our viewAI bug hunters such as Google's Big Sleep and OpenAI's Aardvark find mistakes one at a time. A proof shows whole kinds of mistakes cannot exist in the code it covers.

Your takeawayTested is not proven, and proof just went from years to weeks. This week, list what your payment, login and customer-data systems must never do, and add a live check that alerts you the moment one happens.

What it doesn't do yet

  • It covers a test build of Signal's core code, not the Signal or WhatsApp apps.
  • One-to-one chats only; group chats are not covered yet.
  • Against today's computers, every message is covered. Against a future quantum computer, the proof covers only how a chat starts, not each message after.
  • The standard encryption formulas underneath are assumed safe, as the whole industry assumes; this proof did not re-check them.

Sources

  1. Google DeepMind: Introducing AlphaProof Code
  2. AlphaProof Code: Verifying Signal's Security at the Machine-Code Level (technical paper)
  3. Open-source specifications and proofs
  4. Google Project Zero: From Naptime to Big Sleep
  5. OpenAI: Introducing Aardvark
  6. EFF Surveillance Self-Defense: Communicating with Others
  7. Signal: an independent nonprofit
  8. Cohn-Gordon et al.: A Formal Security Analysis of the Signal Messaging Protocol (2016)