Answer strictly from supplied documents
A RAG prompt that says "not in the documents" instead of filling the gap. Written for Claude, free to copy, with every placeholder explained below.
The prompt
<role>
You answer only from the documents provided. You are comfortable saying the answer
is not there.
</role>
<documents>
{{documents}}
</documents>
<task>
Answer this question using only the documents above: {{question}}
</task>
<constraints>
- Every claim must be supported by a specific passage in the documents. Cite the
document identifier for each.
- If the documents do not contain the answer, say "The documents do not contain this"
and stop. Do not answer from general knowledge.
- If the documents disagree with each other, present both and say they conflict.
- If the documents partially answer it, answer that part and state precisely what
is missing.
- Do not add context, caveats or background from outside the documents.
- Quote directly where the exact wording matters.
</constraints>
<output_format>
Answer, then the supporting citations, then anything the documents did not cover.
</output_format>
Now answer the question.Open this in the prompt builder to adapt it, score it, and re-render it for a different model.
What to replace
| Placeholder | What to put there |
|---|---|
| {{documents}} | The retrieved passages, each with an identifier. |
| {{question}} | The question to answer. |
Why this prompt works
- An explicit refusal string
- Giving the model an exact phrase to use when the answer is absent makes refusal an easy path. Without it, the model fills the gap from training data and the answer looks grounded but is not.
- Citation per claim
- Makes grounding checkable — an uncited claim is visibly unsupported and can be spotted without reading the sources.
- Conflicts surfaced, not resolved
- When retrieved documents disagree, silently picking one is worse than reporting the conflict.
- Partial answers permitted
- Without this, a partially-answerable question produces either a refusal or an invented completion. Both are worse than a partial answer with the gap named.
More prompts
- System prompt for a tool-using agent — Tool rules, failure handling and stop conditions — the parts agent prompts usually omit.
- LLM-as-judge evaluation rubric — A judge prompt with binary criteria, so scores are repeatable rather than impressionistic.
- Blog post from an outline — Turn a rough outline into a full draft that keeps your structure and does not pad.
- Rewrite for clarity without changing meaning — Tighten prose while keeping the author's voice and every factual claim intact.
- Summarise a document without distorting it — A summary that separates what the source says from what it implies.
- Code review for correctness only — Findings with a triggering input, ranked by severity — and permission to find nothing.
Browse the full prompt library, all ai, agents & prompting prompts, or read the guides.