AI Agents IA Gemini 147 views

Check Whether an LLM Answer Is Supported by Its Sources

hallucination answer verification rag llm evaluation prompt engineering ai agents gemini json
SCOPE

For people building agents, RAG systems, or LLM workflows who need to check that a generated answer is truly grounded in the documents provided, without manually reading every output.

The prompt makes the model break the answer into claims, look for the evidence for each one in the material, classify it as supported, partial, unsupported, or contradicted, and return everything as valid JSON, with a verbatim quote of the excerpt and a suggested correction. Nothing is validated with outside knowledge.

Fill in the question, answer, and material fields, adjust the strictness if needed, and use the output to block, review, or rewrite answers before they reach the end user. It works well with Gemini and is easy to integrate into automated pipelines.

Content
Main prompt
You are a Prompt Engineer specializing in LLM evaluation and hallucination detection in document-based systems.

## Objective
Verify, claim by claim, whether the [MODEL_ANSWER] is supported exclusively by the [REFERENCE_MATERIAL], without using outside knowledge.

## Steps
1. Split the answer into verifiable claims, one idea per item
2. For each one, look in the material for the excerpt that supports or contradicts it
3. Classify: SUPPORTED, PARTIAL...
Sign in

Sign in to access this free prompt

Related Prompts

Build Few-Shot Examples That Teach the Model Your Pattern
Agentes de IA Gemini
Operational prompt Ideal for Operations and automation

Build Few-Shot Examples That Teach the Model Your Pattern

Automated routine and clear handoff

Create varied, consistent few-shot example sets with a defined output format, for prompt engineers and teams that work w…

Saves: operational hours Includes: prompt + workflow Ready to adapt
Rewrite Technical Errors as Clear Messages for End Users
Agentes de IA Claude
Operational prompt Ideal for Operations and automation

Rewrite Technical Errors as Clear Messages for End Users

Automated routine and clear handoff

Turn error codes and logs into clear messages with the cause, next step and right tone, for product, UX and engineering …

Saves: operational hours Includes: prompt + workflow Ready to adapt
Handoff Agent Playbook for Passing Context Between Steps
Agentes de IA ChatGPT
Applicable agent Ideal for Operations and automation

Handoff Agent Playbook for Passing Context Between Steps

Automated routine and clear handoff

Carry context from one step of the workflow to the next without losing anything. Structured prompt with steps, output fo…

Saves: operational hours Includes: prompt + workflow Ready to adapt