Mistral AI US Patent 12,670,045: Code Implemented Tool Calls

Mistral AI has been granted US Patent 12,670,045, titled "Code implemented tool calls," which covers a method for executing tool calls encapsulated within code blocks generated by a Large Language Model (LLM). This patent represents a strategic move by the French AI lab to secure intellectual property rights in the US market, where software patents are more widely accepted than in the European Union.

Technical Mechanism of the Patent

The core of the patent describes a system where an LLM does not simply output a tool call, but instead generates a complete code block in a programming language that encapsulates one or more tool calls.

According to the primary claim, the process follows these steps:

  1. Request Reception: A server receives a user request for the execution of tool calls.
  2. Code Generation: An LLM generates a code block that encapsulates the required tool calls.
  3. Sandboxed Execution: The server executes this code block within a sandbox.
  4. Execution Pause: When the system encounters a pending tool call, it pauses the execution of the code block.
  5. Client Communication: The pending tool call is transmitted to a client for execution, and the resulting data is sent back to the server.
  6. Resumption: The server substitutes the tool call result into the code block and resumes execution.
  7. Final Output: The final result of the executed code block is returned to the LLM.

Advanced Implementation: Stateless Resumable Sandboxes

While the primary claim is broad, dependent claims suggest a more specific technical focus on a "stateless resumable sandbox." This implementation handles non-deterministic operations (such as random numbers or dates) by executing the code until such an operation is encountered, then replaying the code from the start while caching the results of previous non-deterministic operations to ensure consistency and efficiency.

Industry Reaction and Prior Art

The granting of this patent has sparked significant debate within the technical community, with many arguing that the described pattern is a fundamental software engineering practice rather than a novel invention.

Claims of Prior Art

Several community members have pointed to existing frameworks and research that implement similar "CodeAct" patterns:

  • CodeAct: A research paper (arXiv:2402.01030) describing LLMs interacting with computers via code.
  • LangGraph-CodeAct: A framework that reportedly shipped this capability in February, prior to the patent's March 4, 2026 filing date.
  • Cloudflare Code Mode: An earlier implementation of LLM-driven code execution.
  • Scala Community: Research into "tracked capabilities" and the tacit project, which explore similar agentic execution patterns.

Community Perspectives on Software Patents

Critics on Hacker News have characterized the patent as an attempt to create a "moat" or a tool for "lawfare," suggesting that the technical novelty is minimal.

"Is 'by an LLM' the new 'on a computer' for lame patents?"

Conversely, some analysts suggest the patent is a defensive business maneuver. Because Mistral is an open-weights company operating globally, holding US patents provides "defensive leverage, cross-licensing, and one more asset on the books to make it attractive to investors," regardless of whether the patent would hold up in a rigorous court challenge.

Summary of Patent Status

Contrary to initial assumptions that this was a pending application, the patent (US 12,670,045 B1) has been fully granted. It was filed on March 4, 2026, and granted in June 2026, indicating an accelerated examination process.

Sources

Related