How to detect AI agent failures in production

Last updated 2026-10-22

Detecting an AI agent failure in production means finding the conversations where the agent did the wrong thing, or nothing, while every request still returned a normal response. Error rates and latency miss most of these. You find them by logging whole sessions, scoring each one against named failure signals, and tracing each hit back to the step that caused it.

This guide is the working method behind this library. The signals below are proposed: they are starting points to check against conversations a person has labeled, not measured detectors.

1. Log the whole session, not single requests

A failure usually shows up across turns: the user asks the same thing twice, asks for a person, or stops replying. Single-request logs cannot see that. Keep one record per conversation turn, with the session id, the user message, the agent reply, any tool calls and their results, and a timestamp. The conversation checker shows what a whole-session read finds, and runs in your browser.

2. Score each session against named failure signals

Give every failure a name and a signal you can count. A few from the library:

FailureSignal you can count
Generic error messagesThe same stock error reply appears in the transcript with no next step offered.
Dead-end "I don't understand" repliesA fallback reply is followed by the user repeating or rewording the same request.
Escalates too early or too lateThe user asks for a person and the next agent turn does not hand off.
Cold transferAfter handoff, the human agent asks for details the user already gave the bot.
Silent failure and timeoutA user message gets no reply, or the reply stops mid-sentence.
Lazy completionThe agent finishes part of a multi-part request and reports it as done.

Pair every signal with a counter-signal that rules out false alarms. The pattern pages list both.

3. Look for silent failures on purpose

The costly cases return a normal-looking answer. A tool call fails and the agent reports success (silent tool failures). A pipeline stage drops data and the next stage carries on (silent failures in multi-stage pipelines). Extraction returns tidy but wrong fields (silent data errors). Check tool results against what the agent told the user, not only whether the call returned.

4. Check what the agent claimed against ground truth

A fluent wrong answer raises no error. See confidently wrong answers with no way to check. The public record shows the cost: a tribunal held Air Canada responsible for its chatbot's invented refund policy (incident), and a support bot at Cursor invented a device-limit policy (incident). Compare answers about policy, price and eligibility with the source document.

5. Watch actions, not only words

For agents that act, the failure is a wrong action. A coding agent ran terraform destroy against production (DataTalks.Club), and another tool treated a failed mkdir as success and overwrote files (Gemini CLI). Log every tool call with its arguments and its result, and flag destructive calls and calls that follow an error.

6. Report the metric that matches the failure

A conversation the bot kept is not a problem solved. Containment rate versus resolution rate explains why a high containment number can hide failures. For the difference between a chatbot that says the wrong thing and an agent that does the wrong thing, see AI agent vs chatbot failures.

7. Trace each hit to its cause, then fix it

For every flagged session, find the first turn where it went wrong: the retrieval, the tool call, the fallback rule or the handoff rule. Each pattern page names a fix and a way to confirm it worked. Review a sample of flagged and unflagged sessions by hand each week, and change a signal when it fires wrongly.

What this guide does not claim

No detection rate or accuracy figure is given here, because none has been measured. A tool to automate this is in design; see the waitlist. Sourcing standards are on the methodology page. Browse all failures by topic.

One email a month: a real AI agent failure explained, new test results, and 10 incidents from the past month. No spam, unsubscribe any time.