AI and Automation

Reducing hallucinations in production AI features

Models can state things that are false with confidence. Limit the risk by constraining the task, grounding answers and checking outputs.

Nov 29, 2026 2 min read

AI models can produce statements that sound correct but are not supported by the source or by reality. This behaviour is called hallucination. In a demo it is an amusing curiosity. In production, a made-up price, policy or legal clause can cause real harm to customers and to the business.

Reducing hallucinations is less about one setting and more about designing the system so that the model has less room to invent.

Constrain the task

The more open the question, the more likely the model is to fill gaps with guesses. Narrow the task. Ask the model to choose from a list, extract a field from a document or answer only from a supplied passage. Tasks with a clear boundary are easier to verify.

Ground the answer in sources

Provide the relevant documents with the request, and instruct the model to use only that material. Ask it to cite the passage it used. If the information is not in the sources, the model should say so. This approach, often combined with retrieval, reduces invented facts considerably.

Give the model permission to say "I do not know"

Models tend to answer even when they should not. Make refusal an explicit and acceptable outcome in your instructions, and test it. Include examples of questions that have no answer in the source, and check that the system declines them.

Verify the output

Where possible, check the output automatically. If the model proposes a product code, check it exists. If it proposes a date, check it is in the expected range. If it quotes a passage, check the passage appears in the source. Automated checks catch many errors before a person has to.

Route uncertain cases to people

Use confidence signals, such as the presence of a supporting source or the result of a verification check, to decide what happens next. Low-confidence answers go to a person. High-confidence answers from a narrow task may be published with sampling.

Measure the error rate

Build a test set of realistic questions with known answers, including traps where the correct answer is no answer. Track the rate of unsupported statements over time. Hallucination rates vary by task, so measure the tasks you actually run.

Accept that some risk remains

No system eliminates all errors. The goal is to make errors rare, visible and cheap to fix. Design the product so that a wrong answer is caught before it causes harm.

Want this done for your business?

Tell us what you are working on. You can book a call with a tech lead, contact us to hire a developer for a fixed scope, or let us solve the problem end to end.

Talk to a tech lead

Share this article