XIV · Anti-PatternsAnti-pattern

Unbounded Subagent Spawn

also known as Recursive Spawn, Subagent Fan-Out Bomb

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

Context

A team is operating a multi-agent system that uses supervisor, orchestrator-workers, or lead-researcher style decomposition. At each level a parent agent breaks the task down and spawns child agents to handle the pieces, and those children can themselves spawn further sub-agents if their slice of the task is still too large. There is no global cap on how many agents the whole tree is allowed to contain or how deep the recursion can go.

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.

Forces

  • Per-agent caps look like sufficient governance until fan-out is observed.
  • Detecting recursive spawn requires global agent tree state.
  • Killing a single instance does not kill its descendants.

Example

A research orchestrator decomposes a topic into ten sub-topics, each spawning a sub-agent; each of those decomposes into ten more sub-agents, and there is no global cap. One run consumes the month's budget in fifteen minutes through fan-out alone, even though each individual loop has a step budget. The team adds a global step budget across all descendants of a root request, caps fan-out per supervisor (5-10 children), and tracks `parent_run_id` so the agent tree is inspectable and killable as a whole.

Diagram

Solution

Therefore:

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.

What this pattern forbids. By definition, this anti-pattern imposes no useful constraint; the missing global fan-out cap is the failure.

And the patterns that stand alongside it, or against it —

  • alternative-toStep Budget★★Cap the number of tool calls or loop iterations the agent is allowed within a single request.
  • alternative-toCost Gating★★Block actions whose expected cost exceeds a threshold without explicit user (or operator) acknowledgement.
  • alternative-toKill SwitchProvide an out-of-band control plane to halt running agent instances without redeploy.
  • complementsSubagent IsolationRun subagents in isolated workspaces so their writes do not collide and parallelism is safe.
  • conflicts-withClone Fan-Out Research·Spawn 100 or more identical, full-capability agent instances in parallel — each a complete general agent rather than a role-specialised worker — and aggregate their independent outputs into a single answer.
  • complementsCascading Agent FailuresAnti-pattern: build a multi-agent system where one agent's failure or hallucination propagates as input to peers, until the whole system has drifted.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.

References

Provenance