Introduction
Formal verification represents the pinnacle of software reliability, employing mathematical proofs to guarantee that code adheres to its specifications. In the context of the Rust programming language, tools like Verus allow developers to write verified systems code. However, the manual effort required to produce these proofs is immense, often demanding specialized expertise and significant time. While Large Language Models (LLMs) have shown promise in general code generation, their application to complex system-level formal verification has historically yielded poor results. This paper presents VeruSAGE, a comprehensive study and framework designed to evaluate and enhance LLM performance in this domain.
Methodology: Agentic Philosophies
The study investigates two primary agentic approaches to automated verification:
- Hands-On (VeruSAGE Framework): This specialized architecture "teaches" LLMs verification strategies through a structured workflow. A Planning Agent analyzes the target code and orchestrates 16 specialized Action Agents, each dedicated to specific proof techniques such as logical reasoning, bit-vector arithmetic, or quantifier instantiation.
- Hands-Off (CLI Agent): A more flexible approach where a generic coding agent is provided with the Verus toolchain and a "cheat checker" but is otherwise allowed to explore the proof space autonomously.
The evaluation compared state-of-the-art models including OpenAI’s o4-mini and GPT-5, alongside Anthropic’s Claude 3.5 Sonnet and Sonnet 4.5.
The VeruSAGE-Bench Dataset
To rigorously test these agents, the researchers curated VeruSAGE-Bench, a benchmark comprising 849 proof tasks extracted from eight prominent open-source Verus projects. These projects include OS kernels, key-value stores, and memory allocators. Unlike previous benchmarks like VerusBench, which focus on small algorithmic puzzles, VeruSAGE-Bench tasks average nearly 1,000 lines of code and rely heavily on complex specifications and inter-dependent helper lemmas.
Results and Key Insights
The study achieved a breakthrough 81% success rate using Claude 3.5 Sonnet 4.5 in the "Hands-Off" mode. This performance highlights a "Freedom Paradox": while smaller models like o4-mini benefit significantly from the structured VeruSAGE framework, the most capable models perform better when given more autonomy to apply their superior reasoning.
Key findings include:
- Lemma-Heavy Verification: Real-world system proofs depend 50 times more on identifying and applying helper lemmas than on writing loop invariants.
- Proof Verbosity: LLM-generated proofs are typically longer (median 24 lines) than human-written ones (median 9 lines), often including redundant assertions to ensure solver stability.
- Human-Level Utility: In a "blind" test on the Atmosphere project, the agents successfully completed 33 tasks that human experts had previously left unfinished.
Limitations and Future Work
Despite these successes, challenges remain. LLMs still struggle with discovering inductive invariants—the complex logical bridges required for state machine proofs. Additionally, heavy use of Rust procedural macros and deep abstractions can obscure the code from the LLM's view. Future research will focus on proof optimization to reduce redundancy and improving project-level reasoning to decompose high-level goals into manageable sub-tasks.
Conclusion
VeruSAGE demonstrates that with the right agentic strategy and state-of-the-art models, LLMs can effectively tackle real-world system verification. By solving 81% of complex tasks in minutes, these agents prove to be invaluable tools for developers striving for the highest levels of software assurance.
Summary updated