Traditional software fails loudly: a 500 error, a crash, a timeout. AI agents fail silently: they produce output that looks correct but is subtly wrong, they take actions that seem reasonable but have unintended consequences, and they degrade gradually without triggering any alerts. Understanding agent-specific failure modes is the first step to building reliable agents.
Failure Mode 1: Hallucinated Tool Calls
The agent calls a tool that does not exist, or calls a real tool with fabricated parameters. The LLM generates plausible-sounding tool names and parameters that are not valid. Defence: validate every tool call against the registered tool schema before execution. Reject invalid calls and pass the rejection back to the LLM with an error message explaining what went wrong.
Failure Mode 2: Infinite Loops
The agent gets stuck in a loop: it tries an action, fails, tries the same action again, fails again, and repeats indefinitely. This consumes resources and produces no output. Defence: implement a maximum step count per task (typically 10-20 steps) and a maximum time limit (typically 60-120 seconds). When either limit is reached, the agent should stop, summarise what it has done, and escalate to a human.
Warning
Every agent needs a step limit and a time limit. Without them, a single request can consume unlimited resources.
Failure Mode 3: Cascading Errors
The agent makes an error in an early step, and the error propagates to all downstream steps. Example: the agent misclassifies a support ticket, routes it to the wrong team, generates an incorrect response, and sends it to the customer. Defence: implement output validation at each step (not just the final output), and implement a rollback mechanism that can undo steps when errors are detected.
Failure Modes 4-7: The Subtle Failures
(4) Prompt injection: the agent follows injected instructions instead of its intended behaviour. Defence: input sanitisation and system prompt hardening. (5) Context window overflow: the conversation gets too long, and the agent loses early context. Defence: implement summarisation for long conversations. (6) Tool degradation: a tool's API changes, and the agent sends invalid requests. Defence: contract testing between the agent and each tool. (7) Model version drift: the LLM provider updates the model, and the agent's behaviour changes. Defence: pin model versions and test after upgrades.
Conclusion
Agent failures are different from traditional software failures: they are often silent, subtle, and gradual. The seven failure modes each require specific defences. The common thread: validate at every step, implement limits, and maintain comprehensive logging.
Key Takeaways
- Agents fail silently — output can look correct while being subtly wrong
- Seven failure modes: hallucinated tools, infinite loops, cascading errors, prompt injection, context overflow, tool degradation, model drift
- Every agent needs a step limit and time limit — without them, unlimited resource consumption
- Validate at every step, not just the final output — catch errors before they cascade
- Pin model versions and contract-test tool interfaces — external changes cause silent failures