Expand description
Delegated Agent System
Provides a system for delegating specialized tasks to focused child agents. Each delegated child run uses an isolated child session with restricted permissions.
§Architecture
Parent Session
└── Task Tool
├── AgentRegistry (lookup agent definitions)
└── Child Session (isolated execution)
├── Restricted permissions
├── Optional model override
└── Event forwarding to parent§Built-in Agents
explore: Fast codebase exploration (read-only)general: Multi-step task executionplan: Read-only planning modeverification: Adversarial verification specialistreview: Code review specialist
§Loading Agents from Files
Agents can be loaded from YAML or Markdown files:
§YAML Format
name: my-agent
description: Custom agent for specific tasks
hidden: false
max_steps: 30
permissions:
allow:
- read
- grep
deny:
- write
prompt: |
You are a specialized agent...§Markdown Format
---
name: my-agent
description: Custom agent
max_steps: 30
---
# System Prompt
You are a specialized agent...Structs§
- Agent
Definition - Agent definition
- Agent
Registry - Agent registry for managing agent definitions
- Model
Config - Model configuration for agent.
- Worker
Agent Spec - Reproducible recipe for a disposable worker/subagent.
Enums§
- Confirmation
Inheritance - How a child run resolves tools that require confirmation (PermissionDecision::Ask).
- Worker
Agent Kind - Cattle-style worker agent role.
Functions§
- builtin_
agents - Create built-in agent definitions
- load_
agents_ from_ dir - Load all agent definitions from a directory
- parse_
agent_ md - Parse an agent definition from Markdown with YAML frontmatter
- parse_
agent_ yaml - Parse an agent definition from YAML content.
Type Aliases§
- Cattle
Agent Kind - Backward-friendly alias for callers that name this pattern cattle mode.
- Cattle
Agent Spec - Backward-friendly alias for callers that name this pattern cattle mode.