Configuring the agent
agents.Agent(...) takes the model that decides each step and the instructions it follows. This is the payment reviewer with the settings most agents use. Save it next to reviewer.py from that page: it imports the two tools.
from mistralai import agents
from reviewer import get_alert, open_case
payment_reviewer = agents.Agent(
model="mistral-large-4", # required
name="payment-reviewer", # agents serve and agents deploy register the agent under it
instructions="Review the alert. Collect the context. If the payment is suspicious, open a case file.",
tools=[get_alert, open_case], # your functions: see Tools
permission_mode="ask", # tool calls wait for an approval
reasoning_effort="high", # from "off" to "max"; the model's default otherwise
max_iterations=20, # the most loop steps in one turn; no limit by default
)Write the instructions as a brief to a new colleague: what the agent is for, which tool to use when, and what it must refuse or leave to a person. Describe what each tool does in its docstring, which the model reads with the tool, and keep the instructions for the job.
Set your own name before you serve or deploy; the default is "default_agent". A name is unique per workspace, so deploying payment-reviewer again replaces that agent.
The suspicious payment review example runs this agent end to end, with an analyst who approves each case file.
Every argument
| Argument | What it sets |
|---|---|
model | The model that decides each step. Required. |
instructions | What the agent is for and how it works. |
name | The name agents serve and agents deploy register the agent under. |
description | What the agent does, shown by agents info. |
reasoning_effort | How much the model reasons before it answers. |
temperature | The model's sampling temperature. |
max_iterations | The most loop steps in one turn. A retry after a cut-off reply counts as a step. |
tools | Your Python functions, which run within the session, and client tools, which are answered through a callback. |
tool_errors | What the model reads when a tool raises. |
connectors | Mistral Studio connectors. |
mcps | MCP servers. |
skills | Instructions the agent loads when it needs them. |
output_type | A Pydantic model for the final answer. |
environment | The sandbox where the agent runs commands and edits files. |
secrets | Credentials for its tools and environment. |
guardrails | Checks that block a tool call your policy forbids. |
hooks | Your code at fixed points of a turn. |
permission_mode | Whether tool calls wait for an approval. |
permission_policy | Which tool calls wait for an approval. |
subagents | Other agents it can hand work to. |
subagent_policy | How many child turns run at once, and how deep the tree grows. |
builtins | Which built-in features it turns off. |
auto_compact_threshold | When older turns are summarized to free context. |
first_output_timeout_seconds | How long a model call can stay silent before its first output. |
redaction | What tracing leaves out of the recorded spans. |
provider | The provider that serves the model. |
completion | Your own completion config, in place of provider. |
The Agent reference lists each argument's options and default.
Next
Tools: let the agent call your Python functions.