Mistral Quietly Patented the Way Your Agent Calls Tools
TL;DR
Mistral holds US Patent 12,670,045, "Code implemented tool calls": filed March 4, 2026, granted June 30, 2026, and discovered by Hacker News only this morning. Claim 1 covers an LLM writing a code block that wraps tool calls, a server running that block in a sandbox, and execution pausing to ship each tool call to the client before resuming with the result. That is the code-mode pattern the agent ecosystem has spent two years converging on. And because the patent issued as a B1, with no pre-grant publication, the first time anyone outside the patent office could read it, it was already enforceable.
What Mistral actually claims
The patent names a single inventor, Gabriel Vergnaud, and assigns to Mistral AI in Paris. It is a method claim, and the USPTO's Official Gazette entry prints claim 1 in full:
"A method, comprising: receiving, at a server, a user request for execution of one or more tool calls; generating, by a large language model (LLM), a code block in a programming language, the code block configured to encapsulate the one or more tool calls; executing, by the server, the code block in a sandbox; in response to obtaining a pending tool call, pausing execution of the code block; transmitting the pending tool call to a client for execution; receiving, from the client, a first result of the pending tool call; resuming execution of the code block and substituting the first result of the pending tool call for the pending tool call in the code block; and returning a second result of the executed code block to the LLM."
In plain terms: instead of the model requesting tools one JSON blob at a time, it writes a script that orchestrates all of them, and the server runs that script. When the script hits a tool it cannot execute locally, the sandbox freezes, sends that one call out to your client, waits for the answer, splices it in, and keeps going. Picture a chef cooking from a written recipe who freezes mid-chop whenever an ingredient is missing while a runner fetches it from your pantry, then resumes exactly where the knife stopped.
The pause is the part to check your own stack against. The claim is not "LLM writes code that calls tools" in the abstract; it requires the sandbox to halt on each pending call, dispatch it to a client for execution, and resume with the substituted result. That specific round trip is the patent's fingerprint.
You have shipped this already
Code-as-actions is one of the oldest ideas in the agent playbook. The CodeAct paper made the case in February 2024 that letting agents act through executable Python beats JSON tool calls by up to 20 percent on success rate, and Hugging Face's smolagents built an entire library around it, describing itself as agents that think in code.
The productionized versions came next. Cloudflare's Code Mode, published September 26, 2025, converts MCP tools into a TypeScript API and has the agent write code against it inside an isolate sandbox. Anthropic's programmatic tool calling goes further and matches the claim beat for beat: per its own docs, when the generated code invokes one of your tools, "code execution pauses and the API returns a tool_use block," your client executes it and sends the result back, and the paused container resumes. That is claim 1's loop, running in production, documented in the API reference of Mistral's largest competitor.
Hacker News found the Gazette entry this morning and put it on the front page, roughly a hundred points and ninety-plus comments in a couple of hours, most of them a rolling prior-art bibliography. Mistral has said nothing. There is something tidy about an EU company patenting, in the US, a technique that is essentially unpatentable as such at home.
Four months, and nobody saw it coming
March 4 to June 30 is under four months from filing to issued patent. For scale: US utility applications normally do not even become public until the 18-month publication mark, and pendency is usually measured in years. A grant this fast is what the USPTO's paid prioritized-examination lane exists for; the file wrapper will say for certain, and nobody had pulled it as of this writing.
The B1 kind code matters more than it looks. It means the application was never published before grant, so there was no window for anyone to see it coming, let alone submit the Cloudflare post or the CodeAct paper as third-party prior art. The ecosystem's favorite design pattern acquired a landlord in complete silence, six weeks before the tenants checked the deed.
Before you panic-refactor your agent
- Infringement needs every element. Server sandbox, the pause, the dispatch to a client, the resume: drop any one and claim 1 does not read. Server-side bindings that execute tools without a client round trip, or CodeAct-style agents that run everything in one environment, are missing limbs of the claim.
- We have seen one claim. The Gazette prints claim 1 only; the full claim set and any priority chain live in an image-only PDF this post has not mapped. If the patent claims priority to an earlier application, the prior-art timeline above shifts.
- Dates are the battleground. The CodeAct paper and Cloudflare's post predate the filing by two years and five months respectively, but neither spells out the exact pause-and-dispatch-to-client loop. Anthropic's docs do, and whether that flow was public before March 4, 2026 is the first question any challenger would litigate.
- A patent is not a lawsuit. Frontier labs stockpile patents as cross-licensing leverage and defense; there is no sign Mistral intends to enforce this one, and no statement from the company.
- This is reporting, not legal advice. If your product runs this loop commercially, read claim 1 against your architecture with someone who bills by the hour.
Key Takeaways
- Mistral holds US Patent 12,670,045, "Code implemented tool calls," filed March 4, 2026, granted June 30, 2026, and first noticed publicly on August 10 via Hacker News.
- Claim 1 covers LLM-generated code blocks running in a server sandbox that pause to dispatch each tool call to the client, then resume with the result.
- The pattern has abundant public prior art: the CodeAct paper (February 2024), smolagents, Cloudflare's Code Mode (September 2025), and Anthropic's documented programmatic tool calling.
- The patent issued as a B1 with no pre-grant publication after under four months of pendency, so no third-party prior-art submissions were possible.
- The claim is narrower than the outrage: pure server-side code execution without the client round trip may not infringe.
- Mistral has not commented, and nothing suggests enforcement yet; the immediate consequence is a prior-art fight waiting for a challenger.
Sources: USPTO Official Gazette, US 12,670,045, Hacker News, Cloudflare, "Code Mode", Wang et al., "Executable Code Actions Elicit Better LLM Agents" (arXiv), Anthropic, Programmatic tool calling docs, Hugging Face smolagents