EXC-ACT-01Tier IException Handling & Graceful Degradation

Bounded Iteration & Budget Caps

Every agent loop has explicit limits (max iterations, max tokens, max wall-time, max spend) beyond which it stops and escalates.

Runtime: ActAgentOps: Build & IntegrateSee on the matrix →
BOUNDED ITERATION & BUDGETS Task Startbudgetsdeclared Stepiter / tokens/ seconds Budget Checkper step Continuewithinenvelope Halt + Escalateon breachPer-task, per-agent, per-tenant caps — not just per-LLM-call.
In Plain English

This page is the complete instruction page for one pattern called "Bounded Iteration & Budget Caps." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward, both the good effects and the costs.

This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.

Context

Agents without exit conditions loop. They re-try the same failing tool, re-decide with the same information, burn tokens, and occasionally cost thousands of dollars in a single runaway.

Problem

Unbounded agent loops are an operational and financial hazard.

Forces

  • Completeness vs bounded cost
  • Strict caps vs legitimate long-horizon work

Solution

Declare per-task budgets: max reasoning steps, max tool calls, max tokens, max seconds, max currency. Track consumption. On breach, halt and escalate with current state summary. Budgets are per-task, per-agent, and per-tenant.

Placement

Where this pattern acts in the two lifecycles

Runtime Cognitive
01Perceive
02Reason / Plan
03Decide
04Act
05Observe
06Reflect / Learn
07Terminate

04 Act. Tool call, API invocation, environment mutation. 15 of 61 catalogue patterns act at this stage.

AgentOps Lifecycle
01Design & Scope
02Build & Integrate
03Evaluate & Red-Team
04Deploy
05Operate & Monitor
06Iterate & Adapt
07Decommission

02 Build & Integrate. Model selection, tool wiring, memory design. 17 of 61 catalogue patterns act at this stage.

Stages and counts from the catalogue data. The Runtime lens is the loop the agent runs each turn; the AgentOps lens is the lifecycle the team runs the agent through. See the Matrix for every pattern at each stage.

Applicability

  • All production agents
  • Any agent with tool access
  • Any multi-step agent

Anti-Patterns

  • "It usually terminates"
  • Budgets only at the LLM-call layer, not end-to-end

Consequences

  • +Bounded worst-case cost
  • +Bounded user wait
  • −Occasionally cuts off legitimate long work
  • −Requires budget tuning