CCDV-F · Domain 4: Eval, Testing, and Debugging · 10% of the exam
Task 4.2: Failure-Mode Diagnosis
Naming the failure in a trace or a reproduction (made-up facts, refusals, too little action, lost context, drifting format, inconsistent answers), telling an integration fault from a model output fault, and fixing the cause rather than the symptom.
Study it
Failure modes from traces: integration fault or model output, and fixing the cause
Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.
Question 1 · choose 1
Your streaming chat UI shows an error card when Claude declines a request. The handler reads stop_details.category and stop_details.explanation from the message_delta event to fill the card. On a small share of declined requests the UI crashes with a null reference instead, and the logs show stop_reason "refusal" on those responses. Where does the failure originate, and what is the fix?
AIn the model output: the refusal was incomplete, so retry the request until a category is returned
BIn the integration layer: stop_details.category arrives on content_block_stop, so read it from that event
CIn the integration layer: category and explanation can be null, so branch on stop_reason and supply your own message
DIn the model output: Claude only fills the category when the system prompt asks it to explain refusals
Show the answer and why
AIn the model output: the refusal was incomplete, so retry the request until a category is returned
Incorrect
The response is a complete refusal; null fields are an allowed shape that the client must handle.
BIn the integration layer: stop_details.category arrives on content_block_stop, so read it from that event
Incorrect
In the event stream, stop_details arrives on the message_delta event with stop_reason.
CIn the integration layer: category and explanation can be null, so branch on stop_reason and supply your own message
Correct
stop_details is always present on a refusal, but its category and explanation can be null.
DIn the model output: Claude only fills the category when the system prompt asks it to explain refusals
Incorrect
The fields come from the streaming classifiers, not from a prompt instruction.
On a refusal the stop_details object is always present, but its category and explanation can be null, for example when the refusal maps to no named category. Branch on stop_reason or stop_details.type and provide your own user-facing message when the fields are null.
A compliance job checks every export_report tool call by searching the raw JSON text of the logged response for "path": "/reports/q3". After the application moved to a newer Claude model, the check misses some calls that did export that report: in their logged text the same path appears as "\/reports\/q3". Which change addresses the cause?
AParse the logged tool input as JSON and compare the parsed path value instead of matching the raw text
BPin the previous model ID, since the newer model returns tool inputs that no longer match the tool's schema
CAdd input_examples that show the path without escapes so that Claude stops escaping the slashes
DTell Claude in the system prompt never to escape slashes in tool inputs, so that the raw text matches again
Show the answer and why
AParse the logged tool input as JSON and compare the parsed path value instead of matching the raw text
Correct
Unicode and forward-slash escaping differs between model versions, so compare parsed values, never serialized text.
BPin the previous model ID, since the newer model returns tool inputs that no longer match the tool's schema
Incorrect
The input holds the same value with different escaping; that is a serialization difference, not a schema mismatch.
CAdd input_examples that show the path without escapes so that Claude stops escaping the slashes
Incorrect
Escaping varies between model versions, and the fix is to stop raw string matching on serialized input.
DTell Claude in the system prompt never to escape slashes in tool inputs, so that the raw text matches again
Incorrect
The documented fix for escaping that differs between model versions is to parse the input, not to keep matching serialized text.
String comparisons on tool inputs can fail after a model change because Unicode and forward-slash escaping differs between model versions. The fault is in the integration: parse the input with json.loads() or JSON.parse() and compare values, and never do raw string matching on serialized input.
Your agent's lookup tool returns customer records, and to save a round trip your code appends "Now update the CRM with these values." to the end of each tool_result's content. Since then Claude often stops and asks the user to confirm the update instead of calling update_crm. Where does this under-acting come from, and what is the fix?
AFrom the model: it is too cautious, so set tool_choice to force update_crm after every lookup
BFrom the integration: Claude distrusts instructions inside tool results; send yours in a user turn after the result
CFrom the model: it lost the instruction, so repeat the sentence twice inside each tool_result
DFrom the integration: the tool_result is too long, so truncate the records and keep the instruction at the end of it
Show the answer and why
AFrom the model: it is too cautious, so set tool_choice to force update_crm after every lookup
Incorrect
Forcing the tool hides the cause, which is where your instruction is placed.
BFrom the integration: Claude distrusts instructions inside tool results; send yours in a user turn after the result
Correct
Keep the tool result to just the data and deliver your own instructions outside it.
CFrom the model: it lost the instruction, so repeat the sentence twice inside each tool_result
Incorrect
Repeating it keeps the instruction in the place Claude treats as untrusted content.
DFrom the integration: the tool_result is too long, so truncate the records and keep the instruction at the end of it
Incorrect
Length is not the cause; the instruction's placement inside the result is.
Claude is trained to treat instructions inside tool results as potentially untrusted third-party content, so it may refuse to act on them or ask for confirmation. Keep tool results to the data, and send your own instructions in a user turn after the tool_result block.
You suspect Claude invents facts in answers to an open-ended research question, but you have no labeled answers to compare against. Which technique from Anthropic's guidance on reducing hallucinations helps you detect them?
AAsk the same question in a longer prompt so that Claude has more room to explain
BIncrease max_tokens so that answers are never cut off mid-claim
CAsk Claude to answer more confidently so that weak claims stand out
DRun the same prompt several times and compare the outputs for inconsistencies
Show the answer and why
AAsk the same question in a longer prompt so that Claude has more room to explain
Incorrect
A longer prompt is not a check on the facts in the answer.
BIncrease max_tokens so that answers are never cut off mid-claim
Incorrect
The output limit does not reveal invented facts.
CAsk Claude to answer more confidently so that weak claims stand out
Incorrect
Confidence wording does not separate grounded claims from invented ones.
DRun the same prompt several times and compare the outputs for inconsistencies
Correct
Best-of-N verification: inconsistencies across outputs can indicate hallucinations.
Best-of-N verification runs Claude through the same prompt multiple times and compares the outputs; inconsistencies across them could indicate hallucinations.
Your IT support assistant gives different answers to the same question about the VPN policy from one conversation to the next, because it relies on what it remembers about the company. Which technique from Anthropic's guidance on increasing consistency addresses this?
AAsk the same question twice in each conversation and keep the second answer
BShorten the system prompt so that Claude has less to keep in mind
CUse retrieval to ground the answers in a fixed set of knowledge base entries
DLet Claude choose its own output format so that it can answer more naturally each time
Show the answer and why
AAsk the same question twice in each conversation and keep the second answer
Incorrect
Repeating the question does not give Claude a fixed source of facts.
BShorten the system prompt so that Claude has less to keep in mind
Incorrect
Less context does not ground the answer in the company's policy.
CUse retrieval to ground the answers in a fixed set of knowledge base entries
Correct
For tasks needing consistent context, retrieval grounds responses in a fixed information set.
DLet Claude choose its own output format so that it can answer more naturally each time
Incorrect
Leaving the format open adds variation rather than removing it.
For tasks requiring consistent context, such as chatbots and knowledge bases, use retrieval to ground Claude's responses in a fixed information set. Precise output formats and examples also make responses more consistent.