# Unbounded Subagent Spawn

> A supervisor spawns sub-agents that can spawn their own sub-agents — with no global cap on the tree size or recursion depth.

- **Category**: Agentic AI
- **Subcategory**: Anti-Patterns
- **Canonical URL**: https://designpattern.fyi/patterns/unbounded_subagent_spawn/

---

## Description
**Intent**: Allowing each parent agent to spawn child agents that can themselves spawn further children — with no cap on total tree size or recursion depth.

**Context**: Supervisor/orchestrator/researcher patterns decompose tasks by spawning sub-agents. That''s the design. The problem: there''s no global cap. A sufficiently complex task can spawn a tree of hundreds of agents, each burning tokens, before anyone notices.

**Solution**: 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 full agent tree is inspectable. Pair with a kill-switch for emergency halt of the entire tree.



## Use Cases
- Never use this; fan-out without a global cap can recursively explode the agent tree.
- Maintain a global step budget across all descendants of a root request.
- Cap fan-out per supervisor and track parent_run_id for inspectability.






## Trade-offs




### Considerations & Drawbacks

- Catastrophic cost spikes from runaway decomposition before any alarm fires

- Untracked descendants survive a top-level halt — they keep running

- Provider rate limits cascade through the tree, producing cascading failures







---
**Reference**: [Original Source](https://www.agentpatternscatalog.org/patterns/unbounded-subagent-spawn/)

