Claude Certified Architect — Foundations · Free practice question 3 of 10
Tool-based verification to prevent hallucinated APIs
Your Claude-based migration tool reads a developer's TypeScript file and proposes a new version that swaps a deprecated library for its replacement. Engineers report it sometimes proposes correct-looking code that references functions which do not exist in the replacement library. Which architectural change is the most effective fix?
- A.Increase the static prompt context to include a full snapshot of the replacement library's public surface, pasted as plain text.
- B.Convert the pipeline to an agentic task where Claude is given a `lookupSymbol(name)` tool and instructed to verify each replacement function exists before proposing it.
- C.Lower the temperature to 0 and add the instruction "do not hallucinate."
- D.Run the proposal through a static analyzer in a second pass and have it reject calls to unknown functions.
Show answer and explanation
Correct answer: B. Convert the pipeline to an agentic task where Claude is given a `lookupSymbol(name)` tool and instructed to verify each replacement function exists before proposing it.
Why: Function hallucinations come from the model guessing what's plausible. The fix is to make verification cheaper than guessing — give Claude a tool to look up symbols and require their use. Static snapshots get stale; a downstream rejector lets the failure happen and then catches it, wasting the model's effort.
More free Claude Certified Architect — Foundations questions
- Narrowing label definitions to stop over-triggering
- Severity and confidence metadata for review findings
- Precision vs recall trade-offs in extraction
- Evidence fields for auditable structured output
- Tool schemas for strict JSON conformance
- Routing scarce human review capacity
- Execution-based evals for SQL generation
- Prompt caching for repeated context
- Shadow-mode rollout for prompt changes