AI News
AI News AgentModel releaseMistral4 min read

Mistral launches Leanstral to verify code with AI

Mistral has launched Leanstral, an open-source coding agent that generates programs and formally checks whether they meet specifications using Lean 4. It is available in Mistral Vibe, through an API and for download under the Apache 2.0 license, with a focus on reducing the cost of reviewing AI-generated code.

Mistral has launched Leanstral, an open-source coding agent that does more than write programs: it also attempts to formally prove that they follow specific rules. The goal is to reduce one of the biggest limitations of AI-assisted software development: the time a person must spend reviewing every result.

From generated code to verifiable proofs

Most coding assistants generate code and explain why they think it works. Leanstral adds a stricter layer: it works with Lean 4, a tool that can automatically check mathematical statements and software specifications.

In practice, you can ask it to complete a proof, translate a program from another language or verify that a function behaves as expected. If the proof does not fit Lean's rules, the system cannot accept it as valid. That does not eliminate every error, but it avoids relying solely on a convincing explanation from the model.

Mistral presents Leanstral as the first open-source coding agent designed specifically for Lean 4 and for working in realistic formal repositories, not just isolated mathematical problems. The model uses a sparse architecture with 6 billion active parameters, which reduces the cost of each response even though its evaluation version is identified as Leanstral-120B-A6B.

What it offers and how much it costs

Leanstral is available in several forms:

  • Its weights are released under the Apache 2.0 license, which allows you to study, modify and run them with few restrictions.
  • It is integrated into Mistral Vibe, Mistral's coding environment. You activate it with the /leanstall command.
  • You can also try it through the labs-leanstral-2603 endpoint, which Mistral describes as free or nearly free for a limited period.
  • It is compatible with MCP, a standard for connecting AI agents to external tools and sources. The company trained it specifically with lean-lsp-mcp, which is used to interact with Lean projects.

Having direct access matters most for teams that do not want to send sensitive code to an external service. They can download the model and run it on their own infrastructure, although this requires sufficient hardware and technical expertise.

Performance according to Mistral's tests

The company evaluated Leanstral with FLTEval, a test focused on proof-engineering tasks. Instead of measuring only whether it can solve a mathematical exercise, the test analyzes whether it can complete proofs and define concepts in each change to a repository from the FLT project.

In that comparison, Leanstral scored 26.3 with two attempts, compared with 23.7 for Claude Sonnet 4.6. Mistral estimates that those two attempts cost $36, compared with $549 for Sonnet. With 16 attempts, Leanstral reached 31.9 points at an estimated cost of $290.

Claude Opus 4.6 achieved the highest score, 39.6, but at an estimated cost of $1,650. Among the open-source models compared, Leanstral reached 29.3 points with four attempts, ahead of Qwen3.5, which reached 25.4 with four passes.

These figures were provided by Mistral and depend on the number of attempts, the model used and the evaluation environment. They do not mean that Leanstral is better at every programming task.

What you can use it for

The clearest use case is in projects where a flaw is not easily detected with a conventional test: mathematical libraries, compilers, critical systems or software that must follow formal rules.

In one demonstration, Leanstral analyzed a problem caused by a change in Lean 4.29.0. It identified that a rigid definition prevented a tactic from finding a pattern and recommended replacing def with abbrev, a more transparent alias. In another test, it converted a small programming language originally written in Rocq into Lean and proved a property about a program that adds two units to a variable.

For everyday development, this does not automatically turn every application into secure software. Leanstral needs clear specifications and works best when the project already has a formal structure. But it changes how you use an agent: instead of asking it only to write code, you can ask it to write code and provide a proof that another system can check.

Mistral's bet points to a future in which AI generates implementations together with verifiable evidence. The next thing to watch is whether these agents can maintain that reliability in large, changing projects, not just in controlled demonstrations.

Mistral launches Leanstral to verify code with AI | neversleep.ai