How to prevent AI hallucinations: grounded prompts
Free prompt courseLesson 8 of 227 minVideoGo to the lesson
Guide
3 min
- Plain English
The short answer
You can't stop a model hallucinating completely, but a grounded prompt cuts it sharply. Paste the source text, tell the AI to answer only from it, make it quote the line it used after each answer, and give it an exact phrase to use when the text doesn't say. Then check the quotes yourself.

Why does AI make things up instead of saying it doesn't know?
AI makes things up instead of saying it doesn't know when a model writes the most likely next words without having the fact, so a gap turns into a confident invention. The cause is next-word prediction: likely words still read fluent and sure of themselves. An AI hallucination takes a few common forms, such as an invented clause that isn't in your contract, a fake citation to a study nobody wrote, or a stale price from last year. The model isn't lying. It's predicting text, and when the fact it needed isn't there, the prediction is a guess dressed as an answer.
So the cure sits in two places: the facts you hand over, and the permission you give it to say the answer isn't there. Can a hallucination be removed for good? No. A grounded prompt makes it rarer and far easier to catch, and that's the honest goal of this lesson.
What are the four rules of a grounded prompt against hallucinations?
The four rules of a grounded prompt are paste the source, limit the AI to it, make it quote the line it used and give it an exact phrase for anything the source doesn't cover. The four named rules are each tied to one gap the model would otherwise fill with a guess. To turn the four rules into standing rules for every chat, write them into the system instructions generator, then test the result with 3 inputs, one of them a question your document can't answer.
- Pasted source. Put the document, notes or data in the prompt, fenced with triple quotes or tags, so the AI can tell it apart from your instructions.
- Use-only rule. Write "use only the text between the triple quotes" and "don't use outside knowledge".
- Quote per answer. Ask for the exact line it used, in brackets, after each answer. You can find a quote in the source in seconds; you can't check a paraphrase that fast.
- Way-out phrase. Give it a fixed phrase such as "Not in the document" for questions the source doesn't answer. Without one, the model tends to fill the gap.
What did the tested grounded prompt return for an unanswerable question?
The tested grounded prompt returned the way-out phrase "Not in the document" for the question the source didn't answer, instead of a guess. We gave it a four-clause tenancy agreement and three questions. Two had answers in the text, and each came back with the matching clause quoted word for word. The third asked whether the rent would go up next year, which the agreement never mentions, and the reply was the way-out phrase and nothing else. That third question is the one to copy: always include at least one question your source can't answer, so you'll see whether the way out works before you trust the rest.
How to prevent AI hallucinations before and after
The same request, asked two ways. Read the second one slowly. Each line does a job.
Here's my tenancy agreement. Can I get a dog, and is my rent going up next year?
Answer my questions using only the tenancy agreement between the triple quotes. After each answer, quote the exact line you used in brackets. If the agreement doesn't answer a question, write "Not in the document" and nothing else. Don't use outside knowledge about tenancy law.
Why it works
The first version invites the model to fill gaps with general knowledge, so "is my rent going up?" may get a confident guess. The grounded version limits it to the text, makes every claim checkable with a quote, and gives it a safe answer when the text is silent.
How to prevent AI hallucinations examples
Grounded questions about any document
Every answer is either quoted or openly marked as missing, so nothing is left to trust blindly.
Answer my questions using only the document between the triple quotes. After each answer, quote the exact line you used in brackets. If the document doesn't answer a question, write "Not in the document" for that question and nothing else. Don't use outside knowledge. Document: """ {{document}} """ Questions: {{questions}} Return a numbered list, one answer per question.
How to use
- Copy it with the button above.
- Fill the blanks in {{double braces}} with your own details.
- Paste it into ChatGPT, Claude or Gemini and send it.
- Then follow up: ask for one change at a time.
Before you run “Grounded questions about any document” for the first time, the lesson on how to use AI prompts step by step walks through copying, filling and sending it.
When you can't paste a source: flag what's unverified
Turns the model's uncertainty into a checklist instead of hiding it inside confident prose.
Answer this question: {{question}}
For each claim you make, add a tag: [known] if it's well established and unlikely to have changed, or [unverified] if you're not sure, it may be out of date, or it depends on details I haven't given. Don't invent sources, studies or numbers. If a number would help but you don't know it, say so instead of estimating. End with a list of the [unverified] claims I should check, and where I could check each one.Lesson 8 of 22Structure7 min
Lesson: Prevent hallucinations with grounding
A grounded prompt answers only from text you supply, quotes the line it used and says "Not in the document" when the text is silent. It won't make an AI perfect, but it makes made-up answers rare and easy to catch.
Use it when
- You're asking about a contract, policy, report or notes you can paste.
- A wrong fact would cost money, time or trust.
- You need to show where each answer came from.
Skip it when
- You want ideas or a draft, not facts.
- The answer needs current information you can't paste: use a search-connected AI and ask for links instead.
## Role You are a careful assistant who answers only from the document I give you. ## Task Answer my three questions about the tenancy agreement below. ## Rules Use only the text between the triple quotes. After each answer, quote the exact line you used in brackets. If the text doesn't answer a question, write "Not in the document" and nothing else for that question. Don't use outside knowledge about tenancy law. ## Document """ Clause 4. Rent is 950 pounds per calendar month, due on the 1st of each month by bank transfer. Clause 7. The tenant may keep one cat or one small dog with the landlord's written consent. Clause 9. Either party may end the tenancy with two months' written notice after the first 12 months. Clause 11. The landlord will return the deposit within 10 days of the end of the tenancy, minus any agreed deductions. """ ## Questions 1. Can I have a dog? 2. How much notice do I need to give to leave after 14 months? 3. Is the rent going up next year? ## Output format A numbered list, one answer per question, each followed by its quote in brackets. ## Checklist - Every answer has a quote, or says Not in the document. - No fact appears that isn't in the Document.
1. Yes, but only with the landlord's written consent, and the tenant may keep only one cat or one small dog. [Clause 7. The tenant may keep one cat or one small dog with the landlord's written consent.] 2. Two months' written notice. [Clause 9. Either party may end the tenancy with two months' written notice after the first 12 months.] 3. Not in the document
What to notice: The third question is the test. The agreement says nothing about rent rises, and the model didn't guess or fall back on general tenancy law. Both quotes match the clauses word for word, so you can check each answer in seconds.
Try it in Prompt StudioOpens the studio with the Grounded technique already selected.
Quick check: 3 questions
Practice: write your own
Write a grounded prompt for a document of your own: a policy, a contract, meeting notes. Paste a short sample, ask at least 2 questions, including one the document can't answer.
Prompt Studio's rubric scores it right here. Nothing's sent anywhere.
Your progress is saved in this browser only. No sign-up.
Which habits reduce AI hallucinations besides grounding?
4 habits reduce AI hallucinations besides grounding: ask for less, flag assumptions, use a search-connected AI with a link per claim and check the answers yourself.
- Ask for less. Three questions in one prompt are easier to check than fifteen, and each answer gets more of the model's attention.
- Flag assumptions. Where you can't paste a source, add "mark anything you're not sure of as unverified".
- Use a search-connected AI for current facts, and ask for a link per claim. That's the fix for a fake citation too: models invent sources when no real one is to hand, so check each one by opening the link before you repeat it.
- Check the answers. Read each quote against the source; a grounded reply makes this quick, but it doesn't make it optional.
Long documents need one more habit: split the job into two prompts. The first pulls the passages that matter, the second answers only from those passages, and the model never has to hold a whole long document at once.
Grounding pairs well with two neighbouring lessons. A model that asks you for missing facts before it starts is the flipped interaction prompt, and the inputs part that holds your pasted source is one of the eight elements of a prompt. Both sit in the free prompt course.
How to prevent AI hallucinations FAQ
Still stuck? Build it in Prompt Studio. It'll score each part as you go.
Can you stop AI hallucinations completely?
No, you can't stop AI hallucinations completely; every current language model can still give a confident wrong answer, so grounding shrinks the gaps it fills. Give it the facts, limit it to them, ask for quotes or links and give it a fixed way to say the answer isn't there. Then check what comes back.
Why does ChatGPT make up sources?
ChatGPT makes up sources when it has no real source to hand and a citation is a likely part of the answer, so it writes a convincing fake one. The title and the author look right; the paper doesn't exist. Ask for links only in a search-connected mode, and open each one before you use it.
What's the best prompt to reduce AI hallucinations?
The best prompt to reduce AI hallucinations pastes your source, says use only this text, asks for the exact line after each answer and gives a fixed phrase for gaps, such as Not in the document. The tested prompt in this lesson does all four, and its unanswerable question got the fixed phrase.