Harnessing Code Agents for Automatic Software Verification
This paper demonstrates that wrapping a general-purpose LLM code agent in a soundness-enforcing verification harness, rather than constraining it with fixed human-designed strategies, enables fully automatic and complete formal verification of complex software systems, achieving 100% proof coverage on thousands of lemmas across Coq and Lean 4 without expert intervention.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to build a skyscraper, but the blueprints are written in a language so complex and strict that only a handful of experts in the world can read them. If you make even one tiny mistake in the math, the whole building could collapse. This is the world of formal software verification. It's the process of mathematically proving that computer code is bug-free.
For decades, this has been a bottleneck. While we can prove software is perfect, it takes human experts years of painstaking work to write the proofs. It's like hiring a team of architects to manually check every single brick in a city, one by one.
This paper introduces a new way to do this called Aria. Instead of trying to teach a computer how to think like a human architect (which has failed in the past), the authors gave a smart computer agent a "sandbox" and let it figure out the solution on its own.
Here is how it works, using simple analogies:
1. The Problem: The "Expert" Bottleneck
Think of formal verification like solving a massive, multi-step logic puzzle.
- The Old Way: You hire a human expert. They look at the puzzle, think for hours, and write down the solution.
- The Limitation: Experts are expensive and slow. They can only solve a few puzzles a day.
- The Failed AI Attempts: Previous attempts to use AI were like giving a robot a strict checklist. "Step 1: Look at this piece. Step 2: Try this move." The robot followed the rules but got stuck because the checklist was too rigid. It could only solve the easy puzzles.
2. The Solution: The "Code Agent" and the "Safety Harness"
The authors tried a different approach. They didn't give the AI a checklist. Instead, they gave it a general-purpose coding assistant (like a super-smart intern named "Claude Code") and a strict safety harness.
- The Agent (The Intern): You hand the AI the entire puzzle (the "lemma") and say, "Figure this out." The AI is free to try anything. It can look at the rules, try a move, fail, look at a different part of the code, or try a completely new strategy. It's not following a human's rigid plan; it's using its own judgment.
- The Harness (The Safety Inspector): This is the most important part. The AI is allowed to make mistakes, but it cannot sneak them past the system.
- If the AI writes a proof, the "Harness" runs it through a strict machine-checker (the "Coq kernel").
- If it's wrong: The machine says, "No. Step 4 is wrong. Here is exactly why."
- The Loop: The AI hears the feedback, fixes the mistake, and tries again. It can do this up to 30 times for a single puzzle.
- The Rule: The proof is only accepted if the machine-checker says "Yes, this is 100% correct." The AI cannot lie, and it cannot skip steps.
3. The Results: Solving the "Impossible" Puzzles
The authors tested this system on the hardest logic puzzles in the software world, specifically a library called Iris.
- The Challenge: Iris is used to verify complex, concurrent software (like operating systems and secure libraries). It's considered the "Mount Everest" of software verification.
- The Achievement: The AI, with no human help, solved 100% of the puzzles.
- It proved 4,257 complex lemmas in the core Iris library.
- It proved 217 lemmas for Rust's standard library (the safety rules for a popular programming language).
- It even solved 318 puzzles in a different library where previous AI systems had failed on 7 out of 8 attempts.
- It even worked on a different type of math system (Lean), proving it wasn't just a trick for one specific tool.
4. Why This Works (The "Secret Sauce")
The paper argues that the key wasn't making the AI smarter, but changing the relationship between the AI and the checker.
- Trust is Free: In many AI tasks, you have to worry if the AI is hallucinating (making things up). In this system, the "Safety Harness" acts as an infallible judge. If the AI says "I solved it," the judge checks it. If it's wrong, the judge rejects it. The AI can't bluff its way through.
- No Rigid Rules: By letting the AI choose its own strategy (instead of forcing it to follow a human's step-by-step plan), it could use its own "intuition" to find shortcuts and solutions that rigid systems missed.
5. The Polish
Sometimes the AI finds a solution that is correct but messy (like a math proof written in a confusing style). The system includes a "Polisher" agent that rewrites the messy proof into a clean, professional style, ensuring it looks like it was written by a human expert, while still passing the strict machine check.
Summary
The paper claims that by pairing a smart, free-thinking AI agent with a strict, unblinking safety harness, we can now automatically prove that complex software is bug-free. It's like hiring a brilliant, creative intern who is allowed to try any method to solve a problem, but is supervised by a robot that refuses to accept anything less than perfect. The result? The AI solved every single problem it was given, including the ones that humans say are too hard to automate.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.