Skip to content
Français

Configure an agent loop in YAML

Add a model provider and tools to your execution configuration.

Add a model provider and tools to your execution configuration. Keep the version-3 workspace and sandbox from the local tutorial; add the blocks below at the root.

Declare the harness directly on the coder role, with its model provider and file-reading and editing tools. Move a provider or harness under models or harnesses and reference it with $ref only when several roles share it.

agents:
  coder:
    harness:
      type: outpost
      modelProvider:
        type: openai
        api: responses
        baseUrl: https://api.openai.com/v1
        apiKey: { env: OPENAI_API_KEY }
      tools:
        - type: files
          selection: filesystem
        - type: edit
    model: your-model-name

Replace your-model-name with a supported model and set OPENAI_API_KEY on the host. This configuration uses API-key billing. See model providers for connection settings and the agent loop for permissions and budgets.

A format-3 recipe can select a response contract from outpost.yaml.

version: 3
name: structured-review
tasks:
  - key: review
    agent: coder
    brief: Inspect the workspace and summarize its files.
    dispatch:
      response: { $ref: responses.verdict }

Add the contract to outpost.yaml. Outpost validates the JSON response; optional repairs allows correction attempts.

responses:
  verdict:
    type: json
    tag: review
    jsonSchema:
      type: object
      properties:
        summary: { type: string }
      required: [summary]
      additionalProperties: false

Validate both files with outpost recipe validate --file recipe.yaml --config outpost.yaml. Then run the recipe and inspect the review task’s value.summary.