File Format
AgentUse agents are markdown files with YAML frontmatter for configuration and plain English instructions.Frontmatter Reference
Required Fields
string
required
AI model to use for the agent.Format: You can also specify a custom environment variable suffix:
provider:model-nameSupported providers:anthropic- Anthropic Claude modelsopenai- OpenAI GPT modelsopenrouter- OpenRouter modelsopencode-go- OpenCode Go open coding modelsbedrock- Amazon Bedrock (Claude, Llama, Mistral, Nova, etc.)
Optional Fields
number | string
Maximum execution time before the agent is terminated. A bare number means
seconds; a suffixed duration string (
"90s", "10m", "1h") also works.
Default: 300 (5 minutes)This prevents runaway agents and provides a safety ceiling for execution time.Precedence: CLI --timeout flag overrides this value.Choose a timeout appropriate for your agent’s expected workload. Simple tasks may complete in seconds, while complex multi-step workflows may need 10-30 minutes.
number
Maximum number of LLM generation steps (tool call cycles) the agent can take.
Default: 100This prevents infinite loops and controls cost by limiting the number of LLM calls.Precedence:
MAX_STEPS environment variable overrides this value.number
Maximum tokens the model may generate in a single response (the provider’s
max_tokens). This is a per-step ceiling, not a run-wide total.Leave it unset in almost all cases. When unset, first-class Anthropic models
default to their real output limit capped at 32,000, and other providers use
their own model-max default. Raise it only for an agent that must emit a large
single response or write a big file in one tool call; the value is clamped down
to the model’s real output limit when that limit is known.This exists because a model id newer than the underlying SDK’s model table
(e.g.
claude-sonnet-5) would otherwise be capped at a tiny 4096 max_tokens,
silently truncating normal-length outputs and tool-call arguments. A truncated
response ends the run, so AgentUse sets the cap from its own model registry
instead. Extended thinking (anthropic.thinking) computes its own ceiling and
takes precedence over this field.boolean
default:"true"
Tool-call intent phrases. When enabled (the default), every tool schema gains
an optional
intent parameter: one short phrase from the model stating what
each specific call is trying to achieve (for example, “Running runner tests to
verify the resume fix”). The CLI and the serve session view show the phrase as
the call’s activity label, and it is recorded in the session log; the real
tool never sees the parameter (it is stripped before dispatch).Set intent: false to keep tool schemas pristine, for example when a provider
or a third-party MCP server is sensitive to extra parameters, or to save the
few output tokens the phrase costs on every call.string
A brief description of what the agent does.This description is used in multiple contexts:
- As subagent tool description: When this agent is used as a subagent, this becomes the tool description that parent agents see
- CLI output: Displayed when running the agent to provide context
- Plugin events: Available to plugins for logging or monitoring
- Documentation: Self-documenting agents for teams
- Keep it concise (80-120 characters recommended)
- Be action-oriented (describe what the agent does, not what it is)
- Focus on the primary capability or purpose
string
Version identifier for the agent. For developer documentation only - not displayed or used at runtime.
string
Developer notes for setup instructions, requirements, or other documentation. Not displayed at runtime.
object
Free-form annotations for you and your tooling. The framework never
interprets these keys, it only preserves and surfaces them. This is the
sanctioned home for custom keys, which are otherwise stripped from
frontmatter.Metadata is shown by
agentuse agents: top-level keys render as chips after
the description (a true flag prints its bare key, a scalar prints
key=value, falsey flags are omitted), and the full object is available in
agentuse agents --json under .metadata for filtering.Metadata is an annotation, not runtime input: it is not injected into the
agent’s prompt.
object
Configuration for Model Context Protocol (MCP) servers that provide tools and resources to the agent.Each server is defined as a key-value pair where the key is the server name and the value is the server configuration.
array
Array of sub-agent configurations that this agent can delegate tasks to.Each sub-agent must specify a
path to the .agentuse file, with optional name and maxSteps parameters.Path Resolution: Subagent paths are resolved relative to the parent agent file’s directory, not the current working directory. This ensures portability and consistency.string | string[]
Declare agents whose output this agent consumes, usually through a shared
store. Paths resolve relative to the current agent file, using the same path
rules as
subagents.dependsOn is advisory metadata. AgentUse exposes the relationship through
the agents API and relationship graph, but it does not serialize runs or
delay schedules. Use compatible schedules or a manager agent when execution
order must be enforced.A single dependency can use the string shorthand:"none" | "minimal" | "low" | "medium" | "high" | "xhigh"
Provider-agnostic reasoning effort, the recommended knob. AgentUse passes it to
the AI SDK as the top-level Use
reasoning level, which each provider maps to its
own control: Anthropic to a thinking budget (a percentage of maxOutputTokens),
OpenAI to reasoningEffort. One setting that works across Claude and OpenAI.medium/high for genuine judgment (hard calls under competing
constraints, planning, debugging), low/minimal for lighter work, omit for
the model default, and none to force reasoning off. It is opt-in and bills
reasoning tokens at output rates.Prefer this over the provider-specific
openai.reasoningEffort /
anthropic.thinking.budgetTokens below, which are escape hatches for exact
control and are honored only when the top-level reasoning is unset.
Being top-level, it also avoids the “wrong-level key silently dropped” trap a
misplaced thinking: hits.object
OpenAI-specific options for GPT-5 and other OpenAI models.
reasoningEffort
here is the exact-control alternative to the top-level reasoning above.Supported Options:reasoningEffort: Controls thinking effort for reasoning models ('none','minimal','low','medium','high','xhigh')reasoningSummary: Requests a streamed natural-language summary of the model’s reasoning ('auto'or'detailed'), so the reasoning shows up inline in the session trace. Defaults to'auto'on reasoning-capable models (the reasoning tokens are billed either way, so the summary is near-free visibility). Non-reasoning models (e.g.gpt-4o) omit it.textVerbosity: Controls response length and detail ('low','medium','high')promptCacheKey: Optional OpenAI prompt-cache routing key. AgentUse sets a stable default per agent when omitted.promptCacheRetention: Optional OpenAI prompt-cache retention policy ('in_memory'or'24h')- Defaults: when
reasoningEffort,textVerbosity, orpromptCacheRetentionare omitted, AgentUse leaves them unset and uses the OpenAI/AI SDK defaults. WhenpromptCacheKeyis omitted, AgentUse generates a stable key per agent.reasoningSummarydefaults to'auto'on reasoning-capable models; set it explicitly (or to disable, you currently cannot turn it off via config without leaving a non-reasoning model).
These options are particularly useful with GPT-5 models to balance response quality, latency, and cost. Some effort levels are model-specific; for example,
xhigh and none are only accepted by OpenAI models that support them. Whether a reasoning summary actually streams depends on reasoningEffort and task complexity, the model may emit nothing for trivial tasks.object
Anthropic-specific options for Claude models.
thinking.budgetTokens is the
exact-budget alternative to the top-level reasoning above; use it only
when you need to pin an exact token budget.Supported Options:thinking.budgetTokens: Enables Claude extended thinking with the given token budget (minimum1024). When set, Claude streams its reasoning, which appears inline in the session trace. Honored only when the top-levelreasoningis unset.
"auto" | "trusted" | string[] | object
Controls which installed skills are available to the agent.Default: Trust only grants (the commands can run); gating is your explicit call. To require approval for a subset a skill grants (e.g. trust grants Inspect what trust granted with Per-skill entries accept only the
autoauto preserves the default behavior: all discovered skills are available for on-demand loading when relevant. A discovered skill is granted nothing until trusted (or its commands are listed in tools.bash.commands).Trusting a skill grants it the bash commands it declares in its SKILL.md allowed-tools. Trust per skill (recommended) or globally:birdc * but you want birdc reply * approved), add that pattern to tools.bash.gated; gated-wins precedence gates it while the rest of the family auto-runs. agentuse doctor flags granted commands that look irreversible.To preload a skill before the task starts without trusting it, define it explicitly (grant its commands yourself via tools.bash.commands):agentuse doctor <agent-file>.You can combine auto discovery with explicit preloads:trusted grant. To grant a command without
trusting the skill, list the command explicitly in tools.bash.commands.
The removed allow key is invalid.true | object
Run agent commands inside an isolated Docker container. Requires Docker to be installed and running. Use When enabled, the agent receives
sandbox: true for defaults or provide a config object.Fields (when using object form):provider: Must bedocker(required)image: Docker image to use (default:node:22-slim)timeout: Container timeout: bare number = seconds (default:300), or a duration string like"10m"setup: Shell command(s) to run after container startsenv: Host env var names to forward into the container
sandbox__exec for running commands in the container. File I/O uses the existing filesystem tool, each filesystem path is mounted at its real host path with per-path ro/rw mode derived from permissions.This feature is experimental. See the Sandbox guide for full documentation.
string
Schedule for automatic agent execution in serve mode. The format is auto-detected.Supported Formats:
- Interval:
5s,10m,2h(sub-daily) - Cron:
"0 * * * *","0 9 * * 1-5"(daily+)
Schedules only run when the agent is loaded via
agentuse serve. Use agentuse run for one-off executions.boolean | object
Add a human approval gate without putting approval instructions in the agent prompt.When Optional timeout:Fields:See Approval Gates for the full setup guide and Approval API examples.
approval is present, AgentUse automatically enables the internal await_human tool and injects the approval behavior for you. The markdown body should describe the work the agent needs to do; the YAML declares that the work must be reviewed before it is finalized.timeout: optional suspension timeout such as24hor7d. A bare number means seconds. Approvals do not expire by default.
summary, draft or artifact_url, context, and risk fields to the internal approval tool.You can define the approval boundary in the agent instructions. For example:array | object
Configure optional external collaboration channels separately from approval policy.Fields:
channels:[slack]enables Slack with default events and channel env fallback.channels.slack:trueor an object to enable Slack.channels.slack.enabled: optional switch for temporarily disabling Slack.channels.slack.events: event or list of events. Supported values areapproval,completion, andfailure. Usecompletion, notcompleteorcompleted.channels.slack.channel_id: Slack channel id. If omitted, AgentUse usesSLACK_APPROVAL_CHANNEL.
Tools Configuration
Tools are available to agents through:- Built-in Tools - Filesystem, Bash, and artifact tools with configurable permissions
- MCP Servers - Connect to any Model Context Protocol server
- Sub-Agents - Delegate tasks to other agents
Built-in Tools
Configure filesystem, bash, and artifact tools via thetools field:
tools.bash.gated lists commands that need human sign-off: they run only after an approval covering the exact action, and declaring gated enables the approval gate automatically. See Gated commands.
Built-in Tools Reference
See full configuration options for filesystem, bash, and artifact tools
MCP Servers
Stdio MCP Configuration
HTTP MCP Configuration
Multiple MCP Servers
The
mcpServers field uses a map format where each server has a name as the key.Sub-Agents
Sub-Agent Configuration
Remote Sub-Agents
Sub-agents can call the main agent or other sub-agents, enabling complex multi-agent workflows.
Environment Variables in MCP Configuration
Security by Design: AgentUse prevents hardcoding secrets in agent files. Use
requiredEnvVars and allowedEnvVars to control which environment variables are passed to MCP servers.Environment Variables - MCP Server Configuration
See the complete reference for security model, setting environment variables, error messages, and examples.
MCP Server Configuration Fields
Common Fields (All Server Types)
requiredEnvVars: Variables that MUST exist. Agent fails if missing.allowedEnvVars: Optional variables to pass through if they exist.disallowedTools: Tool names/patterns to exclude (supports wildcards).
Stdio Server Fields
command: Executable command (required). Relative paths resolve from agent file’s directory.args: Command-line arguments (optional)env: Additional environment variables (optional)
HTTP Server Fields
url: HTTPS URL of the MCP server (required)sessionId: Session identifier (optional)auth: Authentication config withtype: bearerandtoken(supports${env:VAR_NAME})headers: Custom HTTP headers (optional)
System Prompt Sections
Basic Structure
Using Context in Prompts
Direct variable interpolation in prompts is not currently supported. Context should be provided through conversation or MCP tools.
Conditional Sections
Special Syntax
Commands
Structured Output
Complete Example
Validation Rules
- File Extension: Agent files must use
.agentuseextension - Model: Must be a non-empty string (required field)
- MCP Server Configuration:
- Stdio servers: Must have
commandfield - HTTP servers: Must have
urlfield withhttp://orhttps://protocol - Cannot have both
commandandurlin the same server config
- Stdio servers: Must have
- Environment Variables:
requiredEnvVarsandallowedEnvVarsmust be arrays of strings- Use
${env:VAR_NAME}syntax to reference environment variables (e.g., inauth.token)
- Sub-agents:
- Must be an array of objects
- Each object must have a
pathfield (string) - Optional
name(string) andmaxSteps(number) fields
- Authentication: Only
bearertype is supported for HTTP MCP servers - Tool Restrictions:
disallowedToolsmust be an array of strings (supports wildcards) - OpenAI Options:
openaifield is only valid for OpenAI modelsreasoningEffortmust be one of:'none','minimal','low','medium','high','xhigh'textVerbositymust be one of:'low','medium','high'promptCacheKeymust be a non-empty string of 64 characters or fewerpromptCacheRetentionmust be one of:'in_memory','24h'- No other options are allowed under
openai
Next Steps
Sub-Agents
Learn about sub-agents
Environment Variables
Configure environment
Examples
See it in action