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

Every argument

ArgumentWhat it sets
modelThe model that decides each step. Required.
instructionsWhat the agent is for and how it works.
nameThe name agents serve and agents deploy register the agent under.
descriptionWhat the agent does, shown by agents info.
reasoning_effortHow much the model reasons before it answers.
temperatureThe model's sampling temperature.
max_iterationsThe most loop steps in one turn. A retry after a cut-off reply counts as a step.
toolsYour Python functions, which run within the session, and client tools, which are answered through a callback.
tool_errorsWhat the model reads when a tool raises.
connectorsMistral Studio connectors.
mcpsMCP servers.
skillsInstructions the agent loads when it needs them.
output_typeA Pydantic model for the final answer.
environmentThe sandbox where the agent runs commands and edits files.
secretsCredentials for its tools and environment.
guardrailsChecks that block a tool call your policy forbids.
hooksYour code at fixed points of a turn.
permission_modeWhether tool calls wait for an approval.
permission_policyWhich tool calls wait for an approval.
subagentsOther agents it can hand work to.
subagent_policyHow many child turns run at once, and how deep the tree grows.
builtinsWhich built-in features it turns off.
auto_compact_thresholdWhen older turns are summarized to free context.
first_output_timeout_secondsHow long a model call can stay silent before its first output.
redactionWhat tracing leaves out of the recorded spans.
providerThe provider that serves the model.
completionYour own completion config, in place of provider.

The Agent reference lists each argument's options and default.

Tools: let the agent call your Python functions.