88Z AI, 29 November — Mistral has put Managed Agents and the Agents SDK into public preview for long-running agents that can resume after a crash and stay under tool and approval control. Official docs cover creating a local project, adding a tool, and deploying with agents serve or agents deploy, including the documented limits.
At a glance
- Managed Agents and the Agents SDK are in public preview for long-running agents that can resume after a crash; official examples use mistral-large-4
- Create a local project with uvx --python 3.12 --from mistralai-agents agents init, then run or chat with uv run --env-file .env
- For production, use agents serve to self-host, or agents deploy after pushing a GitHub commit and with a Workflows-capable role
- Tools with side effects must be idempotent; default session limits are 24 hours total and 4 hours idle, and managed maxima differ from self-hosted
What it is, and how it differs from a single completion
Mistral's official account announced on 29 November 2026 that Managed Agents and the Agents SDK are in public preview. Official documentation states that the API, behavior, and limits can change during the preview, and that an update can require changes to your code. Managed Agents is for autonomous agents that can work for hours or days, pick up after a crash, run many sessions in parallel, and stay under your control over tools, environment, and approvals. Official docs distinguish this from a single Chat Completions request, which has no agent loop, and from Workflows, which use explicit steps, retries, and branching.
An agent, as the docs define it, is a model plus a harness. The model decides whether to answer or call a tool. The harness runs the loop: it calls the model, runs the tools the model picks, and records each step. A session records messages, tool calls, and results, grouped in turns. A turn runs from your message to the agent's answer; a message sent in the meantime joins that turn. An environment is an optional sandbox for shell commands and file edits; by default an agent has none. Official examples use the model id mistral-large-4.
Local quickstart
You need uv (the official init command runs through uvx) and permission to create a Mistral API key in your workspace. For a manual install, the docs require Python 3.12, 3.13, or 3.14, the standard build, not the free-threaded 3.14t build. The package name is mistralai-agents, imported in Python as from mistralai import agents. Documentation checked on 29 November 2026 shows pinning version 1.1.0, and uv run agents --version printing mistralai-agents 1.1.0. The CLI looks for a variable named agent in main.py by default.
Create a project with: uvx --python 3.12 --from mistralai-agents agents init hello-agent, then change into the hello-agent directory. That command writes pyproject.toml, .python-version, main.py, .gitignore, README.md, and Dockerfile, and locks dependencies in uv.lock. It then asks for an API key (it can open the API keys page in Mistral Studio, or accept a key you paste) and writes MISTRAL_API_KEY to .env. .gitignore is meant to keep .env out of git. Passing --yes skips the questions: it installs uv if needed, commits at once unless the folder is already inside another git repository, and leaves .env empty, so you must put the key there before you run the agent.
The generated main.py defines a get_weather tool that returns fixed text, not a live weather API, and an Agent with model mistral-large-4 and name hello-agent. The model uses the tool's name, docstring, and typed parameters. To send one message, the official docs add asyncio, call agent.run with a question about the weather in Paris, and print result.text. Run it with uv run --env-file .env python main.py. The CLI does not read .env by itself; use --env-file .env, or export MISTRAL_API_KEY in the shell. For a terminal chat, run uv run --env-file .env agents chat. Ctrl+C interrupts a turn; Ctrl+D or /exit ends the chat; pass -m to send one message and exit.
Add a tool and choose a run mode
To add a tool, decorate a sync or async function with @agents.tool, add it to the agent's tools list, and keep the existing tools. The official get_forecast example returns a list of fixed rainy-day strings for a city and a number of days; it is also a stub, not a live forecast. You can then run uv run --env-file .env agents chat -m with a question about rain in Paris over the next three days. The docs show the model filling both parameters, including days as an integer.
Session calls are the same in every run mode, including start_session, session.run, turn.result, turn.steer, turn.interrupt, and session.cancel. Local in-process mode uses agents.Agent in your code, or agents chat: tools run in your process, the session lives in memory by default and ends with the process, and tracing in Mistral Studio is off. That mode is for development and tests. Self-hosted mode is uv run --env-file .env agents serve: you run a long-lived worker on your machine or cluster, your tool code runs there, Mistral's control plane stores and routes sessions, Mistral still serves model calls, and tracing is on by default, including prompt and completion content. For Mistral-managed mode, push the project to GitHub and connect the GitHub connector in Mistral Studio, because agents deploy builds the commit you pushed, not an uncommitted working copy. The key's user also needs a workspace role with Workflows access, such as Developer or Workspace Contributor. Then run uv run --env-file .env agents deploy. Deploy refuses unpushed commits or a branch with no upstream. It uses the Agent's name, which --name can override; the name is unique per workspace, and a later deploy of the same name replaces that agent. After deploy you can run agents chat hello-agent, or Agent.load_from(agent_name="hello-agent"). Official guidance is to stay local while building, and to deploy when a session must outlive the program that started it. Use serve when tools must run next to your data or inside your network; use deploy when you do not want to keep a worker running.
For serve or deploy, the Agent must set name explicitly. A name that contains a dot, such as acme.bot, is reserved and raises agents.SdkError. If two people serve hello-agent in the same workspace, they share one agent, and a session can run on either process, so the docs recommend a per-person name while you build, for example agents serve --name hello-agent-ada. The first managed deploy may write a Dockerfile; in CI, pass --yes so it does not wait for a terminal. Later deploys build that Dockerfile as it is and do not rewrite it. The platform builds the pushed commit, so the Dockerfile, and for the generated file also pyproject.toml, uv.lock, and .python-version, must be in that commit. Do not copy .env into the image; official docs say a .env that lands in the image is readable by anyone who can pull it, so list .env in .dockerignore. An agent that acts on behalf of the user who starts a session, for example through connectors, is deployed hardened by default and accepts only a worker whose credential is authorized for it. Official docs say not to pass --no-hardened for such an agent. Hardening is fixed for the life of the deployment; shut down and deploy again to change it.
Durability, approvals, sandboxes, and limits
Once deployed, each finished model call and tool call is recorded, and the session can outlive the worker. If the worker stops mid-turn, the turn usually resumes from the last finished step when a worker is back; it can also fail, or stay Running until the time limit. A model call that was in flight is made again. A tool call that was running is not rerun by the SDK; about a minute later the model gets an error for it and may call the tool again. Tools with side effects, and hooks, must therefore be idempotent. Official docs recommend an idempotency key derived from the request, such as an order id for a refund. A plain check of whether the work was already done is not enough, because two overlapping calls can both pass it. Module globals and other worker memory are lost with the worker. For time, sleep, ids, and random numbers in replayed loop code, use agents.now(), agents.sleep(), agents.uuid4(), and agents.random().
By default, a deployed session ends after 24 hours in total, or after 4 hours idle when no turn is running or the turn is only waiting for you; you can raise both limits. Approval waits one hour by default, even while the app is closed. If nobody answers, the tool call does not run, the model is told it was not approved, and the turn continues. Self-hosted limits can be changed with AGENTS_SDK_IDLE_TIMEOUT_SECONDS and AGENTS_SDK_LIFETIME_LIMIT_SECONDS, in seconds, up to a year each per the serve docs. For Mistral-managed deploys, official deploy docs allow other limits via ENV in the Dockerfile, up to 24 hours idle and a week in total. Do not describe a managed deployment as raisable to a year.
Approvals can use a PermissionPolicy with a default and per-tool allow, ask, or deny rules. The official payment-reviewer example allows client.get_alert, asks before client.open_case, and denies by default. Tool IDs start with a namespace, client by default, such as client.open_case, not only the Python function name. The first matching rule wins. permission_mode can set one decision for every call: auto, the default, follows the policy or runs if there is none; ask requests approval; deny refuses the call. A permission_policy requires permission_mode to be auto. You can pass on_approval on start_session, session, or run, returning AllowApproval, DenyApproval, or KeepCallbackOpen, which leaves the decision to a person who answers by id with turn.answer. If a run returns Blocked, open approvals are in callbacks.
The default sandbox is NoSandbox, with no code execution. MistralSandbox is a Mistral-managed container. It needs mistralai-agents with the koyeb extra (agents init includes it), an API key, and the cloud_user workspace role, shown as Mistral Cloud User. An official example reports that sandbox as Python 3.12.15, and that the model used file_system.bash. LocalDockerSandbox runs a container on your machine and needs a Docker daemon and the docker package; the docs recommend it for tests and CI. BashkitSandbox is an in-process bash interpreter with weaker isolation; official docs say to use it only on trusted input, and it has no Python or git. DangerousLocalSandbox runs on your own machine with no isolation and requires ALLOW_DANGEROUS_LOCAL_HOST=1. Official docs say to start with MistralSandbox. Setting access to files keeps read, write, and edit, and removes bash. During public preview, treat the official documentation as authoritative. The weather tools in the docs return fixed placeholder text. This article does not include independent testing of Managed Agents, and it does not invent unpublished pricing or quotas.
Sources & editorial note
This article is an AI-assisted synthesis by 88Z AI based on the public sources below. Product claims and availability are attributed to their publishers. It does not represent independent testing or first-hand reporting.
- @MistralAISource published
Source dates above refer to the original announcements; the date under the headline is this article’s publication on 88Z AI.