Configuration
InitRunner agents are configured through YAML role files. Every role follows the apiVersion/kind/metadata/spec structure.
Full Schema
apiVersion: initrunner/v1 # Required — API version
kind: Agent # Required — must be "Agent"
metadata:
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:
role: | # Required — system prompt
You are a helpful assistant.
model: # Optional — auto-detects when omitted
provider: openai # Provider name
name: gpt-4o-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: null # Security policy
skills: [] # Skill references
resources: {} # Memory and CPU limits
tool_search: {} # Tool search meta-tool configMetadata 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 |
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 | Per-request input token limit |
total_tokens_limit | int | null | null | Per-request combined input+output token limit |
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.
Spec 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) |
spec:
output:
type: json_schema
schema:
type: object
properties:
summary:
type: string
confidence:
type: number
required: [summary, confidence]Spec Execution
Since v2026.4.17, spec.execution captures agent-level execution semantics that are distinct from spec.guardrails budgets — guardrails cap resource usage across the whole run, spec.execution governs how a single PydanticAI agent step retries and composes.
spec:
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. |
spec.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.
Spec Deps Schema
Since v2026.4.17, spec.role (and imported PydanticAI instructions) can contain {{var}} placeholders. Declare the variables in spec.deps_schema as a flat-scalar JSON Schema and supply them at run time with --var:
spec:
role: "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 "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
apiVersion: initrunner/v1
kind: Agent
metadata:
name: support-agent
description: Answers questions from the support knowledge base
tags:
- support
- rag
spec:
role: |
You are a support agent. Use search_documents to find relevant
articles before answering. Always cite your sources.
model:
provider: openai
name: gpt-4o-mini
temperature: 0.1
max_tokens: 4096
ingest:
sources:
- "./knowledge-base/**/*.md"
- "./docs/**/*.pdf"
chunking:
strategy: fixed
chunk_size: 512
chunk_overlap: 50
tools:
- type: filesystem
root_path: ./src
read_only: true
- type: 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