Interviews

Formal Verification for AI Safety: Stanford Professor Clark Barrett on Proving AI Code Is Safe

Formal Verification for AI Safety: Stanford Professor Clark Barrett on Proving AI Code Is Safe

Clark Barrett is the Corbel Professor (Research) at Stanford University, where he directs the Stanford Center for Automated Reasoning and co-directs the Stanford Center for AI Safety.

Speaker:

Prof. Clark Barrett

Prof. Clark Barrett

|

Stanford Professor, Co-Founder & Co-CEO & Truth

Clark Barrett is the Corbel Professor (Research) at Stanford University, where he directs the Stanford Center for Automated Reasoning and co-directs the Stanford Center for AI Safety. He is also co-founder and co-CEO of &Truth, which recently came out of stealth. He has spent decades in formal verification and is a co-creator of the SMT solvers SVC, CVC3, CVC4 and cvc5. cvc5 now runs in production at Amazon, where it helps check cloud access policies. He also helped launch CSLib, an open-source library that formalizes computer science in Lean. At &Truth, with co-founders Chris Hsu and Ilya Sergey, he's building a universal verification machine that can prove code in any language is safe, reliable, secure and correct. In this conversation we cover what formal verification is, why AI-generated code makes it urgent, and how &Truth plans to make proofs cheap enough to run on every line of code.


Takeaways:

1. Testing samples, formal verification proves. Programs can be treated as mathematical objects, so you can get guarantees instead of just confidence from tests that passed.

2. Testing is still essential. Unit tests, fuzzing and integration tests catch 90-99% of bugs. Formal verification is for the long tail that testing rarely finds.

3. AI creates two new threats. Powerful coding models make legacy code more vulnerable by finding bugs in decades-old open source, while the flood of new AI-generated code outpaces human review.

4. You can't brute-force the input space. Two 64-bit integers already mean 2^128 possible inputs. Formal methods reason symbolically, like solving equations in algebra, so you cover every case without enumerating them.

5. The bottleneck shifts to specifications. Programming is moving toward saying precisely what you want and proving the agent did it. Agents are surprisingly good at drafting specs, but they still fall down on implementation, and that gap is where formal verification helps.

6. AI makes verification affordable. A 30,000-line Rust library that took a human team 15 person-months to verify was done in about 10.5 hours by an AI harness plus a formal tool, with no human intervention.

7. Classical solvers still beat brute-force LLMs. SMT solvers can prove in seconds what an LLM might need millions of tokens for. To verify millions of lines of code, the target is well under a cent per line.

8. Trust comes from checkable certificates. CVC5 can produce independently verifiable proof certificates, and tools like Lean SMT let theorem provers replay them without trusting the solver.

9. Build a safety box around LLMs. Proving an LLM itself is safe is unrealistic. Instead, check what it produces (like translation validation for compilers) and verify agent actions before they happen, not after.

10. Securing the world's open source code. &Truth is verifying open source C code for memory safety and undefined behavior, has already found significant bugs, and is working with maintainers on responsible disclosure and fixes that come with proofs.


References


Transcript

Formal verification 

Jing Conan Wang: 

Hi Professor Clark. really it's really great honors to have you in FounderCoHo. 

Clark Barrett (05:26)

Thank you. Yeah, it's very exciting.

Jing Conan Wang (05:29)

I would be very excited to learn about your new company, and your new project and you have done a lot of great work about in the AI in particular the formal verifications. This is a concept that many of our audience don't know. Like if you describe this to a person who's not familiar with the field, How would they describe this?

Clark Barrett (06:01)

Yeah, great question. Formal verification is a technique that's really about trying to prove something about real code. And that sounds a little funny, but you can imagine, say, suppose I write a program and I want to know if the program has a bug in it. Can it crash or can it reach a certain line of code that it's not supposed to reach? So mostly the way we solve that kind of problem is we run a lot of tests and we say, okay, we're pretty sure that's going to work. But actually, programs can be viewed as mathematical objects. And so because of that, there is a way to reason about them mathematically and even to prove things about them. And so the difference between sort of testing and formal verification is you can get rock solid guarantees that there are no bugs or no vulnerabilities.

if you can reason about your code in this mathematical way. So that's what formal verification is all about is

finding ways to turn programs, computer systems into math.

Clark Barrett (07:03)

And then proving things about that math.

2. AI Coding and the New Security Threats

Jing Conan Wang (07:06)

That's a very interesting idea. I think for a lot of audiences, they know what math is, computing of numbers, they know what a program is, is what is driving all these applications. But like you mentioned, there are actually like a deep connection between the two. the technologies or like the methods we use like to prove the math can actually be used to ensure that there's no bug in the code. and related to the coding, because like a lot of people

are so passionate about AI coding nowadays, like in the past two to three years, I think the whole world of writing code has been completely changed because of all the AI coding development breakthrough.

Clark Barrett (07:49)

Yeah, that's really true. I mean, even just in the last six months, I would say things are changing dramatically. Yeah. If it you know When I first saw some of these demos of AI coding  models early this year, you know, I stopped everything. I went to all of my students and I said, You all have to buy the latest AI model today and start using it. This is changing everything. so yeah, and you know, AI is of course changing and disrupting many aspects of work, but I think The way it's changing coding is the most dramatic change. It really can change things by hundreds or thousands of times in terms of speed up or productivity gains.

Jing Conan Wang (08:34)

Exactly, yeah. Many of us have already experienced on that. And many of the people who are in the software industry space they realize the amount of code that has been generated has been 10X, maybe 100 X in the past one or two years. And it's almost impossible for humans to review all those code. and obviously more bugs, we heard a lot of incident about PHP and other kind of vulnerabilities kind of reports about that.

What is your view about the bugs of AI coding? Is AI coding currently

Clark Barrett (09:10)

So I think The rise of these extremely powerful coding models with With cybersecurity capabilities has really created two new threats. So the one is you know. our legacy code used to be sort of good enough if we tested it, but because these models are so good at finding vulnerabilities, now legacy code is much more vulnerable. You know, open source projects that had been out in the open for decades are we're now discovering new bugs in the in that code. So this this is scary from sort of a cybersecurity point of view. And on the other side,

we are generating all this new code with AI, like you mentioned. And so there is a fear, I think, that we're just going to be buried by mountains of buggy code because nobody can review it fast enough and everybody is trying to get the code out as fast as possible. So there's all of legacy code and there's all of the new AI-generated code.

Both of them are vulnerable because of this new AI capability.

3. How Formal Verification Works and Why It Goes Beyond Testing

Jing Conan Wang (10:13)

And I think the problem already exists. I think the AI could just amplify that problem. Yeah. And for us who are less familiar with the formal verification, how this can help finding bugs in the code, can you walk us through one example? How exactly this works?

Clark Barrett (10:33)

Actually let me back up and sort of answer the question again of what is formal verification. There's another way to look at it. If you want to apply formal verification, there's sort of three steps. So the first step is you take the object that you want to reason about.

You have to create a mathematical .

Model of that object. So if it's something like a power plant or an airplane, this is a very tricky and complicated process. But for code, it's simpler

Clark Barrett (11:03)

because code actually has clear mathematical people in programming

languages have developed the theory for how to turn code. We that part

into math. So that part is not so bad for code, although some languages are easier than others.

Step two is then you have to figure out what is it that you want

Clark Barrett (11:24)

this mathematical object to do or what is the property you want it to have. And this is a very important point this is called having a specification

Clark Barrett (11:32)

and so I'll come back to that in a second. The third part

is you actually do a proof. So you write down a theorem that says this mathematical object has this property, and then you prove that using and you know techniques based on proof, deduction logic, you know, all of the tools and machinery of mathematics. So that's the process you have to go through. And so really when you say well, how do you do this for real code, I think the question

Clark Barrett (12:01)

is, well, what is that specification? What is it that you want that code to do?

There's a very simple specification and sort of a very nice one that's kind of universal. And that's you dont want your program to access memory that's not it's not supposed to. You don't want wanted to have undefined Behavior.

Clark Barrett (12:21)

These are the kinds of things that lead your program to crash. So we could just say, I don't want my program to crash. And you ask the question, is there any input I could give to my program that would make it crash. And so what you can do with formal verification is you can take that specification, you can turn your code into a mathematical object, and you can prove a theorem that says this code will never crash. And if you Prove that theorem, then you know that your code is safe from that particular problem.

Clark Barrett (12:49)

And if you can't prove it,  the theorem. What's interesting is often that will actually lead you to an exact way to make the program crash. So not only is it a way to make things more secure and give you confidence, it can also be a way to quickly find what the problems are so that you can fix them.

Jing Conan Wang (13:06)

And I know that a lot of us we have been doing a lot of testing, the unit tests, like write code, verify code. I wanna like from the formal verification, how would like if we use that, how would that impact the way we write testing, how the system that or in general the system they ensuring that the other codes code system doesn't have bug.

Clark Barrett (13:34)

So Techniques like testing, fuzzing, unit tests, integration tests, these are still essential.

Clark Barrett (13:40)

You will find 90, 95, 90, 99% of the bugs with these techniques. The reason that formal is valuable is because it helps you get through that long tail of bugs that are very hard to find with testing.

Clark Barrett (13:54)

To Kind of Understand why it's so difficult.

If we take a simple program and it just takes maybe two integers, on today's architecture, an integer is sixty-four bits. Two integers

Clark Barrett (14:07)

is 128 bits. That means there's two to the 128 possible inputs. There's no way you can brute force try all of those inputs. Now you might think, well, if I try a sample them. It's okay, but it could be that there's exactly one.

of those two to the 128 possibilities that crashes your program. You're never going to find it by random testing. And so what formal verification gives you is a way to cover all possibilities without having to enumerate them explicitly. And if you wonder, well, how could you possibly do that? just think about high school mathematics. suppose I give you

Clark Barrett (14:37)

You know. Two equations and two unknowns, right? You could start plugging in

Clark Barrett (14:47)

all the values for x and y to see what works, but there's an infinite number of things to try. So what you do instead is you reason symbolically, you do algebra, find out exactly

Clark Barrett (14:58)

what x and y have to be. That's exactly what we're doing with formal methods.

Jing Conan Wang (15:01)

Yeah, yeah, that's actually very good metaphor. it's essentially algebra. Like if we use algebra to do things, we can have the guarantee that it's working that way without having to enumerate all the cases.

Clark Barrett (15:15) 

Maybe a lot of times when you think about this work you did in algebra of solving systems of equations, you know, you try to get a value for each variable. But you may recall that sometimes there's no solution, right? You might get get some equations that are inconsistent with each other. So that's exactly the same thing as getting a proof. a proof that there's no bug is like a set of inconsistent equations where you say, look, there's actually no input that can make this bad thing happen.

4.The Future of Programming: Abstraction, Natural Language, and Human Intent

Jing Conan Wang (15:44)

Another thing related to this is because as you mentioned, there's so many similarity between program and math equations. and in the past like five, six decades we have been taking granted like a program needs to look like some letters, English letters combined in certain ways as a function, function calling. an equation in some ways also a way to describe a processes. Do you think the definition of program will also change because of formal verification or because of the way we are like leveraging AI to write code.

Clark Barrett (16:23)

It's a great question. I mean, we you think about how programming has already changed in the past, right? So we started off with you know assembly language, where you had to write at the level of the machine code and you had to write very specific instructions that were tied to the computer CPU, 

Clark Barrett (16:42)

and then people invented high-level languages, you know, like C Fortran, even higher level languages like Python, JavaScript.So these all helped raise the level of abstraction to help people be more productive. I think what we're seeing now is another raise in that level of abstraction where people are coding with natural language and the AI models are figuring out how to turn that into code. I think

what's quite interesting is it could be that in the future the actual coding languages used by the models could be something very different because now we have something different to optimize for. In the past it was let's try to create programming languages that are easy for humans to read and to use. But in the future maybe the most important thing is programming languages that are easy for models to use and maybe are easy for to verify because verification is now becoming a big bottleneck.

Jing Conan Wang (17:40)

Yes. And and also like you mentioned actually a great rich history of all the programming programs look like. And it it reminds me that initially all the programs are writing assembly language. And it used to be like we need to understand all this how this assembly language looked like, but no one actually read it now. and probably one day the Python program or C program will be like assembly language. And you mentioned about a lot of people I use a natural language to program now, which I observed. the many people in the industry is doing that. I'm also curious because if we think about math, it feels very precise. It feels like exactly symbols, the definition, there's no ambiguity. But if we think about human language, there's a lot of ambiguity. And how do you think that what we need to do to reconcile this? Or is that going to be a problem?

Clark Barrett (18:40)

I think it is actually the central problem now for coding. Well, there's sort of two problems. One is how do you capture the human intent so that the models that are building the code have a precise understanding of  what you want. And then there's the problem of did the model actually do what it was supposed to do? So i think formal methods will actually help solve the second problem, which is does the model do what you expect it to? Because we can actually prove a theorem about whether the model built what it's said it would

Clark Barrett (19:13)

But the first problem of did you get the intent of the the human. I think that's a very interesting problem that needs further study and research. And probably in the future what we'll have are very specific AI models that are designed to do this capture. So they have a whole interaction with the humans, the stakeholders, they ask questions like, well what did you do about this case, what about that case? They do even maybe do like some mock-up prototypes and say, well is this what you had in mind in order to capture that human intent and have it stated precisely

5.Making Formal Verification Affordable with AI

Jing Conan Wang (19:45)

Mm, yeah, exactly, yeah. Another question related to this is that like we mentioned we talked earlier, because of AI we have a lot more code than before. And if we want to ensure there’s no bug in those codes, how does the cost look like if we use it for using formal verification to like is it super costly or is it's gonna be cheaper than what we're doing currently?

Clark Barrett (20:10)

Yeah, that's That's great question. So it used to be very costly. And the reason is the sort of pre- AI formal

world you could look at as a trade-off between either you can do something very automatic but not very scalable. It only works on a small thing. Or you can do something very scalable and it requires an army of experts. So there are these amazing things that were done projects like SEL4 and CompCert, where a very large program was verified. But it took you know years. It took years of of experts work to do that.

Jing Conan Wang (20:45)

Yes. I heard you you did using SEL4 four and to verify operating system level and took like a couple of person years, is that right?

Clark Barrett (20:54)

I think it took much more than that. I think yeah, like maybe decades of person years. But What we started to observe in the last few years is as AI models became more capable, they could actually take on this task of what would used to be required in this sort of scalable formal methods model. AI can fill Could in those gaps. So what was what's required there is somebody has to write down these

specifications, things called invariance. These are formulas that annotate your program. Your program

Clark Barrett (21:26)

When you annotate your program with these formulas, then it tells the formal tool which theorems. To prove. Without this, it doesn't know which theorems to prove, and you don't know how to do the verification task. So the humans had to write those formulas. But now we can get AI to write those formulas. And just  this last summer, in a project I did with my PhD student, Livia, who now has joined my company,

Clark Barrett (21:50)

We took. a library in Rust, 30,000 lines. It took human team 15 person months to verify that code. Our AI harness together with a formal tool did it in ten and a half hours with no human intervention.

Jing Conan Wang (22:07)

That's a really great impressive improvement. Yeah. another question I have related to this is that when for example like when we do the traditional programming, it's like a lot of people are talking about the d the whole job definition of being a program is completely different. It used to be we need to write a pseudocode, we need to translate it and do the program. And you mentioned a very interesting point, is like we need to have some invariance or even some like kind of guarantees in order for the formal verification to work. From your perspective, would the meaning of writing program different in the future?

Clark Barrett (22:49)

Yeah, I think we're going to see more and more a shift towards writing specifications, being able to precisely specify what is it that you want the agent to do. And then I think we're also going to see more shift towards providing guarantees that the agent has done exactly what you asked it to. you know, I used to be a little more pessimistic. I thought, writing specifications is really hard. But actually agents are quite good at it. And so I think it's more about the agents and the humans working together and make sure and to make sure they're on the same page. But I think agents can help us a lot. 

Clark Barrett (23:26)

In fact, you know, when I recently when I vibe code and I say, Hey, I want you to do this, the agent comes back and says, and you probably wanted this, this, and this too. And I'm like, yeah, you're right, that I did want that. And so they're quite good at anticipating the specification. but where they still fall down is get turning that into an implementation. And that's where formal can help. It can make sure that that gap is closed.

Jing Conan Wang (23:50)

writing a good specification is actually a pretty hard task and it's awesome to learn that actually AI can be helpful for that. can you walk us through like a one examples of the specifications and like how a good specification actually is so helpful to for the formal verification process?

Clark Barrett (24:09)

Yeah, so like I said, there's a spectrum of specifications. So some of them are kind of universal. So this idea that my program shouldn't crash. So what's great about that is you don't have to write that specification. Like a formal expert can write it once and for all. And then you can just use it off the shelf. And this is what I see happening in the future is that

you know, researchers, experts, companies will provide a library of specifications and say, you probably want this one and this one. So the don't crash specification is a great example of that. So that's easy.

Clark Barrett (24:43)

But then… Maybe you have a very particular thing you want your code to do. So for example, maybe you're writing a compression library. So then you actually want to say, I want to make sure that this code actually compresses and then can decompress back to the same thing. So there's actually a very nice specification for that. You just say for any input x. if I compress and then decompress, I get X back. So that's a little equation I can write. You decompress of compress of x equals x, and that's a specification. So you can you know depending on the complexity of the program, the specification might be trivial, it might be fairly simple, or it could be very complex. And so I think what we'll see is trying to get farther and farther up this ladder of dealing with complex specifications.

6.AI and Mathematical Proof

Jing Conan Wang (25:35)

Yeah, exactly. And tied back to what you mentioned earlier, maybe in the future the activity of writing program or interacting with computers now is in this specification level, not in the writing program, right? Yeah. Another question I have on this is that recently there's a lot of breakthroughs in the math areas like OpenAI is doing a lot of proof, Claude is doing a lot of great work. What do you think about the future? It's like is AI would be like So good at proving that all the math theories?

Clark Barrett (26:08)

Yeah, it's really been stunning. I mean, if you told me a year ago that a millennium problem would be solved by AI, I wouldn't have believed it. But here we are. I think what we have to accept and realize is when it comes to the mechanical steps of doing proof, this is something that AI is going to get better and better at. However, I think what's really important is that we find Ways for mathematicians to work together with AI researchers because ultimately what we care about is not just whether a theorem is true or not, but understanding why it's true. If we don't understand that why, then we haven't really progressed as much as we would like to. And so it's encouraging to see, you know, colleagues I have who are in this space in mathematics really, you know, advocating for this kind of let's work together, let's make sure that we understand we don't just want to you know prove a bunch of theorems that we don't understand.

7.SMT Solvers and the Limits of Computation

Jing Conan Wang (27:08)

And I think I understand why it's very important. And with AI now have more capability, maybe learning the why is what humans need to do. Yes. Yeah. And for the next part I actually would love to learn more about your research and your how you actually impact the formal verification fields. I know you did a lot of amazing work, including the SMT solvers. And can you ask work us more about this part?

Yes. SMT solvers, actually, this was something I was working on during my PhD at Stanford. We didn't call it that back then, we called it decision procedures or something. But it was this idea that, okay, and it was very much motivated by formal verification. Suppose we have this task where we want to ask a question about some code, we want to prove a theorem about some code. Can we actually? somehow prove that theorem automatically. We don't want to prove it by hand.

Clark Barrett (28:14)

Some algorithm that can prove that theorem. This is actually a very old question. It goes back to You know. What David Hilbert called the Entscheidungs problem, which he posed in 1928 as the fundamental.

Clark Barrett (28:28)

challenge for mathematical logic, which is given a statement, a mathematical statement, can you come up with an algorithm that shows whether that statement is true or not? Well, unfortunately for him,

Clark Barrett (28:39)

Church and Turing proved that you can't do it.

Clark Barrett (28:41)

And this is the beginning of the understanding of the limits of what can be done computationally and what's undecidable. So proving an arbitrary, you know, deciding whether an arbitrary formula in first-order logic is a true theorem or not is actually an undecidable problem. We can't write an algorithm that does it. However, people didn't give up. They said, okay, but maybe we can solve it in practice.

What that has turned out really to be true. And so for most of the things that we care about, we can build algorithms that can prove these kinds of theorems. And especially the kinds of theorems that come up from reasoning about software, we can turn those into

They're very interesting kinds of theorems. They could be hundreds of megabytes long. The statement of the theorem is a hundred megabytes long, but it's actually not that difficult to solve. And so we can build these

Clark Barrett (29:29)

The tools, and the SMT solvers are examples of this, that can automatically, systematically check every case and say, yes, this is a true theorem, or if it's not, give you an exact reason why.

8.Building CVC5: Performance, Expressiveness, and Trust

Jing Conan Wang (29:42)

Yeah. And you and your collaborator actually have come up with a couple of SMT solvers, like SVC then CVC and then CVC light. I know there's a lot of like jargons our audience probably doesn't know that. Can you  walk us through about some of the versions of the SMT solvers you did, why that matters and how this could be helpful for us to identify like for the formal verification and also ensure that's no bug in code.

Clark Barrett (30:14)

So SVC  was a tool that I built with some collaborators, primarily Jeremy Levitt back when I was a student, graduate student. And it was actually a lot of fun to work on. In fact, Jeremy was sort of a night owl, so he would come in about the time I was ready to go home, we'd overlap for about an hour, I'd tell him what I did, then he'd work all night, and then in the morning he'd tell me what he did. And so that's how we, you know, made progress on the tool.

Clark Barrett (30:44)

Basically, we were trying to solve these problems that were coming from verification of hardware and software. And we were just adding more capabilities, figuring out the theory. What happened though, over and over again, I like to say I just keep trying because I'm keep trying to get it right, is we would build a system and then realize that the system we had built, the way we had architected it, had some fundamental limitations. And so we'd say, okay, I think we need to start over and you know build it without those limitations.

the next time. And some of the things that we got interested in were Performance is really crucial because these, in order to solve these problems, you often have to do a massive amount of case reasoning, reasoning by cases. And as we know, that has an exponential blow-up. And so if you can't do it fast efficiently, then you know there's no hope. Performance was always a big bottleneck, and we'd realize, we've architected this in such a way that it can't do better than this, we have to do a different

architecture to get the next level of performance. But the other thing that's really important is the expressive power of these tools, which means what kinds of formulas can it prove? So to start with, we are proving very simple formulas, really not much simpler than what you would do in algebra systems of equations. But programs have other kinds of interesting things that you might want to reason about, like data types.

Clark Barrett (32:13)

Like Floating point numbers, like machine arithmetic that's done mod 2 to the N.. And so building

native capability to reason about these kinds of things improved performance and improved our ability to prove these kinds of theorems. And so we were adding these

features, these capabilities, and that also led to you know needing to start over. So, you know, we're now on C VC5, that's the latest version.

We've written it many times, but the current code base is now more than a decade old, so I think we maybe finally got the architecture in a pretty good place. But it still continues to be a challenge to improve the performance and improve the capabilities

Jing Conan Wang (32:56)

if you look at all the iterations you have done, do you see like evolution, a theme of evolutions?

Clark Barrett (33:14)

Several themes, yeah. So like I said, improving performance and improving capability are key themes, but a more recent theme is improving trustability. you know CVC5 is now something like 300,000 lines of C code written largely by graduate students, right?

I mean. And we're saying this is a tool that you can use to gain rock solid confidence in your software. So we don't want there to be bugs in the solver. So what we did actually over the last five or six years is we built a capability so that when the solver gives you an answer, it can also produce an independently checkable certificate. So it says, here's my answer, and here's a certificate that you can check that proves that that's the right answer. and this was a ton of work. This is really, really painful to do this. You basically

have to go and instrument every single reasoning step in the solver and make sure it's recorded and that all of that is done efficiently. But this is working now and it's really fun and it's really cool. 

And one of the sort of unexpected benefits of this is it also allows different tools to talk to each other now. So there are these exciting Frameworks called interactive theorem provers that are very trustworthy. But they're not very automated. They're a little bit slow. They usually require humans. So now we can take a tool like an SMT solver. We can hand the certificate to the interactive theorem prover. And the interactive theorem prover doesn't have to trust the solver at all. It can replay that certificate internally. So we have a tool called Lean SMT that connects SMT solvers with the Lean Theorem Prover. The Lean Theorem Prover is the one that you see in the news all the time when they're proving these big New MAP theorems. We also have integrations with other theorem provers as well. So this new focus on sort of trustability has also opened some interesting doors.

Jing Conan Wang (35:15)

Wow, that's actually also like it's so useful. because a lot of people when we are looking at this like cool technology that can solve a problem, we'll our reaction will be wonderful. But how do I verify it? Yeah. Yeah. And you have created this like a second artifacts on top of the original proof. But I assume it's designed for people who want to like quickly verify and build trust on whether it's correct or not.

Clark Barrett (35:41)

That's right. So it uses a small trusted set of rules. there's an independent  proof checker that you can

use to test it that's very small. You have And we have this ability to translate that certificate into other formats so you can check with other things. One sort of thing, another sort of sort of interesting capability that came out of this, I think is very relevant now.

Clark Barrett (36:03)

So you see the frontier labs saying, okay, we're going to prove these theorems by just throwing millions and millions of tokens at it. And that works, but it's quite expensive and quite time consuming. So tools you know In some cases, if you can solve some sub problems with, say, an SMT solver and then replay that

Clark Barrett (36:24)

into this theorem prover, you might be able to solve a theorem in seconds or microseconds that would take an AI, you know, minutes, hours and millions of tokens. And so there is really an important role I think for for this classical formal methods automated reasoning solvers to play in the new AI era. And that the role is a lot of times we can solve problems, proof theorems faster and cheaper with these other techniques.

Jing Conan Wang (36:53)

A lot of this like what open I does, like the LLM is really using the large language models to brute force try all these different combinations and figure out either one is working. And like you mentioned, it could be very costly, very time consuming, and the SMT solvers that many like traditional like the methods like using human prior knowledge to verify can be actually boasts very fast and also can give very good guidance to the large model to solve this. Yeah. another thing I heard you mention about you actually did a couple version from scratch. And you mentioned this is a huge system with 300,000 lines of code and did it a couple of times from scratch. What made you decide to do that, like starting from scratch?

9.Rewriting from Scratch and Collaborating Across Universities

Clark Barrett (37:42)

Well, you know, we have the luxury of being researchers, so we can do that. And I think when you do that, it's when you sort of realize that you've painted yourself into a corner. One of our early versions of, so I'll give you one example, when we were building CVC3, we had built it around this architecture already anticipating the importance of proofs and trust, where every computation actually produced a theorem. So this was great in terms of trust, but it was not great in terms of performance. And what we realized is we needed to decouple the trust from the computing the answer. And that was not a thing that was easy to do with the architecture we built. And so we said, all right, we'll start over. And this time, everything's decoupled, everything's optimized for performance, but we still maintain this capability to do proofs. 

Jing Conan Wang:

Another interesting part of the real project, for example, CVC5 is that it's developed in a very distributed way. There was like researchers across different universities developing it. And I could imagine it caused a lot of like communication challenges, and so you collaborate over this. And but the benefit of the no single company or no single person can control this system. How do you actually figure out an efficient way to get a project done? What is the biggest learning you have in the process? 

Clark Barrett :

Yeah, so I would first say that I'm just really fortunate to have fantastic collaborators. I don't think just any group can do something like this. The other main project leader is Cesare Tinelli, who's at the University of Iowa. And he and I sort of bonded very early around 2000, because we were both frustrated about some inaccuracies in underlying theory in this area. And we realized that we both had these really, you know, we had a desire to put this on a very firm footing to get precise  theoretical foundations and then build systems based on that. And so we started collaborating and, you know, we've been collaborating ever since. I think what makes it possible is, you know, we have a shared vision. Some of the other universities that are collaborating with us, you know, are professors who used to be like our postdocs and our students. And so everyone sort of has grown up with this shared vision. And I think that's really what motivates it. That and really great teamwork. 

Jing Conan Wang:

I know that you also work very hard to bring the CVC-5 and other projects you have to have the real world impact. And CVC-5, for example, runs far beyond the labs and has been used across the industry.  Can you walkthrough us What's the rest about the journey of CVC-5?

10.From Research to Industry: CVC5 at Amazon and Beyond

Clark Barrett :  

Yeah, so, you know, something I learned from my PhD advisor, David Dill, he was always saying, okay, you don't want to just solve a problem in isolation. You want to go find a real problem in the real world and try to solve that. That will drive your research. That will drive the decisions that you make. And that really resonated with me. And I think that's one of the most important problems. You know, we collaborated with a security team at CMU that was looking at, you know, how do we reason about security attacks through certain kinds of string injection. And based on that, we built a new capability to reason about strings in CVC-5. And, you know, there are other examples. What's really interesting, though, is sometimes you're just totally surprised. So our most crucial industrial collaboration, which is with Amazon, this was something we didn't even know about. So they had found, they also had a problem where they needed to reason about strings, but for a completely different purpose than the purpose that we had built that capability for. And we didn't even know about it. But then we found out, actually, I found out because I went to a talk that was given by Byron Cook. And he said, yeah, we're building this new thing and we're using SMT under the hood. And I was like, oh, they're using our solver. So sometimes when you build these general purpose tools, the sort of best case, and this is what happened here, is that because you're trying to build something general purpose, you know, that really could be used for a lot of different things, and someone finds a way to use it that you had never anticipated. And that's what happened with the Amazon collaboration. 

Jing Conan Wang:

Can you walk us through like, what is this collaboration and how CVC-5 actually help them? 

Clark Barrett :  

Yeah, so they had a very specific problem that I think is pretty easy to understand. You know, with the rise of cloud computing, people are putting their data in the cloud. And this data could be extremely important. It could be critical, very important not to leak it out to the world or to a competitor. But how do you determine who has access to that data? Well, you have to write some kind of a policy, and this policy is written in a simple logical language. Well, developers don't always understand logic as well as you'd like. And so you could imagine somebody making a mistake and saying, oops, I accidentally mixed up an and and or and allow and a deny. And now instead of saying only these people can access the data, I say everyone except those people can access the data. And now suddenly everybody in the world has access to your data. So Amazon was finding that many people were having these kinds of problems, making these kinds of mistakes. And so they wanted to build a tool that would help developers check if the policies they were writing were safe. And in fact, the most obvious check is, did I accidentally make my data public to the whole world? And so they built a tool called block public access, which if you turn that on, it will alert you if you did that. But how do you tell someone writes a complex policy? How do you tell if that is actually making your data public? Well, that's a logic problem. And so what they did is they would turn those policies into a formula that had to be checked. And the formula had to be able to reason about, you know, Boolean logic, it had to be able to reason a little bit about machine arithmetic, but it had to actually reason quite a lot about strings, because like when you're saying what domain something can go to, you typically use strings and regular expressions to talk about what's allowed. And CVC5 was the only tool that had that capability to reason about strings and regular expressions in that way. So they built the tool, they used CVC5 and it was able to solve their problem. 

Jing Conan Wang: 

A follow up question I have with this. I know that like the policy files is kind of an additional meta programs that you can verify. What are the other things that is in this, what are the other like creative interesting application you found?

Clark Barrett :  

Yeah, well, what's really interesting is the, you know, this was also sort of lucky as we as we were building these SMT solvers, we discovered that we'd found kind of a sweet spot because they are general enough that they can be used as sort of general purpose tools and find lots of new applications. But they're specific enough that they're still fast and largely automatic. But what I would say is if you can, they really are designed to be general purpose logic tools. So what does that mean? That means if you have a problem that looks like, hey, I have a world that looks like X. And in this world X, is it possible for Y to happen? Like it's a very general kind of question that can come up in a lot of different situations. If you're able to model X and Y in the language that the SMT solver understands, then you can answer that question with an SMT solver. And so we've seen just over and over again people using that for things we had never imagined because it is a very general purpose, recent capability. 

Jing Conan Wang: 

Yeah, that's actually cool. Like having this technology that SMT solvers actually empower more application on top of it. And also over time it kept more and more real world impact. And at which point you realize it's no longer just a research project, it's become an infrastructure that's betting on the companies and projects depend on. 

Clark Barrett :  

Yeah, I think it really was that moment when it was actually in 2018, I think in Oxford, I was sitting in a talk being given by Byron Cook who was explaining this is Zelkova tool. And I thought, oh, wow, they're using this for, you know, they're using it in a production environment. And we got to make sure that this is really solid. And, and so that has really informed. I mean, we always were hoping that people would use it, both for, you know, industry and for research, but it really has informed how we've developed the tool since then we have this really be sort of two missions. One is to support our industrial users and the other is to be a research platform and we have to be very careful that these two missions don't interfere with each other and we have a bunch of sort of techniques and workflow processes to ensure that we can do that. And so we have to be very careful that that's the case. 

11.CSLib: Formalizing Computer Science in Lean

Jing Conan Wang: 

Yeah, that's cool. And also later you also expanded y our scope and have the CS lib and tell us more about this project. 

Clark Barrett :  

Oh yeah, okay, so CSlib is a project that I started talking with potential collaborators about probably an early 2025, but it didn't really take off and launch until early this year. So what is it? Well, you know, I was thinking, like I said, I've been thinking about this world where AI and formal could be used together for many years. And I started to think about, okay, you know, if this happens, if AI gets good enough that it can really help drive the formal tools, then what will be the bottleneck if it's not AI. And what I realized is we have these these SMT solvers, they're like these low level tools. And, but we don't actually have really good tools for turning software into logic. And you need that in order to do formal verification. So there are some academic tools that are pretty interesting tools like Daphne and Barris. There's, there's a tool called Spark for the Ada language. And most of these tools worked by taking, taking programs and turning them into logic that could be fed to an SMT solver. But what I realized is this probably was not what we wanted for like the ultimate verification tool, because first of all, you have to trust all of these tools and you have to trust the SMT solvers. However, if you build this whole thing inside of a theorem prover like lean, then the base of trust goes way down. So I was thinking, we should really build something inside of lean that can do this task. And then while we're at it, how about instead of targeting just one language, we target all languages, we build an intermediate representation that can be used interchangeably. And then you could even prove that your translations are all correct. So this was sort of the vision of CSLib. And then I talked with some colleagues and they also had a vision of just formalizing computer science in lean. And so we joined forces, we said, all right, we'll build this, this new library is going to have two main missions. One is to formalize theoretical computer science. And the other is to give tools for reasoning about code. 

Jing Conan Wang:  

Wow, wow, that's a very, very ambitious goal. Yeah. And I also know that you have, you have actually published white papers about CSLib and more people started using. And I'm wondering from a user's perspective, how would someone actually use the CSLib today? For example, to verify a code as a researcher or as a student, how we actually can use it leverage it. 

Clark Barrett :  

So we envision several different use cases and several different audiences for this project. So one is really for education. And there it has a similar kind of a similar, it's similar to Mathlib, which is this library for mathematics. Actually, the dual use nature of CSLib is similar to Mathlib as well. So Mathlib has a great educational value for teaching mathematics, helping people understand how different mathematical proofs are put together. But it's also without Mathlib, you would never have these amazing results from the frontier labs because Mathlib is over two million lines of lean that describe the definitions and concepts that are needed to talk about modern mathematics. Without it, you can't even state the problems that you want to try to prove. So if we want to do something similar in computer science, we want to be able to reason about it. We want to be able to state interesting properties of algorithms and of real code. We have to build a similar library. And that's why we need CSLib. So it's designed, yes, for education, but it's also designed to be very practical so that we can build things on top of it that allow us to push the frontier both of theoretical computer science and of practical code reasoning. 

12. The New Company: Mission and Vision

Jing Conan Wang: 

Yeah. Like you mentioned, there's a lot of applications, not just like one hand education, but also the real world application. And I think you always have the passion of pushing it to the real world and you still build something cool on top of CSLib and other research you have done. And we mentioned only like your company getting out of Stealth today. Congratulations again for that. 

Clark Barrett :  

Thank you. Yes, it's very exciting. 

Jing Conan Wang:

Can you tell us more about your current project, current company you're working on? 

Clark Barrett :  

Yes, so the company that emerged from stealth today is called and truth. And the mission of and truth is really to take all of these ideas that we've been working on and thinking about and make them practical in the real world. And we want to build a universal verification machine that can take code in any language and prove that it is safe, reliable, secure and correct. So the vision of and truth is quite closely aligned with this vision of CSLib. But, but whereas CSLib is more sort of designed to be this open source community project, and the goals are really to, to feed education and research. You know, the goal of the company, of course, is to build something that's really going to be usable by customers. And so you have to have that customer focus, that understanding of what the real customer problems are. But under the hood, you know, it is, it is drawing from all this wealth of formal methods research that's been going on for 50 years and trying to pull it all together into something that really can be practical. 

13. The Story Behind &Truth

Jing Conan Wang: 

it’s wonderful that you started to turn all the research knowledge you have into a real-world company like &  Truth. Can you walk us through the journey you had to create this company?

Clark Barrett : 

Sure. Yeah, it’s quite interesting. So early this year, I think in January, I had the chance to meet Chris Hsu, who’s my co-founder now. Chris is a very interesting guy. He’s very interested in AI safety. He had come to Stanford looking to support research in AI safety, and because one of my jobs is to co-direct the Stanford Center for AI Safety, I got to meet him. We had a very interesting meeting. He’s a really deep thinker, a thoughtful person. It was very engaging, and towards the end he started asking me, “Well, what is it that you’re most excited about?” So I was telling him about CSLib and the vision of being able to build this sort of universal capability to reason about code, and he got very excited. Then he calls me up later and he’s like, “I couldn’t sleep. I just keep thinking about this idea.” And he convinced me that this is an idea really worth [pursuing], and that the importance of the mission for AI safety and for code safety was too important to just not do something about it. So that’s how I met Chris, and it’s been really fun getting to know him and working with him.

And then I started thinking about who I would like to work with. I had also just come back from Singapore in January, because I was at a conference there, and while there I visited a colleague of mine, Ilya Sergey. Ilya had built these really amazing tools in Lean that were very aligned with the CSLib vision. So I immediately thought, we’ve got to get Ilya. And so the three of us are the co-founders: Chris, Ilya, and I.

Jing Conan Wang: 

Oh, that’s wonderful. And that was early this year, right? Since then, what have you done to prepare this company and get it launched?

Clark Barrett : 

Yes. Well, we started by talking to potential funders. And what’s interesting is Chris is well known and well respected in financial circles, and he also has this real desire to do AI safety work. So we were able to fairly quickly raise a lot of money, mostly from individuals who are really interested in AI safety and in this mission. So that was a bunch of work that happened early.

Then we started thinking about how we build the team. As an academic, I’ve done some work in industry and some work in startups, but I’ve never really been on this journey, the founder’s journey. So it’s been very interesting, because there are so many things, so many little details you have to take care of, so many ups and downs. The roller coaster of: is this partnership going to work out? Is this hire going to work out? And we went through all of that together. It was a very interesting experience.

But by June we had an office here in Palo Alto. I was able to hire my student who just graduated and a few other people, and Ilya hired his students and a few other people in Singapore. And then this summer we were really able to start to get to work. That has just been one of the most fun and magical experiences I’ve ever had: working with a fantastic team, really aligned on a mission, trying to deliver something that we really believe will have a positive impact in the world.

14.Why Leave Academia Now

Jing Conan Wang (54:37)

 And what made you decide that, oh, this is actually something that should be a company, no longer just a research project? 

Clark Barrett : 

Yeah, it was a few things. So first of all, sometimes you can kind of tell when the time is right for, for a big idea. And then it also, you know, you just have to sort of be honest about the fact that you're not going to be able to reach, have as big of an impact if you do it in academia versus, you know, you can bring in resources. You can move faster. You can, you know, spend a lot of money to do R&D in a company, things that are more difficult to do in academia. So I just, I first of all thought, I think the time for this big idea is now, and it's a big, it's an important idea. It's like the underpinnings of AI safety and code safety. And so in order to really bring that idea to the world as quickly as possible, I thought a company is the right vehicle to do that. 

15. The Four Big Challenges for AI safety

Jing Conan Wang (55:41)

I think the timing is actually a great timing for this. And in the past, I think a month or two, there's a lot of reports about AI safety, new abilities for the code. So the whole industry is like looking for a solution. At the same time, it looks like the solution is not going to be cheap. And I know that you have spent like multi decades on doing research projects to give us a good SMT solvers and all the ecosystem around it. Now that you entered in the industry, what is the visions you have in this company that you will give to the world? 

Clark Barrett : 

 I think there are four big challenges that need to be solved in order to deliver this to the world. So one is just building this sort of CS-Lib like infrastructure. It is the library, the concepts, the definitions, the semantics in order to translate real programs into mathematics. So like I said, there are some academic tools that can do this, but this hasn't ever really been done in an industrial setting at scale. And so I think that's number one. But thanks to the fantastic work by formal methods and programming language researchers, we know how to do this. There's an engineering task to make it work really well. Number two is once you translate your code into math, you have to have this specification of what does it do. And so this challenge of how do we write specifications? How do we help capture user intent? I think this is another big challenge and one that we're also focused on in the company. Number three, though, is now once you have the math, the code, and the specification, then you employ these formal techniques and you get theorems that you have to prove. So drawing on all of my experience with SMT solvers and automatic theorem proving, we believe that we can create proof automation in this context that's much more efficient than if you just hand it to an LLM. So an LLM can probably do the proof, but it's going to be quite expensive. And if we want to verify millions of lines of code, we can't be spending $100 per line. We can't even spend $1 per line. We need to spend less than a cent per line of code. And that's what this proof automation will give us. And then finally, the number four challenge is just how do we build the agentic harnesses, the AI capabilities? How do we interface those together with the formal tools in an effective and efficient way? Again, we don't want to have to spend millions and millions of tokens to solve small problems. We need to be very efficient. So these are the problems that needs to get solved in order to deliver this to the world. 

16. Initial Focus: Legacy Code and AI-Generated Code

Jing Conan Wang (58:34)

now you're doing the startup and often it's very, very important to focus on what is the initial edge you have, what is the initial set of customers you are focused on. Do you have any visions or thoughts about what industry or what initial set of customers we are focused on? 

Clark Barrett : 

I think we are interested in solving both of the problems I mentioned earlier, which is legacy code. So going to companies who have large legacy code, maybe in old languages that aren't very fashionable anymore, and being able to say, yes, we can read your code, we can analyze it, we can find the security vulnerabilities, we can give you assurance that you're not vulnerable. So that would be, I think, one big target. But then the other is all this new code that's being written by AI, wouldn't it be great if there was another layer on top of your coding agent that said, oh, not only did I write this code for you, I actually proved that it has this and this and this property. So now you can rest easier and sleep at night because you know your code is safe. 

17.Securing Open Source Code

Jing Conan Wang (59:48)

we obviously have heard a lot of news like the PHP vulnerability that just happened in the last week as we were recording. It made us realize the whole internet infrastructure is so fragile. It's just maintained by legacy codes that no one even take a look for. I think that issue has been reported by someone for a couple of years already, but no one really spent time fixing it. I'm pretty sure this is not the only case. What do you see how your technology will help us to prevent next PHP issue? 

Clark Barrett : 

So actually we have launched a project to verify all of the open source C code in the world. There's a nice video about it on our website, andtruth.com. But what we've done is we've organized it, we've visualized it, we've prioritized it, and we're going to use our platform to try to verify that this code is memory safe and safe from undefined behavior. Now what we've discovered as we've started on this journey, well first of all it works. It's amazing. This infrastructure, all of this stuff we've pulled together, proof automation, AI, it actually works. It can prove these open source code bases are verified. However sometimes it gets stuck and when it gets stuck it could be one or two things. One is we need to improve our tool or it could be that there's a bug. And actually we've already found significant bugs in open source software. And of course we're working to report those in the most responsible way to make sure they get fixed. But just based on our initial efforts, I think there's still a lot of bugs out there. And so I think it's really urgent that this mission, that we move forward as quickly as possible to secure. Initially we're going to focus on this open source code, but I think we want to secure all the code eventually. 

18.Responsible Disclosure and Verified Fixes

Jing Conan Wang (1:02:05)

you mentioned you already identified a couple bugs. And a lot of bugs if not handled very well it actually will cause incidents. Like there will be hackers trying to elaborate on the bugs. What is the process you're following after you identify new bugs? 

Clark Barrett : 

Because all of this is being done on open source projects, we are in the process of engaging with the open source community. So we want to follow the process that makes the most sense for them. We don't want to, you know, put them in a difficult position. We've also been, you know, in contact with various security organizations and agencies to make sure we're following the policies that they outline. It's a very serious thing. In fact, as we were making our initial video, we were like, oh, can we even show any of these bugs? And we were able to show one that's already been fixed. So we knew that that one was okay. But yeah, we have to take this very seriously. 

Jing Conan Wang: 

Yeah, yeah. And I wonder also for a person who is less familiar with the AI safety industry or generally the security industry, and how does this bugs, like all reporting system works? Like is there any committee that is triaging over the issues and the coordinate on efforts when they should be released to public? 

Clark Barrett : 

Yeah, there doesn't really exist some kind of central coordination agency for this. I mean, there are agencies designed to respond when things are reported. But I think this is an interesting question of how best to manage this. You know, for now, I think we're trying to just build relationships with like open source maintainers and understand their process and work with them. We're also one of the great things about formal technology is not only do you, can you find a bug, you can actually fix it and prove that you've fixed it. So one of the things we like to do is offer, you know, people who are using our tools will say, look, we found this problem. And here's a suggested fix and we proved that it's a fix, right? And we think this is a lot more valuable than just saying, hey, there's a potential problem here. So we're trying to really focus and make this data as valuable as possible. 

Jing Conan Wang: 

  what's the actual work people need to to to put into to get a solution and a certificate that is actually solved the problems. 

Clark Barrett : 

So interestingly, it's exactly the same work that we have to do with our with our verification engine anyway, which is understanding the code, turning it into mathematics and proving something about it. The part that's a little bit different is if we have to patch the code in some way. So what we can guarantee is that that that patch ensures that the code is safe. What we cannot guarantee is that the patch doesn't break some business logic or some other, you know, important specification. And so this is why we have to work with the designers or the maintainers in the case of open source software. And eventually, if we go to close source, we would have to work with the company's developers and make sure that the intent again, the intent of the program or the intent of the designer is maintained because you could fix the program in a way that makes it secure, but you know, breaks what the intent is. 

19. Open Source Work and the Business Model

Jing Conan Wang (1:06:30)

right now the open source community is just like is is is incredibly under resourced. Like there's not many people are maintaining even like a lot of famous projects. Yeah. And that alone, I think that to spend time to fix in bugs. What is the business model here and how do you think that the industry should evolve? 

Clark Barrett : 

Yeah, that's a great question. I mean, we are really engaging with the open source community more as sort of a service. We think it's important for the world. We think it has to be done. We think we have the capability to do it. But it's also a huge learning opportunity for us to take on these code bases, see how our tools work, see how to interact with the maintainers, what works for them, what doesn't. And so we really view this as a win-win. You know, on the one hand, it is something that we can do to help the public help our digital infrastructure be more robust and secure. But on the other hand, I think we really need these kinds of case studies to improve the tools, improve the engineering, make it more performant, more automatic and then be able to go and do even larger scale things. 

20.Verification for AI Coding Agents

Jing Conan Wang (1:08:04)

I want to dive into the second application, which is also equally incredibly impressively interesting, the AI coding agents. So I'm a heavy user of AI agents and every day I'm actually creating thousands of lines of code. I don't think I can review all those code. I'm curious from your perspective how your system actually can help solve the solution. For anyone who is using AI coding agents, how does the and truth will help them? 

Clark Barrett : 

maybe just taking a step back, the core technology that we're building, we think of it as a new primitive capability, the ability to reason and prove things about code. And we think that the application of that new capability is probably only limited by imagination. If you really think big, it's amazing what a capability like that could do. For example, imagine that in some future world you have these autonomous agents in cyberspace and agent A comes to agent B and says, I'd like to provide you the service. And agent B says, oh, show me your code and your proof. And then agent A says, here's the code, here's the proof, you can check it yourself. And agent B says, oh, okay, I believe you, you can provide that service to me. I mean, that would be a much nicer world to live in than the sort of chaotic agent world that we see today. And so this is kind of what we're trying to move the world towards. But this is only possible if you can employ this formal very, very fast, very, very cheaply, very autonomously. And this is what's never been possible before. But with the help of AI, with the help of automated proof automation, with the help of, you know, a robust verification infrastructure built in lean, we really think that this is going to be possible. And so you can imagine having this capability as a sort of sidecar to your AI coding agent and it's consulting and saying, oh, I want to build this, but let me check that I got it right. And even the agent is like calling the prover and they're collaborating together. And I think what's going to happen is you'll do your same process you're doing today, but your code will just work the first time.

21. Formal Methods and LLMs: Building a Safety Box

Jing Conan Wang (1:10:37)

I'm wondering that because you mentioned about that because the AI coding has much more capability and it also has this sort of like probabilistic nature, which is very different than traditional program which is with my humans and deterministic. So how, how would you envision that these futures of form verification will look like with all this neural networking architecture, problem list programming and all this kind of systems. 

Clark Barrett : 

Yeah. So I did work on a trying to apply formal methods directly to neural networks for some time. And that's a very interesting research area, but I don't think that approach will ever scale to something like an LLM. So the idea that you somehow are going to use formal methods to prove that your LLM is safe. I think that's, that's going to be very, very difficult. But we can take inspiration from, again, from something that was done in the formal methods community. There's this example of a compiler. So a compiler takes your high level code and turns it into machine code. So the thought of verifying a compiler is extremely daunting because it's been done for one compiler concert, but it was a lot of work. And it's daunting because compilers change and there's a lot of code and there are a lot of cases. But something that's a lot easier to do is to say, oh, well, let's just look at this exact program. Did the compiler do this right? And you can employ a technique called translation validation. And all it does is tries to prove that this program is equivalent to the code that was generated. And it doesn't care about any other part of the compiler. So we can take a similar kind of approach with LLMs. So rather than trying to prove that an LLM is correct, which I really think is very difficult, what we'll say is, okay, let's look at this thing that the LLM produced. Is that correct? And so that so the idea is to build a kind of safety box around LLMs to check their output, make sure they're and in the case of code, we know exactly how to do it with formal methods. But I think this is a general principle, because, as you said, LLMs are probabilistic, they're uncertain, we don't fully understand how they work inside. I think it's going to be very difficult to ensure that LLMs themselves are safe and correct. But we can ensure that the environment that the LLM is in ensures that safety and correctness. And so that's what I think is a promising approach towards AI safety. 

22. Guardrails for Agents: Checking Actions Before They Happen

Jing Conan Wang (1:13:58)

Yeah. So that's very insightful observation. And actually reminds me, like, even how the society works, like we have all these laws to ensure we have like, harmonious society to be, but we're not going to check the people's mind. It's almost impossible to check the mind. But check their behavior till they do bad things, if they didnt do bad things they consistently do good things. Then the system will reward them. If they do bad things there will be kind of like judges, there will be court, there will be jail for them. So kind of like you are building a whole infrastructure to enable in that. 

Clark Barrett : 

Yeah, I think that's actually a really good analogy. And in fact, I think we can do a little better than human society, because we can build a digital infrastructure that checks on actions before they happen, before instead of after. Right. It's not so great if the agent policeman comes in, and there's already a big mess and has to clean it up. It's better if the rules on agents actually enforce at all times that agents are following the law. And this is exactly what formal techniques can give you is guarantees about the gates and the interfaces and ensuring that every action complies with those rules. 

23. The World in Five Years

Jing Conan Wang (1:15:14)

Yeah, that's actually a great point. For agent, we actually have a better community. We have a way to check before the execution happens, so we can prevent the things before the bad thing happens. And I'm also curious because you have spent decades in the whole field of like doing the research and for verification also spend time in the industry to turn that into real world. And if you're looking at forward and fast forward like five years from now, what would be the world we're living? 

Clark Barrett : 

So I really believe that in five years, this universal capability of reasoning about code will become cheap and commonplace. And that means that every line of code that's written and and hopefully all the lines of code that are in legacy will have already been analyzed, checked, fixed, and will be in a world where that's just the standard and everyone says well of course, of course the code is checked like it would be foolish not to have code that's been checked in this world. 

Jing Conan Wang: 

Well said. And I think that's actually you mentioned a great point like a lot of the magic technology we have now take it for granted. It was all imaginable when we invented just like never imagine like now take it for when we have like a phone or the call anyone anytime five decades ago. It's harder like a hundred and then I think five years from now I can mention like why a program is not verified either from verification. Maybe that will be the question people are asked. 

Clark Barrett : 

Yes, I do believe that I really hope so. 

Jing Conan Wang: 

Yeah, wonderful. Thank you. Thank you very much for taking time to show you inside with us. And you are also starting the new journey of and  truth like is there any like Are you hiring are you looking for any additional..

Clark Barrett : 

We are. Yes, so you can go to our website andtruth.com. We have a way to contact the team or you can just send email to proof@andtruth.com.

Jing Conan Wang: 

Great honor to have you here and I'm very, very looking forward to leaving the future that you will have created. 

Clark Barrett : 

I hope so. Thank you. 

Jing Conan Wang: 

Thank you. Thank you very much.