{
  "schema_version": "1.3.0",
  "slug": "through-what-backpressure-and-circuit-breaking-gates-must-an-instance-throttle-recursive-sub-agent-spawning-and-unbounded-tool-loops",
  "title": "Through what backpressure and circuit-breaking gates must an instance throttle recursive sub-agent spawning and unbounded tool loops?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** Orchestrating multi-step tool loops, autonomous retry/repair cycles, or multi-agent workflows capable of spawning child tasks or sub-agents. * **Does not apply when:** Executing a single-turn, non-iterative, non-delegati",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/through-what-backpressure-and-circuit-breaking-gates-must-an-instance-throttle-recursive-sub-agent-spawning-and-unbounded-tool-loops.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/through-what-backpressure-and-circuit-breaking-gates-must-an-instance-throttle-recursive-sub-agent-spawning-and-unbounded-tool-loops.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/through-what-backpressure-and-circuit-breaking-gates-must-an-instance-throttle-recursive-sub-agent-spawning-and-unbounded-tool-loops.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2289,
    "python_slice_tokens": 537,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "When an autonomous agent has permission to spawn sub-agents or execute iterative tool loops (`while not_done: call_tool()`), a catastrophic resource-exhaustion hazard—**the Autonomous Fork Bomb / Runaway Livelock**—occurs if **Agent A spawns 5 sub-agents, each of which spawns 5 sub-agents recursively without a shared global tree budget ($5^d$ exponential fan...",
    "what_was_observed": "In multi-agent frameworks and autonomous coding loops, missing backpressure and recursion gates cause four primary runaway failure modes: 1. **Exponential Sub-Agent Fork Bomb:** A coordinator agent splits a repository refactoring task across 10 sub-agents; each sub-agent encounters an import error and spawns 10 helper agents to investigate—generating 1,000+ concurrent LLM sessions in seconds and exhausting API quotas...",
    "condition_of_validity": "* **Applies when:** Orchestrating multi-step tool loops, autonomous retry/repair cycles, or multi-agent workflows capable of spawning child tasks or sub-agents. * **Does not apply when:** Executing a single-turn, non-iterative, non-delegating direct function call. * **Non-binding outside condition:** This residual is strictly non-binding outside the conditio...",
    "decision_boundary": "1. **Does your sub-agent spawning logic enforce both a maximum recursion depth and a single shared total-spawn counter across the entire tree?** Without a shared tree-wide counter, even a small per-node limit multiplies exponentially into a fork bomb. 2. **Could this subtask be delegated back to an agent role that is already waiting higher up in the call cha...",
    "operational_effect": "1. **Total Fork-Bomb Immunity:** Exponential sub-agent fan-out is mathematically impossible under a shared atomic tree budget and depth cap. 2. **Instant Cycle & Livelock Termination:** Mutual `A -> B -> A` delegation cycles and zero-progress tool loops are halted within two turns. 3. **Downstream Backpressure Respect:** Sub-agent spawning freezes automatica..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "composition_edges": {
    "primary_domain": "rate_limit_and_quota_throttling",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/across-what-mandatory-tenant-predicate-scoping-and-row-level-security-gates-must-an-instance-isolate-multi-tenant-data-to-prevent-cross-tenant-data-leaks.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/across-what-deadline-propagation-and-cancellation-cascade-gates-must-an-instance-govern-grpc-and-http2-calls-to-prevent-zombie-worker-exhaustion-and-wasted-compute.md",
      "https://corpusfetch.com/c/across-what-bounded-queue-admission-control-and-load-shedding-gates-must-an-instance-manage-concurrency-to-prevent-unbounded-memory-growth-and-tail-latency-collapse.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/beneath-what-concurrency-and-backpressure-ceilings-must-an-instance-throttle-fan-out-tasks-to-prevent-file-descriptor-and-connection-pool-starvation.md",
      "https://corpusfetch.com/c/through-what-token-bucket-and-atomic-quota-gates-must-an-instance-enforce-multi-tenant-rate-limiting-to-prevent-noisy-neighbor-starvation-and-boundary-burst-amplification.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "f4d03b38c3fd87b3f8633ac6d6bcbd5791d69fc2cef3f2242f42d578d05eb369",
    "verified_classes": [
      "RunawayLoopOrForkBombError",
      "TreeOrchestrationStatus",
      "RecursiveLoopCircuitBreaker"
    ],
    "verified_functions": [
      "__init__",
      "authorize_subagent_spawn",
      "record_loop_step_and_check_livelock"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 9,
    "raised_exceptions": [
      "RunawayLoopOrForkBombError",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "Orchestration ceilings must be positive integers.",
      "Sub-agent spawn refused: orchestration circuit breaker is OPEN or downstream backpressure is active.",
      "Cannot execute tool step: circuit breaker is already OPEN."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
