First, define the kind of error
An AI can hallucinate a fact, cite a source that does not support it, invent a number, misunderstand a document, or take an unauthorized action. Each failure needs a different control. “Make it accurate” is not a test plan.
The strongest controls
- Use current, owned sources for changing facts.
- Ask for citations or supporting passages.
- Tell the model what to do when evidence is missing.
- Use structured output when fields must be complete.
- Validate numbers, IDs, and URLs in code where possible.
- Keep a human approval gate for consequential outputs.
A test that catches false confidence
Give the system a question whose answer is not in its source set. A reliable system should say it cannot verify the answer. If it produces a polished guess, the problem is not solved by making the prompt sound more authoritative.
What not to promise
No model, retrieval system, or prompt can guarantee zero hallucinations. A useful product makes the remaining uncertainty visible, reduces the cost of checking, and fails safely when it lacks evidence.