InitRunner

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 config

Metadata 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

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 | nullnullPer-request input token limit
total_tokens_limitint | nullnullPer-request combined input+output token limit
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.

Spec 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)
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: exhaustive
    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" | "exhaustive"PydanticAI defaultHow the agent decides when it's done. exhaustive lets the model keep refining; early stops as soon as it can.
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.

spec.execution fields round-trip through Agent Spec import/export.

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=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 is wired into single-shot initrunner run only; interactive, autonomous, and daemon modes do not thread variables yet.

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

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

On this page