# How to Reduce AI Hallucinations With Prompts

> Ground the answer in pasted source text, allow "not stated", demand a quote per claim, and lower temperature — the prompt habits that cut invented facts.

- Canonical: https://guides-ai.pages.dev/guides/reduce-ai-hallucinations/
- Plate 10.03 · Topic: Prompting (https://guides-ai.pages.dev/topics/prompting/)
- Published: 21 Aug 2026 · Updated: 06 Sept 2026 · 4 min read
- Source site: guides-ai — https://guides-ai.pages.dev/

A [hallucination](/glossary/#hallucination) is the model filling a gap confidently instead of admitting one. You cannot eliminate it with prompting, but **the single biggest lever is grounding: give the model the text and forbid anything outside it.** Everything below is ordered by how much it actually helps.

## 1. Source first, question last

```text
<source>
…paste the document here…
</source>

Using only the source above, answer the question. If the answer is not in the
source, reply exactly "not stated in the source". Do not use outside knowledge.

Question: what is the notice period for termination?
```

Note the order. For long inputs, putting the document above the instruction and question measurably beats the reverse — Anthropic reports up to 30% better responses on complex multi-document prompts when the query comes last.

## 2. Make "I don't know" allowed

```text
If you are not certain, say so and list what you would need to be certain.
```

Models invent because they infer that an answer is mandatory. Explicitly licensing uncertainty removes the pressure that produces the guess.

## 3. Demand a quote per claim

```text
For each claim, quote the exact sentence from the source that supports it.
Claims with no supporting sentence must be dropped.
```

Turns verification into something you can skim. A claim whose quote doesn't exist, or doesn't say what the claim says, is the fabrication — visible at a glance.

## 4. Lower the temperature for facts

For extraction, classification and factual Q&A, a low [temperature](/glossary/#temperature) around 0.2 gives steadier output. Keep the higher values for brainstorming, where variety is the point.

## 5. For agents: read before answering

```text
<investigate_before_answering>
Never speculate about code you have not opened. If the user references a
specific file, you MUST read the file before answering.
</investigate_before_answering>
```

Anthropic's own sample instruction for grounding a coding agent. The failure mode with tools is different from chat: the model has the means to check and simply doesn't, so make checking a rule rather than an option.

## 6. Verify what matters anyway

Treat names, numbers, dates, quotations, citations and code as **draft** until checked. Retrieval helps here — [RAG](/guides/rag-explained-simply/) keeps the facts external and citable — but retrieval that pulls in untrusted text brings its own risk; see [prompt injection defense](/guides/prompt-injection-defense/). For anything repeated, catch regressions with [LLM-as-judge evals](/guides/llm-as-judge-evals/) instead of spot-checking by hand. Source: [prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).
