Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

Common Agent Failure Modes

Recommended resources

Hello! In our last lesson, we focused on the mechanics of tool use, exploring the "happy path" where an agent successfully understands a request, selects the right tool, executes it, and uses the result. This is the foundation of an agent's ability to act.

However, building production-grade systems, as you aim to do, requires preparing for when things go wrong. In this lesson, we'll walk the "unhappy path" to identify and understand common agent failure modes. Recognizing these issues is the first and most critical step toward building robust, reliable, and cost-effective agents. We'll specifically address the learning outcome of identifying failures like hallucinated tool calls and infinite loops, and expand on this to give you a broader diagnostic toolkit.

A Framework for Failures

A common mistake is to blame all erratic behavior on "model hallucination." While LLMs are probabilistic, most agent failures are not random acts of a model; they are predictable outcomes of the system's design. As engineers, we must treat them as system-level bugs to be diagnosed and fixed.

To structure our thinking, we can categorize failures based on the level of complexity at which they occur. An agent operates through nested loops of action, and failures often manifest at a specific level.

This model shows three levels of agent operation. L1 is the basic tool-call cycle, L2 involves a sequence of steps toward a goal, and L3 orchestrates multiple agents or complex processes. Each level has its own typical failure mode.

As you can see, failures aren't a monolithic category. A simple tool call might fail due to "Bad Arguments" (L1), a longer task might fail due to "Task Drift" (L2), and a complex, overarching process might get stuck in "Runaway Loops" (L3). Let's use this framework to explore the most common failure modes you'll encounter.


L1 Failure: Hallucinated Plans and Tool Misuse

This is the most fundamental type of failure, occurring at the level of a single tool call. It's what happens when the agent generates a plan that looks good on paper but can't survive contact with reality. This directly relates to the "hallucinated tool calls" mentioned in our learning objective.

The video below from IBM Technology provides a great introduction to this concept, which they term "hallucinated planning."

Why Agentic AI Fails: Infinite Loops, Planning Errors, and More

This segment explains how an agent can invent a plausible-sounding plan that relies on tools or capabilities it simply doesn't have.

Watch the section on hallucinated planning. Pay attention to the flight booking example—it perfectly illustrates how an agent can confidently generate a plan that is impossible to execute.

This failure isn't just about inventing non-existent tools. It's a broad category that includes several subtle but critical errors. The article "Detecting AI Agent Failure Modes in Production" breaks this down into more granular subtypes.

Detecting AI Agent Failure Modes in Production - Latitude.so

This section from a guide on production monitoring gives a detailed, practical breakdown of how tool use can fail. Understanding these subtypes is essential for debugging.

Please read section 1, this full section. Focus on the four subtypes it lists: argument errors, silent empty responses, tool selection errors, and chained corruption.

As you read, consider how a single one of these errors—like a "silent empty response" where a tool call succeeds but returns no data—can poison the entire subsequent execution without any explicit error flag. This is why these L1 failures are so insidious. They often stem from:

  • Poorly written tool descriptions: If the agent doesn't understand what a tool actually does, its limitations, or its expected inputs, it's forced to guess.
  • Assuming capabilities: The agent invents a tool or parameter because it seems like the logical next step, rather than stating it lacks the necessary capability.
  • Ignoring error signals: The tool returns an error, but the agent's logic doesn't handle it gracefully and proceeds as if everything is fine.

L3 Failure: The Hamster Wheel (Infinite Loops)

Now let's jump to the highest level of orchestration, L3, to tackle the other failure mode from our learning objective: infinite loops. This is one of the most common and costly failures in agentic systems. The agent gets stuck, repeating the same actions without making meaningful progress, burning through API calls and compute time.

The same IBM video provides a clear animated example of this "hamster wheel" effect.

Why Agentic AI Fails: Infinite Loops, Planning Errors, and More

This segment visualizes how an agent, tasked with finding a non-existent document, can get stuck in a search-evaluate-replan loop.

Watch the section on the infinite loop. Notice how each step seems logical in isolation, but the overall process makes no progress. This directly impacts your "cost engineering" goal, as each cycle has a tangible API cost.

To dig into the engineering causes of this, we'll turn to the article "Your AI Agent Isn’t Hallucinating. It’s Failing By Design."

Your AI Agent Isn't Hallucinating. It's Failing By Design.

This article frames the infinite loop not as a model whim but as a predictable engineering failure with clear root causes.

Read the section titled The Hamster Wheel. Focus on the three root causes identified: lack of a termination condition, no action tracking, and no progress signal.

Understanding these root causes moves the problem from a vague "the agent got stuck" to a specific engineering diagnosis: "Our system lacks a progress metric, so the agent couldn't tell its retries were fruitless." This is a problem you can solve with code.


L2 Failure and Other Silent Failures

Between the micro-level of a single tool call (L1) and the macro-level of the entire process (L3) lies the L2 "Goal Pursuit" loop. Here, the primary failure is Goal Drift, where the agent subtly deviates from the original objective over a multi-step task.

Imagine you ask an agent: "Find three recent articles about transformer architecture, summarize them, and draft an email to my team with the key points, but make sure the tone is informal." Halfway through, the agent might get so focused on summarizing one fascinating article that it "forgets" to find two others or to draft the email informally. No single step is an explicit error, but the final output fails to meet the original goal.

This and other agent-specific failures are summarized beautifully in a taxonomy from Latitude.

Detecting AI Agent Failure Modes in Production - Latitude.so

This resource provides a clear, tabular overview of agent-specific failures, contrasting them with simpler LLM failures. It's a great reference for diagnosing issues in production.

First, read the introduction, "A Taxonomy of AI Agent Failure Modes", to understand why agent failures are a unique class of problem. Then, carefully study the summary table. This table introduces and defines Goal Drift, Context Loss, Cascading Errors, and Silent Quality Degradation, which are all crucial concepts for operating production agents.


The Unifying Principle: It's an Engineering Problem

There's a common thread connecting all these failures. They are the result of granting an agent too much autonomy without enough structure, guardrails, and oversight. The final failure mode we'll touch on today, Unsafe Tool Use, highlights this perfectly. This happens when an agent uses a tool correctly from a technical standpoint, but in a context that is destructive or catastrophic.

Your AI Agent Isn't Hallucinating. It's Failing By Design.

This final reading brings the lesson home by discussing over-privileged tools and summarizing the core engineering mindset needed to build reliable agents.

Please read the sections on unsafe tool use and the concluding section, The Pattern Behind the Patterns. The principle of least privilege is a cornerstone of reliable software engineering, and it applies with even greater force to agentic systems.


Conclusion

Today, we've cataloged the critical failure modes you will inevitably encounter when building agents. Moving beyond a simple "the model hallucinated" diagnosis is the mark of a professional agent developer.

Here are the key takeaways:

  • Failures are systemic: Most agent failures are engineering problems related to system design, not just random model behavior.
  • A Hierarchy of Failure: Failures can be categorized by the operational loop in which they occur: tool-call errors (L1), goal-oriented errors (L2), and orchestration errors (L3).
  • Key Failure Modes: You can now identify several specific failure modes, including:
    • Tool Misuse & Hallucinated Calls: The agent plans to use tools it doesn't have, or uses them with incorrect arguments.
    • Infinite Loops: The agent repeats actions without making progress, wasting time and money.
    • Goal Drift: The agent's focus shifts away from the user's original objective during a long task.
    • Unsafe Tool Use: The agent performs a technically valid but practically catastrophic action due to over-privileged tools.

We have defined the problems. In our next lesson, we will begin architecting the solutions. We will discuss high-level mitigation strategies for these failures, exploring how to design more robust, resilient, and reliable agents from the ground up.