Configuration
InitRunner agents are configured through flat YAML files. The file is the agent: a name, a prompt, the tools. There is no apiVersion / kind / metadata / spec wrapper.
Old envelopes still load. Convert them with initrunner doctor --fix PATH. See Envelope Migration. kind: Service and kind: TestSuite stay enveloped.
Full Schema
name: my-agent # Required — unique agent identifier
description: "" # Optional — human-readable description
tags: [] # Optional — categorization tags
author: "" # Optional — author name
version: "" # Optional — semantic version
dependencies: [] # Optional — pip dependencies
spec_version: 3 # Flat schema version
prompt: | # Required — system prompt
You are a helpful assistant.
model: # Optional — auto-detects when omitted
provider: openai # or shorthand: openai:gpt-5-mini
name: gpt-5-mini # Model identifier
temperature: 0.1 # Sampling temperature (0.0-2.0)
max_tokens: 4096 # Max tokens per response
base_url: null # Custom endpoint URL
api_key_env: null # Env var for API key
fallback: [] # Provider:model fallback chain (v2026.4.17)
output: {} # Structured output (text or json_schema)
tools: [] # Tool configurations
guardrails: {} # Resource limits
execution: {} # Retry, end-strategy, concurrency (v2026.4.17)
deps_schema: null # Template variables for {{var}} (v2026.4.17)
autonomy: {} # Autonomous plan-execute-adapt loop
observability: {} # OpenTelemetry tracing (opt-in)
ingest: null # Document ingestion / RAG
memory: null # Memory system
triggers: [] # Trigger configurations
sinks: [] # Output sink configurations
security: {} # Security policy
skills: [] # Skill references
resources: {} # Memory and CPU limits
tool_search: {} # Tool search meta-tool configIdentity Fields
| Field | Type | Default | Description |
|---|---|---|---|
name | str | (required) | Unique agent identifier |
description | str | "" | Human-readable description |
tags | list[str] | [] | Categorization tags |
author | str | "" | Author name |
version | str | "" | Semantic version string |
dependencies | list[str] | [] | pip dependencies for custom tools |
spec_version | int | 3 | Flat schema version. Written by initrunner new and doctor --fix. |
Model Configuration
Since v2026.3.5, the
model:section is optional. When omitted, provider and model auto-detect from (in priority order):INITRUNNER_MODELenv var,run.yamlfrominitrunner setup, API key env vars. You can include a partialmodel:block with only tuning fields (temperature,max_tokens) and the provider/name will be filled at runtime.
| Field | Type | Default | Description |
|---|---|---|---|
provider | str | auto-detect | Provider name (openai, anthropic, google, groq, mistral, ollama, cohere, bedrock, xai) |
name | str | auto-detect | Model identifier |
base_url | str | null | null | Custom endpoint URL (enables OpenAI-compatible mode) |
api_key_env | str | null | null | Environment variable containing the API key |
temperature | float | 0.1 | Sampling temperature (0.0-2.0) |
max_tokens | int | 4096 | Maximum tokens per response (1-128000) |
See Providers for provider-specific setup and Ollama/OpenRouter configuration.
Guardrails
| Field | Type | Default | Description |
|---|---|---|---|
max_tokens_per_run | int | 50000 | Maximum output tokens consumed per agent run |
max_tool_calls | int | 20 | Maximum tool invocations per run |
timeout_seconds | int | 300 | Wall-clock timeout per run |
max_request_limit | int | null | auto | Maximum LLM API round-trips per run. Auto-derived as max(max_tool_calls + 10, 30) when not set |
input_tokens_limit | int | null | null | Cumulative input tokens for one logical run (including approval resume) |
per_request_input_tokens_limit | int | null | null | Single-request context cap, including cached prefix tokens (since v2026.8.2) |
cost_limit | float | null | null | Best-effort USD cap per logical run (since v2026.8.2). Unpriced models skip enforcement. |
total_tokens_limit | int | null | null | Cumulative input+output tokens for one logical run |
session_token_budget | int | null | null | Cumulative token budget for REPL session (warns at 80%) |
daemon_token_budget | int | null | null | Lifetime token budget for daemon process |
daemon_daily_token_budget | int | null | null | Daily token budget for daemon (resets at UTC midnight) |
daemon_daily_cost_budget | float | null | null | Maximum USD spend per calendar day (resets at UTC midnight) |
daemon_weekly_cost_budget | float | null | null | Maximum USD spend per ISO week |
See Guardrails for enforcement behavior, daemon budgets, and autonomous limits. See Cost Tracking for CLI analytics and the dashboard cost page.
Sections Overview
| Section | Description | Docs |
|---|---|---|
model | LLM provider, model settings, and fallback chain | Providers |
output | Structured output format (text or JSON schema) | Structured Output |
tools | Tool configurations (filesystem, HTTP, MCP, custom, etc.) | Tools |
guardrails | Token limits, timeouts, tool call limits | Guardrails |
execution | Retries, end strategy, tool timeout, concurrency (v2026.4.17) | Execution |
deps_schema | {{var}} template variables (v2026.4.17) | Deps Schema |
autonomy | Autonomous plan-execute-adapt loops | Autonomy |
ingest | Document ingestion and RAG pipeline | Ingestion |
memory | Session persistence and long-term memory (semantic, episodic, procedural) | Memory |
triggers | Cron, file watch, webhook, Telegram, and Discord triggers | Triggers |
observability | OpenTelemetry tracing and span export | Observability |
sinks | Output routing (webhook, file, custom) | Sinks |
skills | Reusable capability bundles | Skills |
security | Content policies, rate limiting, tool sandboxing, approvals | Security, Approvals |
resources | Memory and CPU limits for the agent process | — |
tool_search | Tool search meta-tool configuration | Tool Search |
Output
Controls the response format of the agent.
| Field | Type | Default | Description |
|---|---|---|---|
type | str | "text" | Output format: "text" or "json_schema" |
schema | dict | null | null | Inline JSON Schema (required when type is json_schema, mutually exclusive with schema_file) |
schema_file | str | null | null | Path to a JSON Schema file (mutually exclusive with schema) |
output:
type: json_schema
schema:
type: object
properties:
summary:
type: string
confidence:
type: number
required: [summary, confidence]Execution
Since v2026.4.17, execution captures agent-level execution semantics that are distinct from guardrails budgets — guardrails cap resource usage across the whole run, execution governs how a single PydanticAI agent step retries and composes.
execution:
retries: 3
output_retries: 2
end_strategy: graceful
tool_timeout_seconds: 15.0
max_concurrency:
max_running: 4
max_queued: 8| Field | Type | Default | Description |
|---|---|---|---|
retries | int | PydanticAI default | Retries for the main request. Maps to PydanticAI's Agent(retries=...). |
output_retries | int | PydanticAI default | Retries for structured-output validation failures. |
end_strategy | "early" | "graceful" | "exhaustive" | "graceful" | How the agent handles tool calls the model requests alongside a final output. graceful (default) runs the function-tool calls that precede an output tool, then takes the first successful output. early stops at the first successful output and skips those function tools. exhaustive runs every tool and takes the first valid output. |
tool_timeout_seconds | float | (none) | Per-tool-call timeout in seconds. |
max_concurrency.max_running | int | (required when max_concurrency is set) | Wires PydanticAI's ConcurrencyLimit(max_running=...) for per-agent backpressure. |
max_concurrency.max_queued | int | (none) | Optional queued-call ceiling. |
execution fields round-trip through Agent Spec import/export.
Since v2026.6.7, end_strategy defaults to graceful (previously early), matching PydanticAI v2. A role with no explicit end_strategy now also runs the function-tool calls the model requested alongside a successful output, instead of stopping at the first output. Set end_strategy: early to restore the previous behavior.
Deps Schema
Since v2026.4.17, prompt (and imported PydanticAI instructions) can contain {{var}} placeholders. Declare the variables in deps_schema as a flat-scalar JSON Schema and supply them at run time with --var:
prompt: "You are greeting {{name}} from {{city}}."
deps_schema:
type: object
properties:
name: {type: string}
city: {type: string}
required: [name, city]initrunner run greeter/role.yaml -p "be polite" --var name=Alice --var city=Berlinv1 scope. deps_schema is enforced as a flat-scalar object. Allowed property types are string, integer, number, boolean. Nested objects, arrays, $ref, and oneOf raise RoleLoadError. The --var flag applies to CLI initrunner run. Since v2026.6.5, daemon, trigger, bot, and flow runs resolve declared variables from INITRUNNER_VAR_<NAME> environment variables, where <NAME> is the uppercased property name from deps_schema (so name reads INITRUNNER_VAR_NAME and city reads INITRUNNER_VAR_CITY). CLI --var still takes precedence over the environment.
Rendering happens through a dynamic system-prompt hook — the raw {{...}} never reaches the model. Missing required variables raise at run time; undeclared variables raise at load time.
See Agent Spec Import for the import path and the full PydanticAI field mapping.
Resources
Memory and CPU limits for the agent process.
| Field | Type | Default | Description |
|---|---|---|---|
memory | str | "512Mi" | Memory limit (e.g. "512Mi", "1Gi") |
cpu | float | 0.5 | CPU limit (fractional cores) |
Tool Search
Configuration for the tool search meta-tool, which lets the agent discover tools at runtime.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable the tool search meta-tool |
always_available | list[str] | [] | Tool types always loaded regardless of search |
max_results | int | 5 | Maximum tools returned per search (1-20) |
threshold | float | 0.0 | Minimum similarity score to include a result (0.0-1.0) |
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
ANTHROPIC_API_KEY | Anthropic API key |
GOOGLE_API_KEY | Google AI API key |
GROQ_API_KEY | Groq API key |
MISTRAL_API_KEY | Mistral API key |
CO_API_KEY | Cohere API key |
INITRUNNER_HOME | Data directory (default: ~/.initrunner/) |
Resolution order for INITRUNNER_HOME: INITRUNNER_HOME > XDG_DATA_HOME/initrunner > ~/.initrunner.
Full Annotated Example
name: support-agent
description: Answers questions from the support knowledge base
tags:
- support
- rag
model:
provider: openai
name: gpt-5-mini
temperature: 0.1
max_tokens: 4096
prompt: |
You are a support agent. Use search_documents to find relevant
articles before answering. Always cite your sources.
ingest:
sources:
- "./knowledge-base/**/*.md"
- "./docs/**/*.pdf"
chunking:
strategy: fixed
chunk_size: 512
chunk_overlap: 50
tools:
- filesystem:
root_path: ./src
read_only: true
- mcp:
transport: stdio
command: npx
args: ["-y", "@anthropic/mcp-server-filesystem"]
triggers:
- type: file_watch
paths: ["./knowledge-base"]
extensions: [".html", ".md"]
prompt_template: "Knowledge base updated: {path}. Re-index."
- type: cron
schedule: "0 9 * * 1"
prompt: "Generate weekly support coverage report."
guardrails:
max_tokens_per_run: 50000
max_tool_calls: 20
timeout_seconds: 300