Skip to main content
← Back to techniques

Grounded / Context-only prompting

Structure & output

Level 2 · Advanced reasoning

Instruct the model to answer strictly from the material you provide, and say so when it can't.

Grounded prompting restricts the model to using only the information explicitly provided in the prompt, rather than its general training knowledge — and requires it to say so when the provided material doesn't contain the answer, instead of filling the gap with a plausible-sounding guess. This matters whenever the answer needs to be traceable to a specific source — a document, a policy, a dataset — rather than 'whatever the model happens to know.' This pattern is sometimes called "RAG-style prompting" (Retrieval-Augmented Generation) — it's the prompting-level equivalent of what RAG systems do: restrict answers to retrieved/provided material and cite sources, without requiring the retrieval infrastructure itself.

When to use it

Use it whenever you've provided reference material — a document, an excerpt, a data table — and the answer must come only from that material: summarizing a contract, answering questions about a report, or any task where an invented detail would be a real problem.

When to avoid it

Avoid it when you actually want the model to draw on its general knowledge in addition to what you've given it — grounding restricts the model more than most tasks need, and can produce an unhelpfully narrow 'not found' answer when a reasonable answer using general knowledge would have been fine.

Advantages

  • Directly reduces fabricated details ('hallucination') on tasks with a source document
  • Makes it possible to trust that an answer is traceable to the material provided
  • Combines naturally with other techniques, especially output formatting and constraints

Disadvantages

  • Only as good as the source material — if the source is incomplete or wrong, the grounded answer inherits that
  • Can produce an overly cautious 'not found' answer even when a reasonable inference was possible
  • A citation points to which part of the source supports a claim — it isn't a guaranteed-accurate quote; check it against the actual source for anything high-stakes

Examples

Source: [excerpt from a company policy document about remote work]

Task: How many remote days per week are employees allowed?

Answer only using the information in the source above. For each claim, cite which part of the source supports it. If the source does not contain the answer, say so explicitly instead of guessing.
Advanced: when the source only partially covers the task, keep the 'answer only from the source' rule but add an explicit assumptions register — list, separately from the answer, any assumption you had to make to fill a gap the source didn't cover. See Assumption Audit for the full pattern applied to reasoning more broadly, not just source material.

Try it

Fill in the placeholders below and see the compiled prompt update live.

The material to work from.

What you want to achieve.

55
Words
333
Characters
0/2
Placeholders filled
1 min
Reading time
Quality score6
  • Completeness0
  • Clarity0
  • Context0
  • Specificity0
  • Constraints0
  • Format0
  • Output0
  • Constraints note0
  • Success criteria0
  • Scope focus100
  • Verification step0
  • Negative example0
  • Confidence0
  • Placeholder syntax100
  • Markdown structure0
Suggestions
  • Fill in the remaining placeholders.
  • Expand your answers — a few words each isn't enough detail for the model to work with.
  • Add background context so the model understands the situation.
Source(s): {{INPUT}} Task: {{OBJECTIVE}} Answer only using the information in the source(s) above. For each claim, cite which part of the source supports it — if multiple sources are provided, label them (Source 1, Source 2, ...) and cite by source. If the source does not contain the answer, say so explicitly instead of guessing.
AI Assistant

Jump to a page…

Navigation