Vero: the first repository-level benchmark for joint implementation and proof synthesis; the strongest agent solves only 27 of 43 instancesVero: Can AI Agents Build Formally Verified Software Repositories?
Vero uses 43 Lean 4 repositories to evaluate agents jointly generating implementations and proofs; the strongest configuration fully solves only 27/43.
- When programming agents generate code, tests and human review cannot rule out all edge-case defects covered by specifications. Existing verified-code benchmarks mostly evaluate single functions or only evaluate proofs on given implementations, and have not yet measured whether implementations and proofs can be done correctly together in multi-module repositories.
- 43 multi-module Lean 4 instances are curated from Dafny, Verus, Coq, and Python, with fixed interfaces and human-written specifications. Agents complete implementations and machine-checked proofs in either proof-only or code-and-proof. The audit accepts formal evidence of unsatisfiable specifications or incorrect reference implementations.
- Within 90 minutes across four configurations and two modes, GPT-5.5(xhigh) fully solved 27/43 in code-and-proof and 25/43 in proof-only. 10 instances were not fully solved under any of the eight configurations. On the hardest repository, no specifications were proved.
- The authors note that the benchmark currently targets only Lean 4, the corpus is biased toward code that can be cleanly translated into Lean, mainly excluding concurrency or timing protocols that are hard to port, and list incremental maintenance verification as future work. The audit only certifies formal satisfiability. Full solution does not guarantee properties not written in the specifications, such as complexity.
- Evaluated models
- GPT-5.5 (xhigh)GPT-5.5 (mid)Claude Opus 4.8Claude Sonnet 5
- Benchmarks
- Vero
- Metrics
- 完全求解实例数规格通过率
Researchers propose Vero, the first benchmark to evaluate the joint synthesis of implementations and formal proofs at the repository level, measuring whether AI agents can build machine-checked software. Vero contains 43 multi-module instances drawn from real repositories in Python, Dafny, Verus, and Coq, covering domains from cryptographic protocols to distributed systems; each instance consists of a Lean 4 multi-module repository with predetermined API interfaces, human-curated formal specifications, and reference implementations, supporting both proof-only and code-plus-proof evaluation modes. The benchmark also introduces an audit mechanism that allows agents to formally prove that a given specification is unsatisfiable or that the reference code is incorrect, thereby exposing and correcting potential code and specification errors during curation. Under frontier coding agent configurations with access to the Lean toolchain, the strongest agent fully solved only 27 of the 43 instances and failed to close any specification on the hardest repository. The authors open-sourced the benchmark, curation pipeline, and evaluation framework.
Paper analysis
What problem does this paper attempt to solve?
Repository-level implementation and proof must be generated together; existing benchmarks cover only single functions or only evaluate proofs.
Existing benchmarks have not measured whether agents can simultaneously generate implementations and machine-checked proofs in multi-module repositories.
- Scenario: The authors argue that the correctness of programming agents is typically ensured by unit tests and human review. These methods can catch expected failures but cannot rule out all boundary defects and security vulnerabilities covered by the specification; the authors state such problems are most damaging in protocol and infrastructure software. Formal verification uses machine-checked proofs to rule out, for all inputs, the class of defects characterized by the specification.
- Gap: The authors state that existing benchmarks either evaluate only single functions or evaluate only proofs on fixed implementations. Repository-level tasks cannot be solved by scaling up function-level techniques, because a proof may depend on underlying tool lemmas, and changing one implementation may invalidate proofs across the entire repository.
- Observation: The authors argue that agents must judge the consistency of the entire codebase rather than handling single functions locally. The authors also state that real verified software exists in repositories, from operating system kernels to cryptographic protocols and distributed systems.
- Proposal: The authors propose Vero, which to their knowledge is the first Lean 4 benchmark to evaluate joint implementation and proof generation at the repository level. It contains 43 multi-module instances, proof-only and code-and-proof modes, and a mechanism for auditing specifications and reference implementations with formal counterexamples.
What related research exists?
Related work is organized into function-level verification, proof-only repository benchmarks, mathematical theorem proving, and agent evaluation protocols.
Section 2 of the paper organizes existing benchmarks into four limitation categories and positions Vero accordingly.
Function-level verified code generation
- Lean 4 single problems: miniCodeProps, FVAPPS, VERINA, and CLEVER evaluate standalone tasks from algorithm problem sets like HumanEval, MBPP, and APPS.
- SMT verifiers: DafnyBench, VerusBench, AlgoVeri, VeriCoding, VerifyThisBench, and VeriEquivBench target Dafny or Verus, focusing on individual algorithms or methods.
- Paper's critique: The authors state these benchmarks drive progress on isolated tasks but do not capture the cross-module dependencies and long-range reasoning required by real verified codebases.
Repository-level, proof-only
- Verus and Lean: RVBench contains 755 proof-completion tasks across four Verus projects; VeruSAGE-Bench extracts 849 proof tasks from eight Verus-verified Rust systems; VeriSoftBench packages 500 Lean 4 proof obligations from open-source formal developments.
- Coq: CoqStoq provides a repository-level theorem corpus for proof synthesis; FSCQ is a case study in proof generation for verified system software.
- Paper's critique: The authors state these benchmarks all provide reference implementations and only evaluate whether proof obligations can be completed, thus omitting how implementation choices change proof difficulty and how both artifacts must remain consistent across the whole library.
Mathematical proofs and contamination
- Mathlib: LeanDojo, LeanAgent, and APE-Bench build on Mathlib. The authors state they advance neural theorem proving, but mathematical proof structure differs greatly from imperative software verification, which is coupled with executable definitions, data types, and effectful behavior.
- Pretraining exposure: The authors cite the concern that reference solutions from public program sources may enter pretraining data, and state that benchmarks directly reusing such sources inherit that exposure. Vero instead draws from multiple languages and manually creates new Lean 4 formalizations, so no instance has a directly available Lean 4 reference proof.
Evaluation protocols and benchmark errors
- Tool access: The authors state that most existing benchmarks evaluate raw LLM outputs under single or simple iterations, without the tool access used by deployed programming agents. Vero evaluates frontier programming agents with full tool access.
- Ground truth and cheating: The authors cite the problem that ground-truth errors in formal verification benchmarks are hard to distinguish from agent failures, and state that existing repository-level benchmarks lack anti-cheating, so reported results cannot distinguish verification ability from reward hacking. Vero uses machine-checked counterevidence for auditing and uses axiom whitelists and restricted definition edits to counter reward hacking.
Comparison objects: The experiments do not introduce another repository-level system as an external baseline, but compare four frontier programming agent configurations on Vero's two modes (Section 4). The authors state that, to their knowledge, Vero is the first benchmark to evaluate joint code and proof generation at the repository level, while retaining proof-only to compare with proof-only settings.
How does the paper address this problem?
Vero turns real repositories into Lean 4 projects with fixed interfaces, evaluates in two modes, and includes formal auditing.
Vero turns real repositories into multi-module Lean 4 projects with fixed interfaces and specifications, letting programming agents fill in implementations and machine-checked proofs under proof-only or code-and-proof, and audits benchmark defects with formal counterexamples.
Instance format
Curators fix data types and auxiliary definitions, API signatures, and formal specifications. An instance contains shared definitions, an API collection with its reference implementation, a structure RepoImpl aggregating all APIs, a specification collection of type RepoImpl → Prop, and canonical. proof-only fills canonical with the reference implementation; code-and-proof is filled by the agent. Specifications do not pin a single implementation, so proof objects can be switched and auditing is supported (Section 3.1, Figure 2). Agents must fill proof obligations marked sorry in both modes; code-and-proof also requires filling the function bodies of canonical.
Two modes and anti-cheating
- proof-only: prove Si(canonical) for each specification Si, where canonical is the reference implementation.
- code-and-proof: provide function bodies for each API and prove that the agent's own canonical satisfies all specifications. The authors state that implementations can be changed to be easier to prove, but such changes also invalidate cross-module proofs.
- Full solution: both modes require all specifications to be proved. The authors argue that unproved specifications leave defects they could have caught, and partial coverage can be inflated by easy specifications; in code-and-proof, an unproved specification may also indicate that the implementation violates the specification.
- Scoring: the scorer extracts only submissions within marked regions, overlays them on a clean copy, and compiles, thereby restoring modified specifications, auxiliary definitions, signatures, or deleted proof obligations. The axiom whitelist accepts only Classical.choice, propext, Quot.sound; dependencies on sorry are marked as unfilled, and other axioms are marked as leaks. Rules and LLM review further filter claims that make proofs trivial or separate logical semantics from executable behavior, including malicious typeclasses, and noncomputable choices with @[implemented_by]. Appendix D explains these mechanisms. The paper does not state which model the LLM review uses. The evaluation uses Lean v4.29.1.
Curation and corpus
The pipeline is executed in stages by LLM agents, with human approval at each stage. Track 1 translates existing types, definitions, and specifications from Dafny, Verus, and Coq; Track 2 translates Python implementations and writes specifications according to upstream documentation and tests, requiring each API to be constrained by multiple interrelated specifications. Stages include discover, select, plan, translate, with specification writing for Track 2, followed by structural, build, and semantic review. Selection considers real sources, domain, scale, and difficulty, as well as whether they can be faithfully translated into medium-sized Lean scaffolding.
Of the 43 instances, Track 1 has 13 and Track 2 has 30, totaling 743 scored APIs and 2,705 specifications. Table 1: Track 1 has per-instance API mean 36.0, max 88, specification mean 92.8, max 203, selected upstream effective lines of code mean 7,759, max 56,887; Track 2 correspondingly 9.2/71, 50.0/109, 793/4,047. Source line counts exclude blank lines and comments. Domains cover smart contracts and blockchain, distributed systems and consensus, security-related infrastructure, formal mathematics, data structures, algorithms, and numerical tools. The authors state there are no public Lean 4 reference proofs. Adding a new source language only requires a new agent skill; currently Python, Dafny, Verus, and Coq are covered.
Formal audit
The audit does not treat failure to prove as an agent failure directly, but accepts three types of machine-checked counterevidence: the reference implementation violates the conjunction of all specifications; some specification has no implementation satisfying it; some subset is jointly unsatisfiable, though each member can still be satisfied individually. During curation, this mechanism finds errors missed by human review and uses counterexamples to guide fixes. Appendix F: on the released set, 38 specification defects (9 instances) and 6 groups of joint unsatisfiability were adjudicated, all fixed; Section 4 evaluation uses the fixed benchmark. Of the 38 cases, 34 were based on clean proofs from agent submissions, 3 were reconstructed by the authors after axiom check failures, and 1 was an independently reproduced native evaluation. Appendix F also states that Claude Opus 4.8 found 33 cases, Codex found 30, and both found 25.
What experiments did the paper conduct?
GPT-5.5(xhigh) fully solves 27/43 in code-and-proof, with 10 instances unsolved under all eight configurations.
Experimental setup
- Configurations: Codex v0.140.0 with GPT-5.5, reasoning effort default medium (also called mid in the text) and xhigh; Claude Code v2.1.191 with Claude Opus 4.8 and Claude Sonnet 5, both xhigh. Agents can modify files, invoke builds, and use the Lean toolchain; Lean is v4.29.1.
- Data: Vero's 43 instances, 743 scored APIs, 2,705 specifications. Both modes are evaluated.
- Metrics: The main report is the number of fully solved instances. The authors use full solution rather than partial specification coverage because easy specifications inflate partial coverage, and in code-and-proof an unproved specification may indicate that the implementation violates it. They also analyze specification pass rates, failure reasons, and proof structure.
- Adjudication: An independent scorer rebuilds from a clean state and applies the axiom whitelist and anti-cheating filters. The LLM review model is not specified in the paper. Pass means machine-checked proof and not judged as cheating or axiom leakage.
- Scale: One final submission per configuration, mode, and instance, totaling 344 runs, with a time budget of 90 minutes (Figure 3). The paper does not report repetitions or sampling temperature. Table 2 in Appendix A gives total costs; Appendix E.4 states that 223 of the 344 units were terminated early due to wall-clock limits with no terminal usage records, and their costs are estimated using the median dollars/minute from measured runs.
Main results
According to Figure 3(a,b) and Section 4.2, the numbers of fully solved instances are:
Configuration code-and-proof proof-only GPT-5.5 (xhigh) 27/43 25/43 Claude Opus 4.8 (xhigh) 8/43 10/43 GPT-5.5 (mid) 2/43 6/43 Claude Sonnet 5 (xhigh) 2/43 2/43 - The authors state that Vero remains difficult for frontier configurations: 10 instances were not fully solved under any of the eight configurations across both modes. Figure 3(c) counts, by mode, the number of models that solved the same repository: code-and-proof has at least 3 with n=3, 2 with n=5, 1 with n=20, 0 with n=15; proof-only has n=3, 9, 15, 16. The authors state that most solved instances were solved by only one configuration.
- GPT-5.5 (xhigh) reached 25 and 23 full solutions within 45 minutes. The authors believe the bottleneck is not local proof skill: that configuration's specification pass rate is 87.3% for code-and-proof and 85.8% for proof-only; high specification coverage does not equal repository completion.
- The abstract states that the strongest agent proved no specifications on the hardest repository. In Table 4, dedekind_reals is 0/82 across all eight units.
Implementation freedom and proof effort
- Of 172 instance–agent pairings, 26 were fully solved in both modes, 13 only in code-and-proof, 17 only in proof-only, and 116 in neither (Figure 4(a)). After inspection, the authors state that in at least five pairings across three repositories, agents replaced hard-to-prove reference algorithms with simpler implementations still satisfying the same specifications; these five pairs proved all 250 specifications in code-and-proof, while only 201 were proved against the fixed reference implementation. The authors state that each replacement is behaviorally correct, not a shortcut, gaining provability and losing efficiency.
- The authors report that this effect is not symmetric across models: when fully solved in only one mode, xhigh has 8 in code-and-proof and 6 in proof-only, while weaker configurations more often solve only in proof-only (Appendix E.2). At the specification granularity, code-and-proof lets xhigh pass 42 more, mid 130 more, but makes Opus pass 360 fewer.
- In Figure 4(b–d), fully solved and unfinished runs have similar implementation line counts, proof text is about twice as large, and the proof/implementation ratio is higher. Median proof lines are 1,181 vs. 626 in code-and-proof and 1,320 vs. 562 in proof-only (n=39/133 and 43/129). Appendix G records 7/344 runs scoring 0 because the implementation failed to build. In Table 4, Opus's proof-only on Huffman is 116/127 and code-and-proof is 0/127; xhigh's unicode is 0/46 and 36/46, with the latter not separately explained in the text.
Failure locations and specification types
- Across 82 full solutions, auxiliary lemmas account for a median of 73.6% of proof lines in code-and-proof and 71.6% in proof-only (Figure 5(b)). 80/82 have at least one auxiliary lemma shared by two or more specifications, and 65/82 by at least five. The authors believe completed repositories revolve around a reusable lemma library rather than independent proofs per specification.
- Measuring auxiliary chain depth with xhigh's proof-only full solutions and then looking at the other seven runs (Figure 5(c)): without auxiliary lemmas, pass rates are 83.9% (3,086/3,676, code-and-proof) and 80.1% (2,209/2,757, proof-only); at depth at least 4, they are 50.6% (1,110/2,192) and 39.1% (643/1,644). The authors believe deep specifications require establishing chains of lemmas for lower-level definitions first.
- After balancing by repository, existence and coverage specifications have the highest failure rate at 47.1%, which the authors state remains highest under every sensitivity analysis; state-update specifications are 20.9% (Figure 8(a)). Structure and membership specifications appear 222 times across 262 unfinished evaluations (Figure 8(b)). Using a given helper or repeatedly calling the same scored API increases failure rates by 14.9 and 11.7 percentage points, higher across all eight configurations; referencing multiple APIs or another module is +5.0 and +0.3 percentage points (Figure 8(c)). The authors believe difficulty comes from unfolding given definitions and iterative behavior, not from crossing module boundaries. xhigh still fails at most a quarter of specifications on 35/43 and 34/43 repositories; of its 16 unfinished code-and-proof repositories, only 6 are within five specifications of completion, and 9 have more than ten remaining (Figure 7). The authors state that remaining failures are not close calls but a cluster of specifications sharing a few missing invariants.
Other ablations and analyses
- The text states that about a third of xhigh's remaining specifications fail at build time, and another 14% are judged as cheating; Opus and Sonnet have about 78% of remaining specifications with no proof body (Figure 7(b)).
- The union of all eight configurations fully solves 33 distinct instances, the same as the union of xhigh's two modes; the specification union is 2,486/2,705 (91.9%), with 219 never passing, all in those 10 unfinished instances (Appendix E.3).
- These 219 are: dedekind_reals 82, flocq 34, greenery 21, reedsolo 21, galoistools 18, ntheory 13, base58 11, verdict 7, unicode 6, piggybank 6 (Appendix E.3).
- On piggybank, all eight configurations pass 17/23 and fail the same 6; on verdict, Opus's code-and-proof is 112/119, with its 7 remaining failed by all eight configurations (Appendix E.1).
- Figure 6: each configuration reaches its final implementation size median in the first half of the run, while proof text grows until the cutoff. xhigh fixes a median 65-line implementation by minute 30, with proof text growing from 883 to 1,077 lines. The other three configurations' implementation medians are labeled 48, 49, 49, not individually matched in the text.
- Appendix D: 368 specification results are rejected at the axiom level, concentrated in base58 (67), verified_bitmasks (60), reedsolo (53), sortedcontainers (52).
What are some points that can be further explored?
The authors note it targets only Lean 4, lacks concurrency or temporal protocols, and auditing does not guarantee specification semantic correctness.
Limitations and future directions noted by the authors
- Lean 4 only: The Limitations state that only Lean 4 is targeted, because it is a particularly active ecosystem for LLM-based formal reasoning. Track 1 translates specifications and invariant structures from Dafny, Verus, and Coq; the pipeline can extend to other target languages (Section 3.3).
- Corpus biased toward easily translatable code: The authors state the corpus is biased toward code that cleanly translates into Lean; the main missing class is concurrency or timing protocols whose upstream formalizations cannot be ported to medium-scale Lean scaffolding (Limitations).
- Incremental maintenance: The authors call evaluating formal verification on incremental maintenance tasks a valuable future direction (Limitations).
- Audit boundaries: The authors state the audit certifies formal satisfiability, not semantic correctness or completeness of specifications; therefore all specifications are human-reviewed, and Track 1 also cross-checks against source-language formalizations (Limitations).
- Properties not in specifications: Appendix H.4 states that full solutions in code-and-proof certify only that the implementation satisfies the given specifications, not properties not mentioned; for data structure libraries, complexity is such a property that would be replaced. The authors state that formalization overhead requires a cost model not provided by source repositories, so they only record this gap.
Experimental coverage
- Evaluation configurations are GPT-5.5 (medium and xhigh) on Codex v0.140.0 and Claude Opus 4.8, Claude Sonnet 5 (both xhigh) on Claude Code v2.1.191, four in total, covering proof-only and code-and-proof (Section 4.1, Appendix A).
- 43 instances: Track 1 has 13, source languages Dafny, Verus, Coq; Track 2 has 30, source language Python (Section 3.4, Table 1). 743 scoring APIs, 2,705 specifications.
- One run per configuration, mode, and instance, totaling 344 runs, time budget 90 minutes, Lean v4.29.1 (Figure 3, Appendix E.4). The paper does not report the number of repetitions.
- Results include full solutions, specification pass rates, failure reasons, semantic types, and proof structure (Section 4, Figures 5–8). The LLM reviewer in anti-cheating is not specified in the paper (Section 3.2).
- Appendix F records that curation audit adjudicated and fixed 38 specification defects and 6 jointly unsatisfiable sets on the release set; Section 4 results are for the fixed benchmark.
Summarize the main content of the paper
Vero uses 43 Lean 4 repositories to evaluate joint implementation and proof; the strongest configuration solves 27, and 10 remain unsolved.
Vero evaluates whether programming agents can deliver both implementations and machine-checked proofs in real multi-module repositories.
- Problem: The authors argue that testing and human review cannot exclude all boundary defects covered by specifications, while existing benchmarks stop at single functions or only evaluate proofs on given implementations.
- Approach: They curate 43 Lean 4 instances from Dafny, Verus, Coq, and Python, with fixed interfaces and human-written specifications, totaling 743 scoring APIs and 2,705 specifications. proof-only only proves the reference implementation; code-and-proof writes its own implementation and proves it. Full solution requires all specifications to pass. Formal audit accepts machine-checked evidence that specifications are unsatisfiable or the reference implementation is wrong; anti-cheating restricts axioms, modifications outside marked regions, and declarations that separate proof goals from runtime behavior.
- Results: Within 90 minutes and four frontier configurations, GPT-5.5 (xhigh) achieves full solutions of 27/43 for code-and-proof and 25/43 for proof-only; Opus achieves 8/43 and 10/43, GPT-5.5 (mid) achieves 2/43 and 6/43, and Sonnet achieves 2/43 in both modes (Figure 3). 10 instances are not fully solved under any of the eight configurations. xhigh's specification pass rates are 87.3% and 85.8%, which the authors note do not equate to repository completion.
- Authors' interpretation: Unsolved instances concentrate on cross-module invariants, protocol consistency, and custom mathematical theories. Completed solutions place most proof lines in reusable lemmas. Implementation freedom lets agents switch to easier-to-prove algorithms but also causes them to break existing proofs or introduce build errors on harder instances. The authors see the gap as repository-level organization and hope Vero becomes a testbed for measuring progress toward practical-scale verified software synthesis.