What makes an agent
Each agent is defined by four things:- Model — the AI model powering it (e.g.,
anthropic/claude-sonnet-4-0,openai/gpt-4o) - Instruction — the system prompt that shapes the agent’s behavior and personality
- Toolsets — capabilities like filesystem access, shell commands, web search, or MCP servers
- Sub-agents — other agents it can delegate tasks to (optional)
agents.yaml
The root agent
Every configuration has a root agent — the entry point that receives user messages. In a single-agent setup this is the only agent. In a multi-agent setup the root agent acts as a coordinator, delegating tasks to specialized sub-agents.The first agent defined in your YAML (or one explicitly named
root) is treated as the root agent. You can start a different agent with:Agent fields
Model reference — either an inline
provider/model-name string or the name of an entry in the top-level models map.Short description of what the agent does. Other agents use this to decide who to delegate tasks to.
System prompt that defines the agent’s behavior and persona.
List of tool configurations. Each entry is an object with at minimum a
type field. See Tools.Names of other agents this agent can delegate tasks to. Enabling this automatically provides the
transfer_task tool. See Multi-Agent.Fallback model configuration for automatic failover. See Model fallbacks below.
Maximum number of tool-calling loops before the agent stops. Defaults to unlimited.
Maximum number of tool calls the agent can make in a row without a model response.
When
true, injects the current date into the agent’s context at session start.When
true, injects OS, working directory, and git repository info into context.Message shown to the user when the agent session starts.
Named prompts callable as
/command-name in the TUI. See Named commands below.Enable skill discovery.
true loads skills from the local filesystem. Pass a list of URLs to also load remote skills.Lifecycle hooks that run shell commands before/after tool calls or at session start/end. See Hooks.
JSON schema for structured output responses. See Structured Output.
Model fallbacks
Agents can automatically fail over to alternative models when the primary is unavailable or rate-limited:agents.yaml
Ordered list of fallback models to try. Each can be an inline
provider/model string or a named model.Number of retries per model with exponential backoff. Only applies to retryable errors (5xx, timeouts). Use
-1 to disable retries.How long to stick with a successful fallback before retrying the primary. Uses Go duration format:
30s, 1m, 2m30s.Named commands
Define reusable prompts that can be invoked with/command-name in the TUI:
agents.yaml
${env.VARNAME}). Undefined variables expand to empty strings.
Default agent
Runningdocker agent run without a config file launches a built-in default agent — a capable general-purpose assistant requiring no setup:
Next steps
Models
Configure AI models and providers for your agents.
Tools
Give your agents capabilities with toolsets.
Multi-Agent
Build teams of collaborating agents.
Agent configuration reference
Full reference for all agent config fields.