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/).
- Create a Model (or reuse an existing Model ID from setup):
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- Create the root Agent in
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: []- Validate and run:
a13n-harness-ui config validate
cd /absolute/path/to/your-repository
a13n-harness-ui --agent agent-coderTo make it the default Agent, set defaults: {agent: agent-coder} in a13n-harness-ui.yaml.
Built-in subagents
Harness UI ships three built-in helpers configured in your root YAML (a13n-harness-ui.yaml):
| Name | Role |
|---|---|
explorer | Locate implementations and return file references |
code-reviewer | Review changes and report material defects |
executor | Complete a bounded task with a clear expected outcome |
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:
agent_creation:
allowed_models: [model-primary]
default_model: model-primary
subagents:
max_concurrent: 8
dynamic:
enabled: trueagent_creation.allowed_agentsanddefault_agentgovern which Agentscreate_threadandcreate_workermay use (and default to whenagent_idis omitted);agent_creation.allowed_modelsanddefault_modelgovern model selection forcreate_thread,create_worker,delegate, andspawn_subagent. Legacysubagents.dynamic.{allowed_models, default_model}entries are lifted intoagent_creationat load time (rejecting conflicts) and migrated automatically on WebUI save.- 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, andresume_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:
---
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:
subagents:
- markdown: subagent-investigatorReference 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):
subagents:
- agent: agent-specialistInstructions 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
| Field | Default | Purpose |
|---|---|---|
id, name | Required | Unique agent- ID and display name |
model | Required | Saved Model ID |
instructions | "" | Role prompt for the Agent |
capabilities | [] | Enabled Capabilities (dynamic_environment, web, skills, etc.) |
tools | null | Optional exact-name allowlist filtering visible tools |
subagents | [] | List of markdown: or agent: child entries |
mcp_servers, harness_plugins | null | Selected MCP server IDs (null inherits defaults) and plugin IDs |
tool_search | null | Optional grouped tool discovery plan |