Learning resourcesReviewed · Mistral AI

Mistral Agents Callbacks Guide

Mistral’s Callbacks guide teaches Python developers to handle AI agent approvals, tool results and sign-ins, but it assumes a working agent setup. It explains automatic handlers, answering unresolved callbacks by ID, and the different behavior of turn.result() and iter_events().

Researched 15 Nov 2026

In short.

Mistral’s Callbacks guide is a practical reference for developers building interactive AI agent apps, but it leaves installation and SDK version compatibility unspecified. It explains how agent turns pause for approvals, client tool results and sign-ins, and how programs or people can answer them. Its most useful distinction is that automatic handlers answer during run() or turn.result(), while iter_events() only observes events. Runtime behavior has not been independently verified.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete documentation page at [https://docs.mistral.ai/studio/agents/learn/runs/callbacks.md], including its examples, displayed outputs, timeout note and troubleshooting. Linked pages about approvals, connectors, session apps, subagents and API references are excluded. The page supplies no license notice or publication date. No code, API calls, device lookup, sign-in flow or multi-process interaction was executed; runtime behavior and production suitability remain unverified.

The overview

Identity

Callbacks is a Mistral Agents documentation guide covering questions that pause an agent turn until an answer arrives. Its scope is approvals, client tool calls and connector or MCP sign-ins, demonstrated through the mistralai.agents Python API.

Assessment

The guide is useful when an agent application must ask permission, obtain information from client-side code, or request an account connection. It connects these needs to concrete handlers, callback classes and event loops, including explanations of common failures.

It is a focused integration guide. Account setup, installation, deployment and production reliability are not established by this page.

Users

The main audience is Python developers adding interactive controls to Mistral agent applications. Beginners need familiarity with async/await, functions and typed data models to follow the examples.

Experienced developers get details relevant to event-driven interfaces, callbacks answered by another process, and handlers that also answer a session’s subagent callbacks.

Capabilities

Approval callbacks accept AllowApproval or DenyApproval. Client tool callbacks accept the tool’s result. Sign-in callbacks accept SignInAnswer with connected and denied request IDs.

Approval and client-tool handlers can return KeepCallbackOpen to defer a decision. Unanswered callbacks appear in Blocked.callbacks. Applications can display CallbackOpened events and remove pending controls when CallbackResolved arrives.

Using it

Requirements

The examples use Python, asyncio, typing.Literal, Pydantic BaseModel and mistralai.agents. The sample agent names mistral-large-4, registers a client tool and includes the Gmail connector made available through Mistral Studio.

Exact Python and SDK versions, installation commands, credential configuration and account entitlements are unspecified. The demonstrated location provider returns fixed data; obtaining an actual device location requires an application-specific implementation.

Mechanism

A callback pauses a turn until an answer arrives. Functions supplied through on_approval, on_client_tool and on_sign_in answer while run() or turn.result() waits. If a callback remains unanswered, the waiting operation returns Blocked.

For manual handling, match the open callback’s class and call turn.answer(callback.id, answer), then resume waiting with turn.result(after=state). The page says a deployed agent’s callback can also be answered from another process.

iter_events() only reads events and does not activate the session’s automatic handlers. It ends at TurnEnded. CallbackResolved indicates that a callback closed, which can follow an answer, turn termination or timeout.

Setup

Define a typed client tool and a function that supplies its result. Configure an Agent with the tool, connector and permission policy. The example policy allows calls by default but asks before client.get_location.

Attach handlers to run(), start_session() or session(id). For a session interface that combines automatic answers with event display, send_message() starts the turn and turn.result(on_event=...) waits while forwarding events.

For manual interaction, watch CallbackOpened through iter_events() and answer each callback by ID when the person or external process decides.

Example

The sample asks for the user’s location and latest email. Its approval handler allows tools carrying read_only_hint, its client-tool implementation returns Lyon, France, and its sign-in handler denies every Gmail connection request.

The displayed responses therefore provide the fixed location and explain that email access was unavailable. The example does not demonstrate a live device lookup, a successful Gmail sign-in or mailbox retrieval. The shown outputs are documentation examples, not independent test results.

Assessment & evidence

Limitations

Approvals and client tool calls wait one hour for an answer by default. The page does not establish a sign-in timeout or explain how to configure the approval timeout; it links elsewhere for that detail.

turn.answer() raises SdkError when an answer has the wrong callback type, a client-tool result violates its return type, or a sign-in answer fails to account for every requested source. The page says nothing is sent in these cases.

The sample approval decision relies on the tool’s read_only_hint declaration. That metadata does not itself establish what an implementation actually does. Retries, concurrent answering, restart recovery and production performance are not assessed.

Choosing an interaction pattern

Use functions when the program has enough information to decide or supply a result. Leave callbacks open when a person or another process must decide, then answer them by ID. This division lets one turn combine automated handling with human decisions.

A Blocked state signals an unresolved interaction rather than necessarily an application failure. Likewise, a CallbackResolved event alone does not prove that the requested operation succeeded, because termination and timeout can also close callbacks.

Alternatives

The guide presents three implementation choices: run() with handlers, a session app using turn.result(on_event=...) with handlers, and manual event consumption using iter_events() plus answers by ID. The first suits program-driven handling; the latter two support interfaces that display pending decisions.

No competing vendor SDKs or agent frameworks are described. Equivalent features, migration effort and comparative costs are unknown.

Evidence

The evidence is the complete Callbacks documentation page at [https://docs.mistral.ai/studio/agents/learn/runs/callbacks.md]. It contains explanatory text, Python examples, displayed outputs and troubleshooting guidance.

The captured source revision is sha256:534ddb29ce9e9e2e79cac4e3b702bafa186e1fe62650a4939cd2f61059334297. Its examples support an explanation of the documented API, but do not establish independently observed runtime behavior, benchmarks or production reliability.

Access & freshness

Costs

The page provides no model prices, API charges, connector fees, free allowances or hosting costs. It also does not explain billing while a turn waits for a callback. Implementation and operating costs remain unknown.

Rights

The page contains no license notice establishing reuse or redistribution rights for its documentation and example code. Those permissions remain unknown. Service terms, connector permissions and data-handling terms are also absent from the supplied page.

Freshness

The page was captured on 2026-11-15 at 09:01:47.895 UTC. It supplies no publication date, last-update date or SDK package version, so the capture date does not establish when the documented behavior was introduced.

The example names mistral-large-4, but its current availability and compatibility with a particular installed SDK version are not independently established.

Next steps

Confirm that your SDK supports the named APIs and complete the account and connector setup required by your application. Replace the fixed location result with a real provider, and choose approval rules that reflect the actual tool behavior.

Choose the waiting method deliberately: turn.result(on_event=...) for automatic handlers with event display, or iter_events() with explicit answers. In your environment, verify allow and deny decisions, deferred callbacks, invalid result types, sign-in outcomes and timeout handling.

Establish applicable pricing and reuse permissions before committing to deployment or redistributing the examples.

Evidence for this report

selected-page.txtselected · checked 2026-11-15