# 24.7 Naming the failure (/building-ai-workers/evaluating-ai-workers/naming-the-failure)

---
type: Document
title: "24.7 Naming the failure"
description: "Six names for a failed answer, read from its trace, that the builder and the expert share."
status: stable
order: 324.07
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T00:02:23Z
chapter: '24'
part: III
expert_status: co-build
concepts: [ "24.7" ]
last_verified: '2026-11-29'
sources:
  - id: anthropic-refusals
    title: Refusals and fallback (verified 2026-11-29)
    resource: https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback
  - id: anthropic-ccdv-f-exam-guide
    title: Claude Certified Developer - Foundations Exam Guide, version 1.1, effective December 7, 2026 (read 2026-11-29)
    resource: https://cc.sj-cdn.net/instructor/6nizmqk8tpzpfjvt6qmmav7rh/public/1794946771/Claude_Certified_Developer_-_Foundations_Exam_Guide_Updated_Dec_7.pdf
  - id: anthropic-opentelemetry
    title: OpenTelemetry tracing for the Claude API (beta, verified 2026-11-29)
    resource: https://platform.claude.com/docs/en/manage-claude/opentelemetry
generated:
  at: 2026-11-30T00:02:23Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:cc6fd9ac5f72207d4365ecbda63d87d1b64f99e05519b358a45b9f5d9bfd6f8f
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** At a clinic, a nurse does not write "the patient feels bad" on the chart. She writes "high fever, three days, no cough". The doctor reads those words and knows where to look first. Two people who share a few exact names can hand a problem to each other without losing it. In this concept, "feels bad" is "the answer is wrong", the name on the chart is the **failure mode**, and the chart is the trace.

**What you will learn.** How to name a failed answer from its trace, in six words the builder and the expert share. You practice it in Lab 24, Task 6.

- Why does a failed answer need a name?
- What are the six names?
- Have you already seen one?
- What will you name in the lab?
- What does a name cost?

**Why it matters.** "Wrong" cannot be fixed. A name tells the builder where in the trace to look first.

**At work.** Monday, April 12, 2027, 8:40. Ana has twenty minutes and the one flagged answer from 24.4. She marks it fail. Her mark says the answer is wrong. It does not say what kind of wrong. So the builder opens the run's trace. The tool returned line 8, with the words "before payment". The answer says "after payment", and no tool result in the run holds those words. The builder writes one word beside Ana's mark: hallucination. Ana reads the reason and agrees. From now on they both mean the same thing by it.

### Why does a failed answer need a name?

Because "wrong" tells the builder nothing about where to look. A **failure mode** is a kind of wrong answer that has a name. The name comes second. First Ana agrees that the answer failed, because only she can say what a right answer is. Then the builder reads the trace ([21.10](../agent-loop-by-hand/reading-a-trace.md)), proposes a name, and Ana agrees to it. The name lets the suite's report count her fails by kind (24.5).

### What are the six names?

The exam guide lists six failure modes: hallucination, refusal, under-acting, context loss, format drift and inconsistent output.[^anthropic-ccdv-f-exam-guide] It lists them after the words "such as", so the list is open.

Three of these names, under-acting, context loss and format drift, have no official definition. The definitions below are this book's own.

| Name | What it means | What the trace shows |
| --- | --- | --- |
| Hallucination | The answer states something that no tool result or document in the run supports | The claim in the answer, and no tool result that holds it |
| Refusal | The model **declines**: it will not do what was asked | A normal response, status 200, with the stop reason "declined" (`refusal`) and a short category[^anthropic-refusals] |
| Under-acting | The worker does less than the task asked. It stops early, or it says what it would do and does not do it | A "finished" stop reason, with fewer tool calls or fewer items than the task named |
| Context loss | The worker leaves out, or stops following, something it was given earlier in the run: a rule in its instructions, or a fact from an earlier tool result | The rule or fact early in the request, or missing from it, and a later step that no longer follows it |
| Format drift | The content is right, but its shape moves away from what was asked: a renamed field, a date written another way, text around the JSON | The output beside the format rule. A check by code refuses it |
| Inconsistent output | The same request gives different decisions on different runs | Nothing in one trace. It takes two or more runs of one case, side by side |

One word needs explaining. The exam guide says "refusal". This book says the model **declines**, because [21.3](../agent-loop-by-hand/one-turn-request-response-and-stop-reason.md) keeps three words apart: the model declines, the API rejects, and your code refuses. On the exam, read "refusal" as "the model declined".

One name needs a limit. A model's wording changes from run to run, and that is not a failure ([19.16](../business-data-and-retrieval/measuring-retrieval.md)). Inconsistent output means the decision changed: approve on one run, hold on the next.

Two names can look alike. When an answer states words that no tool result holds, name it hallucination, even if the true words were in the run. When an answer leaves a rule or a fact out, name it context loss.

<!-- EDITOR: the line between hallucination and context loss is this book's own, since no official page defines context loss. The other option: name Friday's answer context loss, because the tool result held "before payment". -->

### Have you already seen one?

Yes. In 21.10, every span was green. A span is one step's line in a trace. The answer cited line 5 of `po-matching.md` for a rule that is on line 9. The trace had no `execute_tool search_policy` span, so no tool result held that line. That failure has a name now: hallucination.

It also shows what a name does not say. The model wrote the wrong line, but the cause was in the code, which sent three tools where four were needed. A name says what kind of wrong. Where the failure began is a second question, and 24.8 answers it.

### What will you name in the lab?

In Lab 24 you name six recorded traces, one for each name. None is written by hand. Each is a real run of the lab's model under a planted condition, which is one set up on purpose. Each was recorded with its request. The conditions are a prompt line cut, a tool result trimmed, a long context, a format rule missing, or one case run several times. The cut prompt line is the run above.

<!-- OPEN: recorded output. No run is recorded yet, so "none is written by hand" is not yet true. The lab must record each of the six runs. The spec lists five planted conditions for six traces and does not say which condition gives which name, how the decline is produced, or which name the handoff trace carries. Put each trace's real lines here, or in the lab, once recorded. -->

The exam works the same way. It shows a **trace excerpt**, a few lines cut from a trace, and asks for the name.

A trace must hold content for this to work. **In Claude.** Tracing for the Claude API records metadata only by default: which calls ran, and not what was said.[^anthropic-opentelemetry] Metadata can show a decline or a short run. It cannot show a hallucination, because the claim and the tool result are both content. That is why the lab records each run with its request.

<!-- FIGURE 24.4: A table drawn as six rows, titled "Six failures in Lab 24's recorded runs". Three columns, left to right: "Name", "The line in its trace", "Where it began". The figure does not repeat the definitions in the table above: each row shows the real line from one recorded run. Row 1: "Hallucination" | "The answer says 'after payment'. The tool result says 'before payment'." | "Model output (cause: a prompt line was cut)". Rows 2 to 6, "Refusal (the model declines)", "Under-acting", "Context loss", "Format drift" and "Inconsistent output": the real trace line and the place it began, both from the recorded run. The third column uses only two values, "Integration layer" and "Model output", each with its own color. No arrows. A note under the table: "The name says what kind of wrong. The last column is 24.8's question." OPEN: recorded output: rows 2 to 6, and the exact words of row 1, come from the lab's recorded runs. -->
<!-- EDITOR: the table above keeps the definitions, which the quiz rests on, and this figure shows only each recorded run's trace line and where it began. The other options: the table alone, or the figure alone as the spec first drew it. -->

*Figure 24.4. Six failures from the lab's recorded runs: the name, the line in its trace, and where the failure began.*

### What does a name cost?

A name costs Ana's agreement and a read of the trace, on every fail. And six names are a start, not a full list. Lab 24 ends with one failure that fits none of them well: an invoice total read as the subtotal. When no name fits, say what happened in simple words, and do not force one. When a check by code already says exactly what is wrong, such as an invoice missing from a report ([23.16](../hosted-agents/loops-check-feedback-and-stop.md)), its message is name enough.

**The operating rule:** Ana says whether an answer failed. Then name the failure from its trace, in one of six shared names, before anyone changes anything.

**Do this now.** Open your coding agent and give it the table above. Copy this line:

> Tell me, for each of these six failure names, one thing in a trace that would show it, and one thing a trace alone cannot show.

Check its answer against the table's last column. Then say aloud which name fits 21.10's run, and why.

[^anthropic-ccdv-f-exam-guide]: Claude Certified Developer - Foundations Exam Guide, version 1.1, Anthropic.
[^anthropic-refusals]: Refusals and fallback, Anthropic.
[^anthropic-opentelemetry]: OpenTelemetry tracing for the Claude API, Anthropic.
