Agents and subagents

Define custom YAML Agents and lightweight Markdown subagent roles with tailored instructions, inherited or dedicated models, and filtered tool permissions.

An Agent (agents/*.yaml) pairs a Model with instructions, Capabilities, and optional subagents. Start with one root Agent, then add built-in, dynamic, or custom subagents when you want to delegate focused tasks.

Create an Agent from files

Run a13n-harness-ui config path to locate your config directory (normally ~/.a13n-harness-ui/).

  1. Create a Model (or reuse an existing Model ID from setup):
models/primary.yaml
schema_version: "1"
kind: model
id: model-primary
name: Primary API model
route: openai-responses:gpt-5
authentication:
  kind: api_key
  env: OPENAI_API_KEY
  1. Create the root Agent in agents/coder.yaml:
agents/coder.yaml
schema_version: "1"
kind: agent
id: agent-coder
name: Coding agent
model: model-primary
instructions: |
  Make focused changes. Read the relevant code first, validate the changed
  behavior, and report the result.
capabilities:
  - capability: dynamic_environment
    configuration:
      files_enabled: true
      shell_enabled: true
subagents: []
  1. Validate and run:
Terminal
a13n-harness-ui config validate
cd /absolute/path/to/your-repository
a13n-harness-ui --agent agent-coder

To make it the default Agent, set defaults: {agent: agent-coder} in a13n-harness-ui.yaml.

Set defaults for an external ACP Agent

In WebUI, open Settings → Agents, select the saved ACP Agent, and wait for its connection check. Under Default options, choose from the Agent's live catalog. Changing the model refreshes dependent options such as thinking levels. Choose Agent default to remove a setting, then save changes.

You can also edit default_options in the resource under acp_agents/. Use IDs and values reported by your Agent, for example:

YAML
default_options:
  mode: plan

The defaults seed new sessions in WebUI and the terminal, including sessions started for workers. Chat-specific choices take precedence, and previously prompted chats keep their saved choices. If the Agent no longer offers a default, a new session uses the peer's current value for that option.

Built-in subagents

Harness UI ships three built-in helpers configured in your root YAML (a13n-harness-ui.yaml):

NameRole
explorerLocate implementations and return file references
code-reviewerReview changes and report material defects
executorComplete a bounded task with a clear expected outcome
a13n-harness-ui.yaml
subagents:
  include: [explorer, code-reviewer]

Built-in helpers inherit the parent's Model, Capabilities, and visible tools. Inspect them with a13n-harness-ui config subagents. To attach a single built-in role to one Agent only, add - markdown: subagent-builtin-explorer to that Agent's subagents list.

Dynamic subagents and result delivery

Enable spawn_subagent so root conversations can create task-specific leaf helpers on demand using the current conversation’s Model:

a13n-harness-ui.yaml
subagents:
  dynamic:
    enabled: true
  • Declared and dynamic subagents can use the parent’s effective Model even when agent_creation.allowed_models is empty. Add Model IDs to allowed_models to make other Models available. To use a different Model when spawn_subagent omits model, set agent_creation.default_model to one of those IDs.
  • Use When to use on a Model or Agent to describe the work it suits. The parent sees this guidance when choosing a Model for a dynamic helper or delegating to a declared Agent.
  • Dynamic helpers inherit the parent's tools and Environment, start with a clean history, and report final results back automatically.
  • Agents manage running children with subagent_info, wait_subagent, steer_subagent, and resume_subagent.

Write a Markdown subagent

Use a Markdown file under subagents/ for a helper that shares its parent's Model and Capabilities but needs focused instructions or a restricted tool list:

subagents/investigator.md
---
name: investigator
description: Trace a bounded repository question and report evidence.
instruction: Use for focused read-only discovery before implementation.
tools: [glob, grep, ls, view]
---

Find the relevant implementation and tests. Return exact file paths and explain
how the pieces connect. Do not modify files.

Reference it in agents/coder.yaml:

YAML
subagents:
  - markdown: subagent-investigator

Reference an existing Agent as a subagent

When a subagent needs its own Model, Capabilities, or MCP servers, define it as a normal agents/*.yaml file and reference it by ID (its name and instructions come from that Agent file):

agents/coder.yaml
subagents:
  - agent: agent-specialist

Instructions and guidance

  • instructions: Defined on the Agent YAML.
  • Global AGENTS.md: Placed in your Harness UI config directory; injected into root and child conversations.
  • Project AGENTS.md: Discovered automatically from the active workspace root.

Tool search groups

When an Agent has many tools (such as large MCP servers), configure tool_search groups on the Agent to defer tool schemas until the Agent searches for them, reducing prompt token usage without changing tool permissions.

Agent file reference

FieldDefaultPurpose
id, nameRequiredUnique agent- ID and display name
modelRequiredSaved Model ID
instructions""Role prompt for the Agent
capabilities[]Enabled Capabilities (dynamic_environment, web, skills, etc.)
toolsnullOptional exact-name allowlist filtering visible tools
subagents[]List of markdown: or agent: child entries
mcp_servers, harness_pluginsnullSelected MCP server IDs (null inherits defaults) and plugin IDs
tool_searchnullOptional grouped tool discovery plan

On this page