Leanstral: Open-source agent for trustworthy coding and formal proof engineering
TL;DR Highlight
Leanstral, a 6B-active Lean 4 agent, beats Sonnet on FLTEval at a fraction of the cost
Who Should Read
Backend developers who find human review of AI coding agent output a bottleneck and want to automate verification
Core Mechanics
- Open-source agent for Lean 4
- Mistral released Leanstral with Apache 2.0 weights.
- It has 6B active parameters and is named Leanstral-120B-A6B.
- Lean 4 is a proof assistant that expresses math and software specs.
- Human review is the bottleneck
- Mistral says manual verification time and expertise limit engineering speed in high-stakes domains.
- Their vision is humans stating what they want while agents implement and prove against the spec.
- Cheaper than Sonnet, higher score
- On FLTEval, Leanstral pass@2 scores 26.3 at $36.
- Sonnet scores 23.7 at $549.
- At pass@16 Leanstral scores 31.9, 8 points above Sonnet.
- Opus leads in quality at 92x the cost
- Claude Opus 4.6 scores 39.6 and leads in quality.
- Its $1,650 cost is 92 times Leanstral's, per the post.
- Beats much larger open models
- GLM5 capped around 16.6 and Kimi-K2.5 around 20.1, and Leanstral beat both with one pass.
- Qwen3.5-397B-A17B needs 4 passes for 25.4, while Leanstral hits 26.3 at pass@2.
- Evaluated on real PRs
- Instead of isolated math problems, it was tested on completing proofs and defining new concepts in each FLT project PR.
- Mistral Vibe was used as the scaffold without modification.
- The FLTEval suite and a tech report are to be released.
Community Reactions
- Opus is worth 6x the cost, per one view
- A commenter noted the model is trained for this task yet scores well below Opus.
- If correctness is the goal, Opus cost is justified.
- Confusion over the comparison baseline
- Commenters questioned stressing savings versus Haiku when Haiku is weak at this task.
- Others noted Opus also scores modestly, so scaling up may beat it.
- Pushback on the "scales linearly" claim
- A commenter said the chart shows Qwen, Kimi, and GLM scaling linearly, not Leanstral.
- Experience with adoption hurdles
- One commenter said they couldn't convince developers to write property-based tests or use model checkers.
- They said a human must still check that the proof specifies the right thing.
How to Apply
- Try Leanstral in Mistral Vibe
- Run /leanstall in Vibe and press Shift+Tab to switch the model to Leanstral.
- Or launch with vibe --agent lean.
- Give it one proof from a Lean project.
- Measure cost per pass on the free API
- Run the same task at pass@1, 2 and 4 against labs-leanstral-2603.
- Check the score and cost curve on your own task.
- Attach executable specs to agent tasks
- Have the agent write tests or specs before the code.
- Verify results automatically by pass/fail to reduce human review.
Try It
# Paste into Claude or ChatGPT (simplified version of the Leanstral approach: spec first, implementation second)
You are a coding agent. Follow these steps.
1. For {{feature description}}, first write an executable spec (tests or properties).
2. Write an implementation that passes the spec.
3. Find 3 edge cases likely to fail, add them to the spec, and make it pass again.
4. List anything the spec leaves uncovered.
Language: {{language}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques