Formally verifying critical software is notoriously difficult and labor-intensive, often requiring years of expert effort for even a modest codebase. This human bottleneck – compounded by a fragmented toolchain – makes it nearly impossible to scale verification across critical infrastructure, which relies on millions of lines of legacy C code. Consequently, the software underpinning our most vital systems remains largely unverified and vulnerable.
Recent breakthroughs in AI auto-formalization signal a paradigm shift: leveraging AI can fundamentally alter the cost-benefit calculus of software verification, compressing timelines from person-years to person-days. We just need to prove that it works at scale.
HighVoltage is a joint initiative by Galois and Math, Inc., conceived and funded by RAND’s Center for AI, Security and Technology (CAST), to demonstrate that AI-assisted formal verification can tackle real-world critical infrastructure at commercial speed. The project attempts to verify the ~1,200 lines of code in the deployed Linux kernel WireGuard handshake within a compressed timeline that would be infeasible with traditional, manual formal verification processes.
Recently, Galois wrapped up our part of the Wireguard Project, demonstrating very promising results. Using AI-assisted tools, the team not only successfully automated the verification of the WireGuard handshake protocol, they were able to use AI to generate a significant portion of its underlying specifications. While this same project would have taken between 1-3 years using traditional manual methods, the AI-driven workflow accelerated the process to just three months. As AI tools and user methods continue to improve, this project offers a scalable blueprint for future automated verification efforts.
We interviewed Galois Principal Scientist Santiago Cuéllar to learn more:
Andrew Shaughnessy: Tell me about Wireguard. What’s the story here? What exactly is it that you were verifying?Santiago Cuéllar: In this project we were using Claude to assist with specifying and verifying the WireGuard handshake protocol, which ships with Linux. You're probably using it right now. We focused specifically on the handshake – the part of the protocol that establishes a secure connection. Essentially, if you and I want to communicate securely, we need to make sure that we are who we say we are and establish a shared set of cryptographic keys without revealing those keys to anyone listening in. That’s what the handshake is designed to do. AS: And what were you trying to accomplish with this project?SC: The work here is twofold: At a high level, we started doing this to demonstrate that AI-assisted formal methods are possible. Roughly speaking, a verification of this sort without AI would have taken a year or probably more. We did it in a couple months, which mostly involved setup. We did a lot of manual work, writing around 60% of the specifications by hand. But once that was done we just told the AI “okay, finish the job” – which included finishing all the specs and writing all the proofs – and that took it about 20 hours.AS: Okay, wow!SC: Yeah! The speed is incredibly fast and it's unclear to us if having written 60% of the specs was a really good signal that helped the AI to be so fast. The open question is: “What would it take to do the same thing without the original handwritten specs?” And we believe that the answer is: “this whole process can be automated.”AS:Okay, so the question now is like: “We wrote 60% of the specifications and the AI was able to automatically handle the rest of the job, but what if we only did 40% or 20%?
SC: Or zero! We could have done just the very very high level work – maybe like 5%. The hardest part is writing the spec at the very high level, but we also wrote intermediate specs that I think really help the AI get proofs chained. One important thing to note here is that the high-level specification of the protocol already existed. A team in the UK wrote a spec of the protocol in a domain-specific language (DSL) called Tamarin. Basically it is intended for this specific kind of protocol where multiple people are collaborating and sending things with different cryptographic properties. They show that, given a very high level model, we have certain guarantees and then the protocol is safe – meaning nobody can steal our keys or read our messages. … So we’re standing on the shoulders of giants. There was a lot of work already done, except nobody had actually connected to the C code that runs in Linux.AS: I see. So, a specification already existed, but we were going: “why don't we translate this into C and then verify that?”SC: Yes, Exactly.AS: What are the implications of this? Does this tell us anything useful about the ability to auto-verify things with AI that don't already have specifications written? For example, if there's a legacy system where you say: “I would love to generate a specification and then verify that this is correct.” Can you do that?SC: You're asking exactly the right question. We picked this because we knew that there was a spec that was generated by experts that was well understood and studied by different teams, so I think that highlights that the verification part is very automatable. The high leverage piece is creating the specification. That remains the hard part.AS: I see. Well then what is the next step for that specification problem? If the hard problem now is: “Great, we know we can automate verification. Now we’ve got to figure out, “How far back can we go to automate specification?” What's next for that? And what do you do if you have a legacy system for which there is not a reference specification?SC: Most systems don’t have good specifications. The fundamental challenge is that specifications come at multiple complex layers: not only high-level behavioral goals, but also source code semantics, compiler transformations, how your code runs on your particular machine, and much more – and every tool or approach involves trade-offs. So it’s really hard to actually say what systems do. Because this problem is so hard at the high level, Theorem, Anthropic, and Google have been thinking: “well why don’t we just do it at the machine level?” So first they compile the program into something that's very low level and then they just burn tokens like mad and reason at that level. But the big downside of that is that the specs get more complicated because you have to build all the lost abstraction into the specification. I'm just restating the problem in more detail, but your question was: “Where do we go from here?” And the honest answer is: “I don't know.” Our old Galois colleague Mike Dodds recently gave a talk called “Specifications Seem Pretty Hard,” and that is true. It's what we should get together and start working on. It seems like AI helps. In the results that Google DeepMind just published, the specification was created with a human-AI loop: the AI will propose things, the human will criticize it, and then you will do some testing and kind of go around a bit. For AI-driven specification to be successful, it seems to require at least one domain expert. So, all that to say: I think this is the current frontier of verification: “How do we accelerate and de-bottleneck the creation of specifications?”AS: Got it. That translation from human intent to specification at so many layers seems very difficult. What are the implications if you – or if we, the community – does solve the specification problem?SC: AI is coming for us and we need to safeguard our systems. AI is really good at finding vulnerabilities in everything and formal verification is part of the solution. Formal methods can ensure that the broad categories of vulnerabilities are completely gone from our critical systems: I'm talking cars, defense, healthcare, infrastructure. That includes AI infrastructure – the models themselves and the guardrails that keep them in check. AI is now critical to national defense, but AI systems are the hardest ones to verify, because we still don't understand very well how AI does what it does. AS: Why WireGuard Handshake? Does verifying this particular system demonstrate a generalizable solution?SC: Yes, that's an excellent question. WireGuard has a couple of properties that we're looking for: First, it's critical. It's a piece of the security of the Linux kernel, shipped with Linux, used by everyone. Kubernetes uses it; most VPNs use it; everyone in Linux uses it; critical systems use it. It's everywhere, so it’s very high leverage. Second, we had the specification already. So It was like a very juicy low-hanging fruit in terms of having the spec, and we believed that the tooling was good around it. So this project gives us a recipe for automating formal verification of critical infrastructure. If you want to start safeguarding critical infrastructure, find things for which you have current tooling that you can use and that have specs you believe that you can produce in a relatively quick manner. While we’re figuring out how to create better tooling and specifications to tackle the things that don't satisfy those parameters, we should just go and verify all that low-hanging fruit.