Ground Truth.
AI, checked against the source.

News · 2026-08-10

Mistral patented letting the model write the tool call as code

Mistral AI holds a granted United States patent titled "Code implemented tool calls," covering an agent architecture in which a language model writes executable code that wraps its tool calls, rather than emitting a structured request for the harness to dispatch. The patent, US 12,670,045 B1, was filed on March 4, 2026 and granted on June 30, 2026, with 20 claims. It became one of the most argued-about AI stories of the day because the pattern it describes resembles how a growing number of coding agents already work.

Key facts

To see why this matters, it helps to know that agents call tools in two quite different ways. The older and more common way is structured function calling: the model outputs something like a form -- a tool name and its arguments -- and the surrounding program reads the form and makes the call. That is the pattern described in our lesson on tool use and function calling, and it is what most APIs expose.

The newer way is to let the model write a program. Instead of one form per call, the model emits a block of code that loops, branches, and calls several tools in sequence, and the harness runs that code. It is the difference between a shopper who asks the clerk for one item at a time and a shopper who hands over a written shopping list with conditional instructions on it. The second is dramatically more efficient when a task needs ten calls, because the model writes the plan once instead of being re-prompted ten times. It is also why the top repository on GitHub recently turned out to run its agent inside a Python shell.

Mistral's Claim 1 is more specific than either description, and the specificity is the whole legal story. It covers a server receiving a user request; a model generating a code block wrapping one or more tool calls; the server executing that code in a sandbox; the execution pausing when a pending tool call appears; the server shipping that pending call to a client for execution; receiving the result back; resuming the code block; substituting the returned value; and returning the final result. That is not "agents that write code." It is a particular distributed arrangement where execution straddles a server and a client, and pauses in the middle.

Whether it reads on existing systems depends on whether they really work that way. If a harness has the model write executable code, runs it in a sandbox, suspends at external calls, ships them across a process or network boundary, and resumes with substituted values, the claim starts to look uncomfortably close. If tool calls execute in the same place the code runs -- which is how many local coding agents work -- the round-trip element is missing. That is an inference from the claim language, not a legal opinion, and prior art arguments look plentiful: sandboxed read-eval-print loops, code interpreters, and serialize-and-resume harnesses all predate the March 2026 filing.

Mistral's own documentation is part of what makes the filing look deliberate rather than novel. Its agent tools documentation already lists a built-in code interpreter, and its human-in-the-loop cookbook documents a stateless, API-friendly flow where deferred tool calls are serialized, shipped across a boundary, and later reconstructed and resumed. The patent reads less like a description of a new user-facing feature and more like drawing a perimeter around mechanics the company already ships.

The tension is with positioning. Mistral's public identity rests on releasing open-weight models -- most recently a safety classifier that takes its policy as a question -- and "we give away the weights" sits awkwardly next to "we own the workflow." The honest caveat is that a granted patent is not an enforcement campaign. Companies file defensively all the time, and there is no public evidence Mistral has asserted this against anyone; no public Mistral statement about the patent could be found. Holding it and using it are different things, and most patents in this industry are held rather than used. But the filing exists, it is granted, and the pattern it targets is spreading fast enough that the question of what Mistral intends is now a reasonable one to ask out loud.


Primary source, verified: read the paper →

Key questions

Does this patent cover ordinary function calling?

No. Claim 1 requires the model to emit an executable code block that wraps the tool calls, plus sandboxed execution, pausing at pending calls, round-tripping them to a client, and resuming with substituted results. A plain loop where the model emits structured JSON and the harness dispatches it does not match that sequence.

When was it filed and granted?

The USPTO gazette entry shows application number 19/557,103 filed March 4, 2026, granted as US 12,670,045 B1 on June 30, 2026, with 20 claims and Gabriel Vergnaud listed as inventor.

Why is this awkward for Mistral specifically?

Mistral's public identity is built on releasing open-weight models, and a patent on a widely used agent design pattern sits uneasily beside that. The company had not issued a public statement about the patent as of this writing.
Cite this

APA

Ground Truth. (2026, August 10). Mistral patented letting the model write the tool call as code. Ground Truth. https://groundtruth.day/news/mistral-patented-letting-the-model-write-the-tool-call-as-code.html

BibTeX

@misc{groundtruth:mistral-patented-letting-the-model-write-the-tool-call-as-code,
  title  = {Mistral patented letting the model write the tool call as code},
  author = {{Ground Truth}},
  year   = {2026},
  month  = {aug},
  url    = {https://groundtruth.day/news/mistral-patented-letting-the-model-write-the-tool-call-as-code.html}
}

Topics: patents · agents · tool-use · mistral · open-weights · legal

Comments are replies to this story on Bluesky — reply with any Bluesky account to join in.