InitRunner

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 config

Identity Fields

FieldTypeDefaultDescription
namestr(required)Unique agent identifier
descriptionstr""Human-readable description
tagslist[str][]Categorization tags
authorstr""Author name
versionstr""Semantic version string
dependencieslist[str][]pip dependencies for custom tools
spec_versionint3Flat 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_MODEL env var, run.yaml from initrunner setup, API key env vars. You can include a partial model: block with only tuning fields (temperature, max_tokens) and the provider/name will be filled at runtime.

FieldTypeDefaultDescription
providerstrauto-detectProvider name (openai, anthropic, google, groq, mistral, ollama, cohere, bedrock, xai)
namestrauto-detectModel identifier
base_urlstr | nullnullCustom endpoint URL (enables OpenAI-compatible mode)
api_key_envstr | nullnullEnvironment variable containing the API key
temperaturefloat0.1Sampling temperature (0.0-2.0)
max_tokensint4096Maximum tokens per response (1-128000)

See Providers for provider-specific setup and Ollama/OpenRouter configuration.

Guardrails

FieldTypeDefaultDescription
max_tokens_per_runint50000Maximum output tokens consumed per agent run
max_tool_callsint20Maximum tool invocations per run
timeout_secondsint300Wall-clock timeout per run
max_request_limitint | nullautoMaximum LLM API round-trips per run. Auto-derived as max(max_tool_calls + 10, 30) when not set
input_tokens_limitint | nullnullCumulative input tokens for one logical run (including approval resume)
per_request_input_tokens_limitint | nullnullSingle-request context cap, including cached prefix tokens (since v2026.8.2)
cost_limitfloat | nullnullBest-effort USD cap per logical run (since v2026.8.2). Unpriced models skip enforcement.
total_tokens_limitint | nullnullCumulative input+output tokens for one logical run
session_token_budgetint | nullnullCumulative token budget for REPL session (warns at 80%)
daemon_token_budgetint | nullnullLifetime token budget for daemon process
daemon_daily_token_budgetint | nullnullDaily token budget for daemon (resets at UTC midnight)
daemon_daily_cost_budgetfloat | nullnullMaximum USD spend per calendar day (resets at UTC midnight)
daemon_weekly_cost_budgetfloat | nullnullMaximum 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

SectionDescriptionDocs
modelLLM provider, model settings, and fallback chainProviders
outputStructured output format (text or JSON schema)Structured Output
toolsTool configurations (filesystem, HTTP, MCP, custom, etc.)Tools
guardrailsToken limits, timeouts, tool call limitsGuardrails
executionRetries, end strategy, tool timeout, concurrency (v2026.4.17)Execution
deps_schema{{var}} template variables (v2026.4.17)Deps Schema
autonomyAutonomous plan-execute-adapt loopsAutonomy
ingestDocument ingestion and RAG pipelineIngestion
memorySession persistence and long-term memory (semantic, episodic, procedural)Memory
triggersCron, file watch, webhook, Telegram, and Discord triggersTriggers
observabilityOpenTelemetry tracing and span exportObservability
sinksOutput routing (webhook, file, custom)Sinks
skillsReusable capability bundlesSkills
securityContent policies, rate limiting, tool sandboxing, approvalsSecurity, Approvals
resourcesMemory and CPU limits for the agent process
tool_searchTool search meta-tool configurationTool Search

Output

Controls the response format of the agent.

FieldTypeDefaultDescription
typestr"text"Output format: "text" or "json_schema"
schemadict | nullnullInline JSON Schema (required when type is json_schema, mutually exclusive with schema_file)
schema_filestr | nullnullPath 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
FieldTypeDefaultDescription
retriesintPydanticAI defaultRetries for the main request. Maps to PydanticAI's Agent(retries=...).
output_retriesintPydanticAI defaultRetries 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_secondsfloat(none)Per-tool-call timeout in seconds.
max_concurrency.max_runningint(required when max_concurrency is set)Wires PydanticAI's ConcurrencyLimit(max_running=...) for per-agent backpressure.
max_concurrency.max_queuedint(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=Berlin

v1 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.

FieldTypeDefaultDescription
memorystr"512Mi"Memory limit (e.g. "512Mi", "1Gi")
cpufloat0.5CPU limit (fractional cores)

Configuration for the tool search meta-tool, which lets the agent discover tools at runtime.

FieldTypeDefaultDescription
enabledboolfalseEnable the tool search meta-tool
always_availablelist[str][]Tool types always loaded regardless of search
max_resultsint5Maximum tools returned per search (1-20)
thresholdfloat0.0Minimum similarity score to include a result (0.0-1.0)

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
GOOGLE_API_KEYGoogle AI API key
GROQ_API_KEYGroq API key
MISTRAL_API_KEYMistral API key
CO_API_KEYCohere API key
INITRUNNER_HOMEData 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

On this page