Have you ever asked an AI a question, received a polished, confident answer… and later found out half of it was made up? A law that does not exist, a number without a source, a code function that was never written.
There is a name for that: hallucination. And the good news is you can cut it down significantly with just a few lines in your prompt.
In this post, you will learn 4 guardrails I use every day — all with ready-to-copy prompts.
Why does AI make things up?
AI does not lie on purpose. A language model works by predicting the most probable continuation of a text. When it does not have the information, it does not stop: it fills the gap with whatever sounds right.
And that is the catch: sounding right is not the same as being right.
Another factor is that models are trained to be helpful and agreeable. Answering “I don’t know” is usually less natural for them than delivering an answer. The guardrails below exist to change that behavior.
Guardrail 1: Allow “I don’t know”
The simplest way to reduce guesswork is to give the AI explicit permission to admit when it does not know.
Prompt:
If you are not sure, answer "I don't know". Do not fill in gaps with assumptions.
- Why it works: because AI tends to please, it prefers giving you something over leaving you empty-handed. When you allow “I don’t know”, an honest answer stops feeling like a failure and becomes a valid option.
- When to use: factual questions, dates, names, numbers, legislation.
Guardrail 2: Only use what I gave you
Instead of letting the AI pull from memory, you hand it the source and force it to stay inside those boundaries.
Prompt:
Answer only based on the text below. If the answer is not in it, say "not stated in the text".
[paste your text, contract, article, or documentation here]
- Why it works: it stops querying what it “remembers” and starts querying the material you provided. The room for invention drops sharply.
- When to use: contract summaries, report analysis, documentation Q&A, support grounded in a knowledge base.
Guardrail 3: Demand the exact excerpt
An unsupported claim stands out immediately when you ask for the evidence alongside it.
Prompt:
For each claim, quote the exact excerpt that supports it. Without an excerpt, do not state it.
- Why it works: if the AI has to point to where it got every piece of information, anything fabricated shows up right away — either the excerpt does not exist, or it does not say what the AI claimed. You also save time when reviewing.
- When to use: research, text analysis, fact-checking. Works best paired with Guardrail 2.
Guardrail 4: Make it review itself
A second pass usually catches mistakes the first one let slip.
Prompt:
Re-read your answer and mark with [VERIFY] everything you stated without being certain.
- Why it works: you turn the AI into an editor of its own output. Weak spots get flagged, and you know exactly where to spend your verification time.
- When to use: long-form drafts, technical content, any response you plan to publish or send to someone.
Bonus: the 4-guardrail combo
For high-stakes tasks, combine everything into a single prompt:
Answer only based on the material I provided. If you are not sure, answer "I don't know" and do not fill in gaps with assumptions. For each claim, quote the exact excerpt that supports it; without an excerpt, do not state it. At the end, re-read your answer and mark with [VERIFY] everything that is not fully supported by the material.
Use this combo for contracts, numbers, research, and code.
Heads up: no guardrail is 100%
These techniques reduce the risk, but they do not eliminate it. For any critical data (legal, financial, medical, technical), human verification remains mandatory. Think of these guardrails like a seatbelt: they protect you a lot, but they do not replace the driver’s attention.
Quick summary
| Guardrail | What it does | Best used for |
|---|---|---|
| 1. Allow “I don’t know” | Cuts guesswork | Factual questions |
| 2. Only use what I gave you | Anchors AI to your source | Documents and contracts |
| 3. Demand the exact excerpt | Makes invention visible | Research and analysis |
| 4. Make it review itself | Flags uncertain parts | Content to publish |
Frequently asked questions
Do these guardrails work on any AI? Yes. The prompts work on ChatGPT, Claude, Gemini, and other assistants. Results vary across models, so it is worth testing.
Will AI stop making things up completely? No. You will greatly reduce how often it happens, but always double-check important information.
Can I use these guardrails in automations and agents? Yes, and it is recommended. Putting these guardrails in the agent’s system prompt helps keep outputs more reliable across every run.
Which guardrail should I use first? If you can only use one, start with Guardrail 2 whenever you have a reference text, or Guardrail 1 for general questions.
Want to go further?
If you enjoyed this post, follow me on Instagram @pedrogustavo.tech, where I break down AI for building websites and automating workflows, with practical prompts, agents, and productivity tips.
Need a custom project, like a website or an AI automation? Send a DM or get in touch here.
