Skip to main content

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: provider:model-nameSupported providers:
  • anthropic - Anthropic Claude models
  • openai - OpenAI GPT models
  • openrouter - OpenRouter models
  • opencode-go - OpenCode Go open coding models
  • bedrock - Amazon Bedrock (Claude, Llama, Mistral, Nova, etc.)
You can also specify a custom environment variable suffix:

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.
Each step typically involves an LLM call. Higher values increase potential cost if the agent gets stuck in a loop.
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
Best practices:
  • 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 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.
Use 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, or promptCacheRetention are omitted, AgentUse leaves them unset and uses the OpenAI/AI SDK defaults. When promptCacheKey is omitted, AgentUse generates a stable key per agent. reasoningSummary defaults 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 (minimum 1024). When set, Claude streams its reasoning, which appears inline in the session trace. Honored only when the top-level reasoning is unset.
Extended thinking is off by default and is an explicit opt-in: enabling it generates new thinking tokens billed at output rates (a real cost increase that scales with the budget). AgentUse automatically raises max_tokens above the budget to satisfy Anthropic’s constraint and reserve room for the answer.
"auto" | "trusted" | string[] | object
Controls which installed skills are available to the agent.Default: auto
auto 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:
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 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):
Inspect what trust granted with agentuse doctor <agent-file>.You can combine auto discovery with explicit preloads:
Per-skill entries accept only the trusted grant. To grant a command without trusting the skill, list the command explicitly in tools.bash.commands. The removed allow key is invalid.
Run agentuse doctor <agent-file> to inspect skill grants. Doctor can show commands mentioned in the skill docs, but the output is advisory and not a permission manifest. Add --last-run to inspect the latest recorded session and diagnose actual blocked commands from runtime.
true | object
Run agent commands inside an isolated Docker container. Requires Docker to be installed and running. Use sandbox: true for defaults or provide a config object.Fields (when using object form):
  • provider: Must be docker (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 starts
  • env: Host env var names to forward into the container
When enabled, the agent receives 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 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.
Optional timeout:
Fields:
  • timeout: optional suspension timeout such as 24h or 7d. A bare number means seconds. Approvals do not expire by default.
Approval requests render best when the agent can provide 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:
See Approval Gates for the full setup guide and Approval API examples.
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: true or an object to enable Slack.
  • channels.slack.enabled: optional switch for temporarily disabling Slack.
  • channels.slack.events: event or list of events. Supported values are approval, completion, and failure. Use completion, not complete or completed.
  • channels.slack.channel_id: Slack channel id. If omitted, AgentUse uses SLACK_APPROVAL_CHANNEL.
See Channels for event semantics, Slack setup, and examples.

Tools Configuration

Tools are available to agents through:
  1. Built-in Tools - Filesystem, Bash, and artifact tools with configurable permissions
  2. MCP Servers - Connect to any Model Context Protocol server
  3. Sub-Agents - Delegate tasks to other agents

Built-in Tools

Configure filesystem, bash, and artifact tools via the tools 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 with type: bearer and token (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

  1. File Extension: Agent files must use .agentuse extension
  2. Model: Must be a non-empty string (required field)
  3. MCP Server Configuration:
    • Stdio servers: Must have command field
    • HTTP servers: Must have url field with http:// or https:// protocol
    • Cannot have both command and url in the same server config
  4. Environment Variables:
    • requiredEnvVars and allowedEnvVars must be arrays of strings
    • Use ${env:VAR_NAME} syntax to reference environment variables (e.g., in auth.token)
  5. Sub-agents:
    • Must be an array of objects
    • Each object must have a path field (string)
    • Optional name (string) and maxSteps (number) fields
  6. Authentication: Only bearer type is supported for HTTP MCP servers
  7. Tool Restrictions: disallowedTools must be an array of strings (supports wildcards)
  8. OpenAI Options:
    • openai field is only valid for OpenAI models
    • reasoningEffort must be one of: 'none', 'minimal', 'low', 'medium', 'high', 'xhigh'
    • textVerbosity must be one of: 'low', 'medium', 'high'
    • promptCacheKey must be a non-empty string of 64 characters or fewer
    • promptCacheRetention must 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