CertKeen

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?

  1. A.Increase the static prompt context to include a full snapshot of the replacement library's public surface, pasted as plain text.
  2. 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.
  3. C.Lower the temperature to 0 and add the instruction "do not hallucinate."
  4. 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