Skip to content

AI security

What is AI hallucination?

An AI hallucination is a confident but false or unsupported statement produced by an AI model, such as an invented fact, policy, source or number. The wrong answer usually sounds as fluent and certain as a correct one. That is the danger: people, workflows and AI agents act on it.

By the KDS security engineering teamPublished 3 min read

Key takeaways

  • Hallucinations come from how language models work: they predict likely text, so a fluent answer is not a checked fact.
  • For a business, the main risk is action: a wrong promise to a customer, a wrong record or a wrong tool call.
  • Approved sources, citations, structured outputs, checks in code and human review reduce hallucinations but do not remove them.
On this page

Why AI hallucination happens

NIST calls the problem confabulation in its Generative AI Profile, NIST AI 600-1 (opens in a new tab), and describes it as a natural result of how generative models are designed. A large language model predicts the next word from patterns in its training data. That prediction is often right, but the model does not check it against a source of truth unless the system around it does. When the facts are missing, OWASP explains, the model fills the gap with text that fits the pattern.

Errors become more likely in four situations:

  • Missing facts: the answer is not in the model's training data or in the documents it was given, such as your current prices or opening hours.
  • Outdated or conflicting sources: an old policy page in the knowledge base says something different from the current one.
  • Open or specialist questions: NIST notes that long, open-ended answers and topics that need deep expertise are more prone to errors.
  • Manipulation: OWASP notes that attackers can craft inputs that push a model into false claims.

A hallucination can also include invented reasoning or citations. NIST warns that these make a wrong answer look well supported, so people trust it more.

Why it matters for your business

A chatbot that answers wrongly causes confusion. An agent that acts on a wrong answer causes damage. The OWASP Top 10 for LLM Applications 2026 (opens in a new tab) lists misinformation as LLM07 and names the core risk: false output that someone trusts and acts on. One of its examples is a customer service agent that misreads a policy and approves a refund outside the terms.

Commitments to customers are a common form of damage: a discount that does not exist, a delivery date nobody agreed to or a refund rule the AI made up. The 2025 edition of the OWASP list (opens in a new tab) cites an airline whose chatbot gave travelers wrong information, which led to legal complications. Our post on AI agent failure modes shows how such errors appear in live agents.

How to reduce the risk

  • Ground answers in approved sources. Retrieval-augmented generation (RAG) gives the model current documents from your own knowledge base before it answers. Remove outdated pages, because the model repeats what it finds.
  • Ask for citations and check them. Show which document supports each answer, and check in code that the cited document exists and was actually retrieved.
  • Constrain the output. For prices, policies and dates, let the agent quote approved text or look up the value with a tool instead of writing it freely. Require structured output with mandatory fields.
  • Check before acting. Validate each tool call in application code: its arguments, the user's rights and the current state of the record.
  • Keep a person in the loop for high-impact steps, such as refunds, contract terms or medical and legal information.

Test with questions the AI cannot answer from its sources, and check that it says so and hands the case to a person. In our AI security projects, we also test whether a persistent customer can talk the agent into a promise outside your policy.

  • Retrieval-augmented generation: the AI looks up relevant documents from your sources and answers from them.
  • AI guardrails: controls around a model that check and limit its inputs, outputs and actions.
  • Human in the loop: a person reviews or approves the AI's work before it takes effect.

Sources

  1. 1.NIST AI 600-1, Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, NIST, 2024-07-26 (opens in a new tab)
  2. 2.OWASP Top 10 for LLM Applications 2026, OWASP GenAI Security Project, 2026-08-03 (opens in a new tab)
  3. 3.LLM09:2025 Misinformation, OWASP GenAI Security Project (opens in a new tab)

Get a free 30-minute assessment

Walk us through the AI tools and agents you use or plan to launch. We'll point out the biggest risks and the first fixes, in plain words.

Frequently asked questions

What is an AI hallucination in simple terms?

An AI hallucination is an answer from an AI tool that sounds right but is false or made up. It can be a wrong fact, an invented policy, a fake quote or a source that does not exist. The AI does not lie on purpose. It produces likely-sounding text, and sometimes that text is wrong while it still sounds certain.

Why do AI models hallucinate?

Language models generate text by predicting what is likely to come next, based on patterns in their training data. NIST describes hallucination, which it calls confabulation, as a natural result of this design. Errors become more likely when the answer is missing from the model's data or documents, when sources are outdated or conflicting and when questions are open-ended or highly specialized.

Can AI hallucinations be prevented completely?

Not completely. NIST describes them as a natural result of how generative models work, so the realistic aim is fewer errors and less harm. Ground the AI in current, approved sources and check its citations. Use approved text or tool lookups for prices and policies, check facts in code before any action runs and require a person's approval for high-impact decisions.

Does RAG stop AI hallucinations?

It reduces them but does not stop them. Retrieval-augmented generation gives the model relevant documents from your own sources before it answers, so it relies less on what it learned in training. The model can still misread a document, mix two sources or fill a gap when nothing relevant is found. Keep sources current, ask for citations and check high-impact answers.

Services and use cases

  • Customer support lead calmly reviewing a short list of escalated tickets at her desk

    Use case

    AI customer support

    AI customer support agents that resolve order, return and account questions from start to finish and hand complex cases to your team with full history.

    See how the AI support agent works
  • Service

    AI security and red teaming

    AI security consulting for AI agents and LLM apps: red teaming, prompt injection testing, shadow AI discovery and EU AI Act and ISO/IEC 42001 readiness.

    Explore AI security consulting
  • Service

    AI agent development

    Custom AI agent development for support, sales, front desk and back-office work. Voice and chat agents built and attack-tested by a cybersecurity team.

    Explore AI agent development

Free 30-minute assessment

Find the one workflow worth automating first.

Tell us how your team works. We'll come back with two or three AI opportunities, the risks to watch and a rough payback estimate. No obligation.

  • A senior engineer replies within one business day
  • We can sign an NDA before you share details
  • No fixed packages, every quote tailored to you
What can we help with?
About your company

Company size

When would you like to start?

How can we reach you?

Encrypted in transit · read only by our team · never sold

Free 30-minute AI assessmentGet it →

Before you go

Find out where AI can save your team time

Book a free 30-minute assessment. A senior engineer reviews one workflow with you and sends back the opportunities, the risks and a rough payback estimate.