1:1 mentoring with Big Tech AI engineers
System Design

Agent Failure Modes

Common AI agent failure modes: infinite loops, tool misuse, context window overflow, and recovery strategies.

Last updated

Core30 min readFirst readYour First Agentic System

After this section you can

  • Name all 15 agent failure modes across the 4 categories — execution, resource, safety, operational — with a detection signal and a recovery pattern for each.
  • Implement a guardrail wrapper that enforces step, token, cost, and latency budgets and halts an infinite loop after three repeated tool calls.
  • Prioritize the 15 modes with a severity × frequency matrix and defend the fix order in a design review.
  • Walk a recovery decision tree from a failed agent step to the right response: retry, degrade, report, or halt.
SD-9

Agent Failure Modes — Complete Taxonomy

Production agents fail in predictable ways. Learn all 15 failure modes, how to detect each, and the recovery pattern.

Agent Failure Modes -- 4 Categories, 15 Modes (6 Most Common Shown)
Infinite Loop
Same tool call repeated endlessly
Context Overflow
Tool results flood the context window
Goal Drift
Agent solves tangential problems
Tool Misuse
Wrong tool or hallucinated tool call
Cost Explosion
15 rounds x 100K tok = $7.50/task
Hallucination Cascade
Bad output feeds next step, compounds

Related

More in System Design

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium