The full answer
You cannot remove hallucinations, but you can make them rare and catchable. Ground the model in your own sources, allow it to say "I don't know", make it quote and cite what each claim rests on, check the claims in code or with a second pass, and keep a person in the loop where a wrong answer is costly.
1. Ground it
Give the model the facts it needs (retrieval, a database lookup, a tool call) instead of relying on what it remembers. Instruct it to use only the provided documents, not general knowledge. Anthropic's guide lists this as external knowledge restriction.
2. Allow uncertainty
Explicitly tell the model it may answer "I don't have enough information to answer that". Anthropic's guide calls this simple permission one of the most effective fixes. Then make sure your product handles that answer well, for example by offering a search or a human hand-off.
3. Quotes first, then the answer
For long documents (the guide says over about 20,000 tokens), ask the model to extract the exact quotes that bear on the question first, then answer from those quotes only. This keeps it tied to the text.
4. Cite, and retract what cannot be cited
Ask for a citation for every claim, then a check: for each claim, find a supporting quote; if none exists, remove the claim. The Claude API's Citations feature returns the exact source passages for each part of an answer, so your interface can show them and your code can verify them.
5. Check the output
- Deterministic checks: numbers, ids, dates and names in the answer must appear in the sources or the database.
- Consistency: run the same question several times. Answers that disagree suggest the model is guessing (best-of-N verification).
- A second model checks faithfulness: are all claims supported by the context?
6. Design the product around it
- Show sources next to answers so users can verify.
- Use structured outputs for data, so there are no invented fields.
- Send high-stakes answers (medical, legal, financial, actions on accounts) to a person (human in the loop).
7. Measure it
Track a faithfulness score and the rate of "I don't know" on a fixed evaluation set. A falling hallucination rate with rising refusals may just mean the model got timid, so look at both. OWASP lists misinformation among its top 10 risks for LLM applications, which is why this belongs in testing, not only prompting.
What not to say
"Set temperature to 0." It makes output more repeatable, not more true, and several current models no longer accept a non-default temperature at all.
Last updated 16 October 2026
Sources