File Format
AgentUse agents are markdown files with YAML frontmatter for configuration and plain English instructions.Frontmatter Reference
Required Fields
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 models
Optional Fields
Maximum execution time in seconds before the agent is terminated.
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.
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.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
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 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.OpenAI-specific options for GPT-5 and other OpenAI models.Supported Options:
reasoningEffort: Controls the computational effort for reasoning models ('low','medium','high')textVerbosity: Controls response length and detail ('low','medium','high')
These options are particularly useful with GPT-5 models to balance between response quality, speed, and cost.
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.Tools Configuration
Tools are available to agents through:- Built-in Tools - Filesystem and Bash 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 and bash tool permissions via thetools field:
Built-in Tools Reference
See full configuration options for filesystem and bash 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:'low','medium','high'textVerbositymust be one of:'low','medium','high'- No other options are allowed under
openai
