Fighting Code Slop: How Formal Verification and Lean Are Reshaping AI Development
AI startups are pairing frontier models with formal verification tools like Lean and cvc5 to eliminate code slop and deliver mathematically proven software correctness.

As artificial intelligence generates an unprecedented volume of software, the technology industry is grappling with the proliferation of "slop"—low-quality, unreliable code produced by large language models. While development teams typically combat errors by running standard test suites, prompting agents to critique their own work, or using secondary models to review outputs, these empirical checks cannot confirm that every hidden defect has been caught. To address this limitation, an emerging wave of companies is adopting formal verification, using mathematical logic and proof assistants to guarantee that software behaves exactly as intended.
How formal verification goes beyond traditional testing
Unlike traditional testing, which simply checks if code passes selected inputs, formal verification evaluates code against precise mathematical specifications. Clark Barrett, co-founder and co-CEO of &Truth and Corbel Professor (Research) of Computer Science at Stanford, highlights the core difference between standard debugging and formal methods: testing tools can surface numerous issues, but developers never know when they are truly done or whether critical edge cases remain undetected.
Barrett previously co-created cvc5, a satisfiability modulo theories (SMT) solver widely used to automate mathematical reasoning. Such automated engines have already proven viable at massive industrial scale. For example, Amazon calls cvc5 billions of times daily within its production pipelines, deploying it for specification analysis and test generation inside Kiro, its agentic development environment. By substituting heuristic guesswork with rigorous constraint solving, formal verification establishes definitive mathematical guarantees.
Lean and the ecosystem of automated theorem provers
Much of the current push toward verified code is centered on Lean, an open-source programming language and proof assistant. Frontier AI models are increasingly being tested against complex mathematical challenges within Lean. Anthropic recently applied Lean to formalize the 13-million-line proof of Fermat’s Last Theorem, while GPT-6.2 Astra generated what researcher Vals identified as the first Lean proof of Smoktunowicz’s Gap Theorem.
A growing cohort of startups is building automated reasoning pipelines around these capabilities:
- &Truth is developing a "verification machine" on top of Lean designed to parse programs across different languages and verify compliance with precise requirements. Its initial release, &Atlas, maps the world's open-source code starting with C to identify memory safety flaws.
- Harmonic offers Aristotle, an automated theorem prover where AI models construct proofs that Lean checks at every individual step, ensuring the validity of results does not depend on model accuracy alone.
- Axiom Math, led by CEO Carina Hong, created AxiomProver to generate Lean proofs alongside AXLE, a specialized toolkit for manipulating and evaluating them. Axiom uses verification to provide continuous correctness feedback during model training, viewing verified AI as a vehicle for super-intelligence.
- Theorem is applying formal verification to cybersecurity, operating on the premise that formal guarantees provide a defense that holds even as automated adversaries scale.
Crucially, this mathematical verification is becoming more token-efficient. Anthropic reported that Opus 5.5 achieved a 50 percent solve rate across 36 small verification tasks using approximately 40 percent fewer tokens than Opus 5, demonstrating that LLM-scaled formal verification is becoming increasingly practical.
What it means for developers
The integration of formal verification signals a major shift in how engineers collaborate with AI agents. Rather than relying on "vibe-coding"—where developers accept generated code after superficial observation—teams are expected to move toward "veri-coding." Under this workflow, human developers spend less time manually writing or reviewing syntax and more time defining and refining exact specifications. Autonomous agents then collaborate with formal verification tools under the hood, delivering code that mathematically meets those specifications on the first attempt.
As Cognition developer relations lead Nader Dabit noted regarding the rise of "outcome engineering," engineers managing autonomous agents need reliable ways to validate what those agents deliver. Whether using Lean, cvc5, or Rocq, verification systems shift the focus toward defining unambiguous outcomes. For engineers seeking to build, test, and benchmark agentic workflows across different frontier models, platforms like Apixo (https://apixoai.online) provide cheap pay-per-token API access to models like Claude, GPT, Gemini, and DeepSeek through a single key.
As verification engines continue to scale, software engineering may gradually transition from endless cycles of testing and patching toward systems that offer machine-checked mathematical certainty.
Source: The War Against Slop and an Emerging Weapon to Fight it: Formal Verification — Latent Space. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

