AI hallucinations are confident, plausible answers that are not true. You cannot remove them, but you can make them rare and catchable: narrow what the bot is allowed to answer, ground every answer in retrieved passages with citations, give it permission to say it does not know, call a tool for any number or date, and test against a fixed question set before you ship.
A hallucination is a plausible falsehood: an output that reads like a fact and is wrong. The paper Why Language Models Hallucinate, by Adam Tauman Kalai, Ofir Nachum, Santosh S. Vempala and Edwin Zhang, describes a model that guesses when it is uncertain, "producing plausible yet incorrect statements instead of admitting uncertainty". That is not a flaw in one product, but what a system trained to predict likely text does when it has no facts to work from. Every source below was read on 14 November 2026.
Why does an AI chatbot make things up?
Because guessing scores better than admitting uncertainty, in how models are trained and in how they are graded. Three of that paper's four authors give OpenAI as their affiliation, and the argument is blunt: "language models hallucinate because the training and evaluation procedures reward guessing over acknowledging uncertainty".
In pretraining, errors appear "even if the training data were error-free". For facts with no pattern behind them, the authors recover an earlier bound: "if 20% of birthday facts appear exactly once in the pretraining data, then one expects base models to hallucinate on at least 20% of birthday facts". Post-training does not train the habit out, because the benchmarks that rank models give a point for a correct answer and nothing for an "I don't know". Under that rule "abstaining is strictly sub-optimal", so a model that always guesses outscores an honest one.
| Of the ten benchmarks in Table 2 of the paper | Count | What it means for you |
|---|---|---|
| Primary metric is binary, right or wrong | 9 | A guess costs nothing, so guessing is the trained reflex |
| Graded by a language model | 4 | A confident bluff can be scored as correct |
| Give any credit for "I don't know" | 1 | One rubric gives partial credit, and the paper's own note says an honest "I don't know" can still score below a confident wrong answer |
The paper's other causes are worth knowing because each one points at a different control: arbitrary facts with no pattern in the data, poor models for the task such as counting characters in tokenized text, garbage in and garbage out from errors in the source documents, and prompts unlike anything in training. So the job is not to find a model that never invents. It is to build a system where inventing is hard, visible and cheap to catch.
Which questions should the bot be allowed to answer?
Write that list before you write the prompt, and refuse everything outside it. A bot that answers three things well beats one that attempts everything, because every extra topic is another chance to invent.
I keep the list concrete: order and invoice status, what a plan includes, how to do a named task in the product, where to find a document. Refunds, legal rights, medical or financial decisions and custom prices go to a person. Anthropic's guide to success criteria adds that the bar is local: "strong citation accuracy might be critical for medical apps but less so for casual chatbots". My guide on adding an AI chatbot to a website covers the rest of the launch decisions.
How do you ground answers in your own documents?
Retrieve the relevant passages first, put them in the prompt, and instruct the model to answer only from them. That is retrieval-augmented generation, and I explain the machinery in what a RAG chatbot is. Three details do most of the work against hallucinations.
Quote before you answer. Anthropic's Reduce hallucinations guide says that for long documents, over 20,000 tokens, you should ask the model to "extract word-for-word quotes first before performing its task", then analyze only those quotes, stating "No relevant quotes found" when there are none.
Restrict outside knowledge. The same page lists "External knowledge restriction": tell the model to use only the supplied documents, not its general knowledge. Without that line, a thin retrieval result gets topped up from memory, which is where invention starts.
Return citations as data, not as prose. Anthropic's citations feature chunks documents into sentences and returns the passages behind each claim, with character ranges for text and page ranges for PDFs. The docs say those citations "are guaranteed to contain valid pointers to the provided documents", and the returned cited_text does not count toward output tokens. Show the citation in the chat: a wrong answer then becomes a reproducible bug with a page behind it.
How do you get the bot to say it does not know?
Give it explicit permission in the system prompt, with the exact words you want. Anthropic's first listed technique is to "Allow Claude to say 'I don't know'", with an example instruction of: "If you're unsure about any aspect or if the report lacks necessary information, say 'I don't have enough information to confidently assess this.'" The guide says this "can drastically reduce false information".
Permission alone is not enough, because the model still wants to be useful. Three things make a refusal real:
- A retrieval threshold. If the best matching passage scores below your cut-off, do not ask the model for an answer at all. Return the refusal and the handover.
- A confidence target in the instructions. The paper asks evaluations to state the bar in the prompt: answer only above a stated confidence, with a wrong answer penalized and "I don't know" scored zero. It gives 0.5, 0.75 and 0.9 as natural thresholds. Written for benchmarks, the same line works in a system prompt when wrong answers cost money.
- A refusal that is useful. "I could not find that in our documentation", plus a search link and a button to a person. Measure how often it fires: a bot refusing a third of real questions has a content problem, not a model problem.
The same guide suggests a check on the way out: after drafting, the model finds a supporting quote for each claim and drops any claim it cannot support.
How do you stop it inventing numbers, dates and prices?
Never let the model produce them from memory. Every figure a customer could act on should come from a tool call into your own system, with the model only putting the returned value in a sentence.
Tool use, also called function calling, is a round trip, as Anthropic's tool use overview sets out: you define a tool with an input schema, the model returns a tool_use block naming the tool and its arguments, your code runs the real lookup, and you send the value back in a tool_result block. The lookup is ordinary code, so the number is as correct as your database.
Two settings tighten that. Strict tool use, strict: true, guarantees schema validation on tool names and inputs, so you never get a call to a tool that does not exist or an argument of the wrong type. Structured outputs constrain the reply itself to a JSON schema by constrained decoding, which the structured outputs documentation sums up as "Always valid: No JSON parsing errors". A fixed shape also stops the model adding an extra sentence nobody verified.
One trap: citations and structured outputs cannot be used in the same request. The citations page says enabling citations on a document while sending output_config.format returns a 400 error. The documented way round it is to ask for one line per field, cite each line, and parse the lines in your code. The same patterns apply to agents that act rather than answer, covered in how to build an AI agent.
How do you test for hallucinations before you ship?
Build a fixed question set with expected answers, run it on every change, and score refusals separately from wrong answers. Without that you cannot tell whether a prompt edit helped or just moved the failures.
Anthropic's guidance on building evaluations is practical: design evals that "mirror your real-world task distribution", automate the grading, and "Prioritize volume over quality". Copy its edge cases too, including irrelevant or nonexistent input and ambiguous cases "where even humans would find it hard to reach an assessment consensus". I build the set from real chat logs and score five outcomes, not two. An eval that gives zero for "I don't know" tunes your bot into a confident guesser, exactly as the benchmarks did.
| Outcome | Score | What a rise in it tells you |
|---|---|---|
| Correct, right source cited | Full credit | Nothing to do |
| Correct, wrong passage cited | Partial, logged | Weak retrieval, or chunks too big |
| Refused, answer not in the sources | Full credit | Working as designed |
| Refused, answer was in the sources | No credit | A content gap, not a model fault |
| Wrong and confident | Negative, blocks release | The failure you are hunting |
Run it before launch and after every prompt change, re-index or model change, and keep the questions in version control next to the prompt.
A short checklist before you turn it on:
- The scope list is written down, and everything outside it has a refusal path.
- The system prompt answers only from the supplied documents, and gives the wording for "I don't know".
- Citations come back as data and are shown in the chat.
- Every price, date, balance and total comes from a tool call.
- The eval set has edge cases and credits a correct refusal.
- Conversations are logged with the passages used, and somebody reads the bad ones weekly.
- High-stakes answers reach a person first.
Which answers should a person check before they are sent?
Any answer that commits you to money, to a legal position, or to a promise about what the customer may do next. The cost of being wrong is yours, and a tribunal has already said so.
In Moffatt v. Air Canada, 2024 BCCRT 149, British Columbia's Civil Resolution Tribunal held the airline responsible for what its website chatbot told a customer about bereavement fares. I read the tribunal's written reasons, issued 14 February 2024 in file SC-2023-005609, on 14 November 2026; CBC's report is the easiest public account of them. Air Canada argued, in the tribunal's words, that the chatbot "is a separate legal entity that is responsible for its own actions". Tribunal member Christopher C. Rivers called that "a remarkable submission" and wrote: "It should be obvious to Air Canada that it is responsible for all the information on its website. It makes no difference whether the information comes from a static page or a chatbot." He found the airline "did not take reasonable care to ensure its chatbot was accurate", and refused to excuse the bot because the correct policy sat on another page of the site. Air Canada was ordered to pay $812.02 in Canadian dollars: $650.88 in damages, $36.14 in pre-judgment interest and $125 in tribunal fees. The chatbot's answer even linked to the correct page and still contradicted it, so linking a source is not the same as answering from it.
In words: if the answer is not quoted from a source you control, refuse it and offer a person. If it states a price, a date or a balance, read that value from your system instead of generating it. If a wrong answer would cost money or break a rule, queue it for a person. Everything else goes out with its citation attached. For an agent that acts rather than answers, the same gate sits in front of the action.
What does none of this fix?
It does not get you to zero, and anyone promising that is selling something. Anthropic's guidance ends on the same note: "although these techniques significantly reduce hallucinations, they don't eliminate them entirely. Always validate critical information, especially for high-stakes decisions."
- Retrieval is not a cure. The paper is explicit that its argument "holds for arbitrary language models, including those with RAG", because the incentive to guess survives when search returns nothing useful.
- Some errors are not knowledge errors. Counting and arithmetic fail for reasons no document fixes. Do them in code.
- Every control costs latency and money. Quote extraction, a verification pass and a tool call are more tokens and more round trips.
- The content is usually the real problem. Most wrong answers I trace end at a contradictory or out-of-date page, a content job rather than an AI one.
What else do people ask about reducing AI hallucinations?
What is an example of an AI hallucination?
The paper records two that are small and checkable: asked three times for one of the authors' birthdays, a model gave three different wrong dates; asked for his dissertation title, three models returned three different titles and three different years, none correct. In a business bot it looks the same: an invented refund window, a renewal date that is close but wrong, a policy clause nobody wrote.
Can AI hallucinations be prevented completely?
No. You can make them rare, shallow and traceable. The research above traces them to the statistics of training and to grading that rewards guessing, and Anthropic's guidance says plainly that these techniques do not eliminate them entirely. Design for catching them, not for their absence.
How do you reduce hallucinations in AI agents specifically?
Put the gate in front of the action, not the text. An agent that can refund, cancel or edit a record needs a tool call for every fact it uses, a schema it cannot deviate from, a confirmation step for anything irreversible, and a log of what it did with which inputs. A wrong sentence is embarrassing, a wrong action is expensive.
Who is liable when a chatbot gives a customer wrong information?
I am not a lawyer and this is not legal advice. What the Air Canada decision shows is that a tribunal was willing to treat the chatbot as part of the company's website and hold the company to what it said. Assume you own your bot's answers.
If you want this built or reviewed on your own site, I take the work as AI chatbot development or AI agent development, with a free scoping call of about 30 minutes and a written quote within one business day.
Last reviewed 14 November 2026. Disclosure: I build AI chatbots and AI agents for a living, so I am not neutral. I am CTO at ElySpace, a freelance developer for Marmaids LLC, founder of WHMCSPilot, and founder of MagizAI, an AI chat product of my own, which is an interest to weigh when I recommend these controls. Sources read on 14 November 2026: the linked pages above, plus the tribunal's reasons in Moffatt v. Air Canada, 2024 BCCRT 149.