LLM hallucinations: 8 types with real examples, and how to catch them
Eight LLM hallucination examples from a courtroom, an airline, a search engine and coding agents, one for each type, with the check that catches it before release and on live traffic.
Manouk Draisma · · LLM Evals
Short answer: An LLM hallucination is a confident answer that the facts, the sources or the tool results don't support. The 8 types run from made-up facts and fake citations to agents reporting actions they never took. Each type needs its own check.
We first wrote this list in 2024, when the hallucinations people worried about came from a chatbot answering over a knowledge base. Agents now call tools, keep memory and run for many turns, so they also invent tool results and things they say they did. The 8 types below keep the retrieval problems from the first version and add the ones agents brought.
What is an LLM hallucination?
An LLM hallucination is output that sounds right but has no support in the model's training data, the documents you gave it or the tools it called. A language model predicts likely text, and a likely sentence can still be false, so it writes a made-up refund policy in the same confident tone as a real one.
So for every claim, ask what it should have matched. A claim from the model's memory can only be checked against a reference answer. A claim about your documents can be checked against what retrieval returned, and a claim about an order or an action can be checked against the tool calls in the trace.
| # | Type | Real example | How to catch it |
|---|---|---|---|
| 1 | Made-up facts | Bard's launch demo, 2023 | Expected answers in a dataset, or give the model a source |
| 2 | Fake citations | Mata v. Avianca, 2023 | Look up every citation in code |
| 3 | Contradicting the context | Air Canada's chatbot, 2024 | Faithfulness against the retrieved contexts |
| 4 | Filling a gap | Cursor's support bot, 2025 | Retrieval recall, and tests where search finds nothing |
| 5 | Repeating a bad source | Google AI Overviews, 2024 | Retrieval precision, and fixing the source |
| 6 | Adding what the input never said | Whisper transcripts, 2024 | A judge that compares the output with its input |
| 7 | Invented packages and APIs | Package hallucination study, 2025 | Resolve imports, run the code |
| 8 | Invented tool results and actions | Replit's coding agent, 2025 | A judge that reads the trace |
The 8 types of LLM hallucinations, with real examples
1. Made-up facts
The model answers from its training data and gets a fact wrong. In February 2023, Google's own demo of Bard said the James Webb Space Telescope took the very first pictures of a planet outside our solar system. Astronomers pointed out that the first image of an exoplanet was from 2004 (The Verge), and Alphabet shares lost about $100 billion in value (NPR).
You can't check a fact against nothing. Before release, keep a dataset of questions with the right answers and run LLM Factual Match, which checks that the facts in the output match the expected output. In the product, give the model the source through retrieval or a tool, which turns this type into types 3 to 5, and those you can check on every answer.
2. Fake citations and sources
The model invents a reference that looks real. In Mata v. Avianca, two New York lawyers filed a brief with court cases ChatGPT had made up. The judge fined them and their firm $5,000 and ordered them to tell each judge falsely named as the author of a fake ruling (CNBC).
Don't ask an LLM whether a citation exists. Look it up in code: every case number, document id or URL in the answer has to exist in your index. Then send the result to LangWatch next to the trace, with custom scoring:
import langwatch
@langwatch.trace()
def answer_with_sources(question: str):
answer = my_rag_answer(question) # your pipeline
missing = [c for c in answer.citations if c not in document_index]
langwatch.get_current_span().add_evaluation(
name="citations_exist",
passed=not missing,
details=f"not in the index: {missing}" if missing else "all found",
)
return answer
3. Contradicting the context it was given
The model has the right document and still says something else. In February 2024, Air Canada's chatbot told a grieving passenger they could book a full fare and claim the bereavement rate within 90 days. The airline's own bereavement page said those rates don't apply to completed travel. Air Canada argued the chatbot was "a separate legal entity that is responsible for its own actions", and a British Columbia tribunal called that "a remarkable submission" and ordered the airline to pay $812 (CBC).
Use a faithfulness score for this type. Ragas Faithfulness, from our list of evaluators, measures how consistent the output is with the retrieved contexts, and it runs in your code with the contexts you already have:
result = langwatch.evaluation.evaluate(
"ragas/faithfulness",
name="Faithfulness Check",
data={"input": user_input, "output": output, "contexts": contexts},
)
4. Filling a gap with something plausible
The model has no source for the answer and gives one anyway. In April 2025, users of the code editor Cursor got logged out whenever they switched machines, and when one of them wrote to support, an agent called "Sam" replied that "Cursor is designed to work with one device per subscription as a core security feature." No such policy existed, Sam was a bot, and users posted their cancellations on Reddit before the company called it "an incorrect response from a front-line AI support bot" (Ars Technica).
The first version of this post called it a context deficit, and the checks it suggested still hold. Measure retrieval recall on a dataset (Ragas Response Context Recall checks how much of the expected answer the retrieved contexts cover), and write a test for the question your documents can't answer, where the pass is "says it doesn't know" or a handover to a person. On live traffic, an LLM-as-a-Judge can check "the reply states a policy that none of the retrieved documents contain".
5. Repeating a bad source faithfully
Here the model does exactly what it was told, and the source is wrong. In May 2024, Google's AI Overviews told people who wanted cheese to stick to their pizza to add "non-toxic glue", and said geologists recommend eating one rock per day. Some of those answers appeared to come from Reddit comments and articles from the satirical site The Onion (BBC).
A faithfulness check passes this one, because the answer matches its context. The fix sits before the model: measure retrieval precision (Ragas Response Context Precision), decide which sources may enter the index at all, and check your knowledge base for pages that are out of date or wrong. Our old advice holds here too: compare answers with expected responses on a sample, and keep the knowledge base complete.
6. Adding what the input never said
Summaries, transcripts and extraction have one source, the input, and the model adds to it. In October 2024 the AP reported that OpenAI's Whisper transcription model invents text that speakers never said, in tools that hospitals use. A University of Michigan researcher found false text in 80 percent of the public meeting transcripts examined (Wired).
Check the output against the input only. Pass the source document as the contexts to a faithfulness check, or write an LLM-as-a-Judge Boolean with "every statement in the summary appears in the source". For extraction, check in code that each extracted value appears in the document.
7. Invented packages, functions and APIs
Code models import libraries that don't exist. A study of 16 code models, accepted at USENIX Security 2025, found that on average at least 5% of the packages commercial models suggested were hallucinated, and nearly 22% for open-source models (arXiv). That's about one package in twenty from the better models, and the authors call it a new form of package confusion attack, because anyone can publish a package under a name the models keep inventing.
This one doesn't need a judge, since code can check it: resolve every import against the package registry and your lockfile, then run the code and its tests.
8. Invented tool results and actions
Agents brought this type: the agent reports a tool result it never got, or an action it never took. In July 2025, Replit's coding agent deleted a live database during a code freeze, then told the user a rollback would not work. He got the data back anyway (Fortune). The everyday version is a support agent writing "your order is cancelled" without ever calling the cancel tool.
The reply text can't show this, so the check has to read the trace. When you set up an LLM-as-a-Judge monitor in LangWatch, its input is the full trace by default: every span, with tool calls, their arguments and their results. A criterion like "every action the reply says it took matches a tool call that succeeded" catches it. In tests, assert on the tool calls directly.
Why agents hallucinate in new ways (tool results, memory)
An agent's context fills up with text it fetched or wrote itself: tool results, its own earlier turns and memory. Any of it can be empty, wrong or stale, and the model reads it as true, which gives agents four new ways to hallucinate. The check is the same for all four: find the span that backs each claim.
- Empty or failed tool results. The order lookup times out or returns
{"error": "order not found"}, and the agent answers with a delivery date anyway. This is type 4 again, with a tool instead of a search index. - Long tool results. The tool returns twenty orders and the agent reads the date of the wrong one. Faithfulness can pass, since the date is in the context.
- Its own earlier turns. A wrong claim on turn two is context on turn six, and the agent builds on it. A Thread Level monitor in LangWatch catches it, because its judge reads the whole thread with the agent's tool calls, arguments and results between the turns.
- Memory. A wrong fact saved to memory gets read back in every later session as if a user had said it. Check what goes into memory the same way you check a reply.
How to detect hallucinations on live traffic
Monitors, guardrails and Instant Evals each catch hallucinations at a different moment: after the response, before it reaches the user, and across your whole history.
1. Monitors, after the response
Monitors are online evaluations: an evaluator on your production traces, with Ragas Faithfulness on the RAG answers and an LLM-as-a-Judge on the full trace for types 4 and 8. A monitor runs after the response is sent, so it never slows a user down. Thread Level monitors wait until the conversation has been idle, five minutes by default, and then judge it whole. An automation can add every trace a monitor failed to a dataset, which becomes your next test set.
2. Guardrails, before the user sees it
Guardrails run inside your request and block the response when the check fails. Use them for the hallucination that would cost you money or trust if a user saw it, like a refund promise or a dosage, and accept the latency, because an LLM judge as a guardrail is slower than a regex. A saved evaluator works as a guardrail:
check = langwatch.evaluation.evaluate(
"evaluators/refund-promise-check", # your saved LLM-as-a-Judge evaluator
name="Refund promise check",
data={"input": user_input, "output": response},
as_guardrail=True,
)
if not check.passed:
return "Let me check that with a colleague before I promise anything."
3. Instant Evals, across your whole history
Instant Evals are for the question you only thought of today. They judge every row in a time window, not a sample, at about a minute per 10,000 conversations, and the traces target reads each trace's tool calls and model calls. Start on a hundred rows and read what the judge saw before you run wide:
langwatch instant-eval run "the agent states an order status or a delivery date that no tool call returned" --target traces --last 30d --limit 100
Watch the opposite failure too: a bot that turns down questions it should have answered. A prompt you tighten against hallucinations can drift that way, so judge both.
How do I evaluate my LLM application before shipping to production?
Run three kinds of checks on every change: a dataset with expected answers for the facts, faithfulness and retrieval scores for the RAG steps, and simulated conversations for the agent, including ones where a tool returns nothing. Then gate the release on them in CI.
The dataset is where types 1, 3 and 5 get caught, and it doesn't need to be big or perfect on day one. Build it from your production traces (how to start evals when you have no dataset), with LLM Factual Match for the answers and the Ragas scores for retrieval.
The agent types need conversations. One team building an airport chatbot thought it was nearly done, until someone asked whether a parking ticket bought for Terminal A also works in Terminal B. The bot said yes, sure you can, and the terminals charge different rates. No test had that question, and a simulated user playing a traveler would have asked it.
For type 8 you also want a test where the tool fails on purpose. Scenario, the open-source agent testing framework we build at LangWatch, lets you put the tool result in the script with scenario.message(), adapted here from its tool calling guide:
import pytest
import scenario
class SupportAgent(scenario.AgentAdapter):
async def call(self, input: scenario.AgentInput) -> scenario.AgentReturnTypes:
return await my_support_agent(input.messages) # your agent
@pytest.mark.agent_test
@pytest.mark.asyncio
async def test_order_not_found():
result = await scenario.run(
name="order lookup finds nothing",
description="The customer asks where order ORD999 is. The order does not exist.",
agents=[SupportAgent(), scenario.UserSimulatorAgent(), scenario.JudgeAgent()],
script=[
scenario.message({"role": "user", "content": "where is my order ORD999?"}),
scenario.message({
"role": "assistant",
"content": None,
"tool_calls": [{
"id": "call_1",
"type": "function",
"function": {"name": "get_order_status", "arguments": '{"order_id": "ORD999"}'},
}],
}),
scenario.message({
"role": "tool",
"tool_call_id": "call_1",
"content": '{"error": "order not found"}',
}),
scenario.agent(),
scenario.judge(criteria=[
"Agent says it could not find the order",
"Agent does not give a delivery date or an order status",
]),
],
)
assert result.success
Our guide on how to test AI agents covers running these in CI. Start with the types that would cost you the most. For a support agent that's usually contradicting the context, filling a gap and invented actions, and the order-not-found test above is a good first one.
Put this into production with LangWatch.
Trace your agents, run evaluations, and turn failures into repeatable tests.
Frequently asked questions
- What are LLM hallucinations?
- An LLM hallucination is a confident answer that nothing backs up: not the facts, not the documents the model was given, and not the results of the tools it called. A language model predicts likely text, and a likely sentence can be false, so a made-up policy comes out in the same tone as a real one.
- What are some real examples of LLM hallucinations?
- Lawyers in Mata v. Avianca were fined $5,000 for filing a brief with court cases ChatGPT made up. An Air Canada chatbot promised a bereavement refund the airline's own page ruled out, and a tribunal made the airline pay. Google's AI Overviews told people to put glue on pizza, from a joke on Reddit. A coding agent at Replit told its user a database rollback would not work, and it did.
- What causes LLM hallucinations?
- The model fills in what it does not have. That happens when retrieval returns nothing relevant, when a source is wrong or out of date, when a tool fails and the agent answers anyway, when a long context buries the right fact, and when the question is about something the model never saw. Each cause points to a different check.
- Can you stop LLM hallucinations completely?
- No. You can make them rarer with better retrieval, clear instructions to say 'I don't know', and tools for facts the model should not recall from memory. Then you catch the rest: faithfulness and trace checks in tests before release, monitors on live traffic, and guardrails for the claims that must never reach a user.
- How do you detect hallucinations in production?
- Run monitors on your live traces: a faithfulness evaluator on RAG answers, and an LLM-as-a-judge that reads the whole trace, tool calls included, to check that every claim in the reply comes from a document or a tool result. Block the dangerous ones with a guardrail before the user sees them, and ask new questions of your whole history with Instant Evals.