Agent Team Delegation
What it is
A coordinator workflow that breaks a complex task into specialist research, coding, writing, and verification lanes.
Operating shape
- Difficulty:
advanced - Cadence:
on demand - Category:
delegation
Core concepts
- Agent Team Delegation
- Subagents
- Tool Executor
- Sessions
- Standard Operating Procedures
Source evidence
vendor/hermes-agent/tools/delegate_tool.py#<file>— Structural Source Map fallback for tools/delegate_tool.py. A core source file in the Tools, Toolsets, and MCP — Other Core Files structure within Tools, Toolsets, and MCP.
Related articles
- Ten Hermes Workflows That Turn a Chatbot into a 24/7 Assistant
- How to Use Hermes Better Than Most People: Architecture, Project Isolation, and Scalable Workflows
Implementation pattern
Outcome
Have one coordinator launch two independent, read-only child tasks in parallel, merge their structured findings, surface disagreement, and recover honestly when one child fails.
Before you start
- Create the two synthetic policy fixtures below; they contain no private data.
- Keep delegation flat and bounded: two concurrent top-level leaf children. Start the parent with only the
fileanddelegationtoolsets. - Do not ask the model to set per-child toolsets or
max_iterations: the model-facingdelegate_taskschema exposes neither. Children inherit the parent’s toolsets, leaf restrictions remove delegation from children, and the iteration budget comes fromdelegation.max_iterationsin config. - Remember that children receive no conversation history and cannot ask the user questions; every path, output schema, and boundary must be in their context.
- Separate conversations and terminal task IDs are not filesystem sandboxes. Both children can reach the same project filesystem, so this lab gives them read-only, non-overlapping scopes and reserves
comparison.mdfor the parent.
LAB_DIR="$HOME/hermes-labs/delegation-policy"
mkdir -p "$LAB_DIR"
cat > "$LAB_DIR/policy-a.md" <<'EOF'
# Policy A
Refund requests are accepted within 30 days.
Evidence required: receipt number.
EOF
cat > "$LAB_DIR/policy-b.md" <<'EOF'
# Policy B
Refund requests are accepted within 14 days.
Evidence required: receipt number.
EOF
cd "$LAB_DIR"
Input and output contract
Each child returns JSON with source, rule, evidence_quote, unknowns, and status. The coordinator writes comparison.md with both results, agreements, conflicts, and a recommendation only where evidence permits. A missing/failed child is shown as failed; the coordinator must not reconstruct its result. No source file changes and no network calls are allowed.
{"source":"policy-a.md","rule":"...","evidence_quote":"...","unknowns":[],"status":"ok"}
Build it
From the fixture folder, launch the interactive TUI with the parent’s tools restricted:
hermes --tui --toolsets file,delegation
At the TUI prompt, submit:
Dispatch exactly two separate top-level leaf delegations, not one batch.
Child A may read only the absolute path to policy-a.md; Child B may read only
the absolute path to policy-b.md. Give each child its complete path, boundaries,
and required JSON keys: source, rule, evidence_quote, unknowns, status.
Do not pass child toolsets or max_iterations. Do not modify sources, use the
network, or create nested agents. Each child must return independently.
After both completion messages have returned to this conversation, create
comparison.md with both attributed results, agreements, conflicts, and a
recommendation only where evidence permits. Never reconstruct a failed result.
Top-level delegations run in the background. Keep the TUI session open and use /agents while they run; each separate delegation returns to the conversation as its own completion message.
Verify it
/agentsshows exactly two top-level leaf children, with no nested delegation.- Both JSON results contain all required keys and quote text that exists in the named source.
comparison.mdpreserves the conflict instead of averaging incompatible rules.- Hash/diff both source files; neither changed and no network tool was available to children.
- Rename
policy-b.mdtemporarily and rerun: Child B must fail, and the coordinator must label that branch failed without inventing its rule.
If it fails
- If a child lacks context, rerun with the absolute path, exact schema, and complete acceptance criteria; “use the file we discussed” is insufficient.
- If a child times out or reaches its iteration budget, keep its failure status, use the successful sibling only for its own source, and ask whether to retry.
- If the parent is interrupted with
/stop, the session is replaced with/new, or the TUI exits before completion, active background children are cancelled and unfinished results are discarded. Restart only the missing bounded delegation. - If costs grow, lower
delegation.max_iterationsin config or run sequentially; do not attempt a per-call child budget or raise nesting depth.
Safety, privacy, and cost
By default, child agents inherit the parent’s model and provider credentials, but delegation.provider, delegation.model, and delegation.base_url can override that routing. Enabled toolsets remain inherited, subject to leaf-agent blocks. Verify those delegation settings before assuming which provider receives data or what a child call costs. Restrict the parent to file,delegation, never embed secrets in context, and control concurrency and iteration budget through config. Top-level delegation is background work but not a durable queue: /stop, session termination, or process exit cancels unfinished children. Use cron or a supervised background terminal process for durable work.

