Anti-Patterns

Unbounded Subagent Spawn

Anti-pattern: a supervisor or orchestrator spawns sub-agents that can themselves spawn sub-agents without a global cap.

Problem

Per-agent safety mechanisms — step-budget caps the loop of a single agent, cost-gating caps the cost of a single action — do not constrain total system spend through fan-out. A buggy decomposition that always splits a task into too many pieces can recursively explode the agent tree, with each individual agent looking well-behaved while the whole system burns budget exponentially. Killing one instance does not kill its descendants, and detecting recursive spawn requires global tree state that is rarely tracked. The result is that a single bad decomposition prompt can run up costs that no per-agent limit ever sees.

Solution

Don't. Maintain a global step budget across all descendants of a root request. Cap fan-out per supervisor (typically 5-10 children). Track parent_run_id in lineage so the agent tree is inspectable. Pair with kill-switch for emergency descent halt.

When to use

  • Cite this entry when sub-agents can spawn sub-agents with no global budget.
  • You are already here if one request can recursively explode into an agent tree nobody can enumerate.
  • Enforce a shared step budget across descendants, cap fan-out per supervisor, and track parent_run_id (pair with kill-switch).

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related