Inferensys

Prompt

RAG Answer Faithfulness Evaluation Rubric Prompt

A practical prompt playbook for using RAG Answer Faithfulness Evaluation Rubric Prompt in production AI workflows.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the job-to-be-done, ideal user, required context, and when not to use the RAG Answer Faithfulness Evaluation Rubric Prompt.

This prompt is designed for AI product teams who need to automate the quality assessment of their RAG pipeline's outputs at scale. The core job-to-be-done is to replace ad-hoc, manual spot-checking of answers with a structured, repeatable, model-graded evaluation. The ideal user is a quality engineer, an AI product manager, or an MLOps engineer responsible for monitoring a production RAG system. They are not just looking for a binary 'good' or 'bad' label; they need a diagnostic score across multiple dimensions—claim support, citation accuracy, abstention appropriateness, and source conflict handling—that can be trended over time and linked back to specific trace events for root-cause analysis.

To use this prompt effectively, you must already have a production trace that captures the full lifecycle of a single request. This includes the user's query, the list of retrieved context passages with their identifiers, and the final generated answer. The prompt acts as an evaluator, taking this trace as input and applying a detailed rubric to score the answer's faithfulness. The output is a structured JSON object containing a composite score, per-dimension subscores, and trace-anchored justifications for each score. This allows you to log the evaluation result alongside the trace, creating a queryable dataset for monitoring dashboards, alerting on quality regressions, and debugging specific failure modes like a drop in citation accuracy after a retrieval pipeline change.

This prompt is a powerful first-pass automation tool but is not a replacement for human review in high-stakes or safety-critical domains. Do not use it as the sole arbiter of truth for medical, legal, or financial advice generated by your system. It is also not designed for evaluating creative writing, open-ended summarization without a grounding source, or tasks where 'faithfulness' is not the primary success metric. A common failure mode is using this prompt on traces with poorly chunked or irrelevant retrieved context; the rubric will correctly score the answer as unfaithful, but the root cause is a retrieval failure, not a generation failure. Use this evaluation prompt as part of a broader observability suite, pairing it with retrieval quality metrics and human-in-the-loop review for a subset of traces to continuously calibrate the model grader's performance.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not.

01

Good Fit: Automated RAG Eval Pipelines

Use when: You have a CI/CD pipeline that runs faithfulness evaluations on a golden dataset of traces. This prompt provides structured, rubric-aligned scores that can be trended over time. Guardrail: Ensure the eval dataset includes traces with known faithfulness issues to calibrate the rubric's sensitivity.

02

Bad Fit: Real-Time Guardrails

Avoid when: You need to block a hallucinated response before it reaches the user. This prompt is designed for offline trace analysis, not for low-latency, synchronous checks. Guardrail: Use a lightweight NLI model or a claim extraction check for online guardrails; reserve this rubric for post-hoc analysis.

03

Required Inputs

Risk: Running this prompt without a complete trace leads to unreliable scores. Guardrail: The prompt requires the user query, the final generated answer, and the full list of retrieved context chunks with their metadata. A trace ID alone is insufficient; the data must be unpacked.

04

Operational Risk: Rubric Drift

Risk: As your RAG system's behavior changes, the rubric's definitions of 'supported' or 'conflict' may become misaligned with new failure modes. Guardrail: Periodically run the rubric against a human-annotated calibration set and adjust the dimensional descriptors if inter-rater agreement drops below a threshold.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable rubric-based prompt for scoring RAG answer faithfulness against retrieved context traces.

This prompt template applies a structured evaluation rubric to a production trace, scoring the faithfulness of a generated answer against the retrieved context. It is designed to be dropped into an automated evaluation pipeline where each trace contains the user query, retrieved passages, and the final generated answer. The rubric dimensions—claim support, citation accuracy, abstention appropriateness, and source conflict handling—force the evaluator to anchor every score in specific trace evidence rather than producing a single opaque number.

text
You are an expert RAG evaluator. Your task is to score the faithfulness of a generated answer against the retrieved context captured in a production trace.

## INPUT
- User Query: [USER_QUERY]
- Retrieved Context (ordered by retrieval rank): [RETRIEVED_CONTEXT]
- Generated Answer: [GENERATED_ANSWER]
- Citations Present in Answer: [CITATIONS]

## EVALUATION RUBRIC
Score the answer on each dimension below. For every score, you must cite the specific retrieved passage span or answer segment that justifies your rating.

### 1. Claim Support (1-5)
- 5: Every factual claim in the answer is directly supported by at least one retrieved passage. No claims are invented or contradicted.
- 4: All major claims are supported; minor details may be imprecise but not false.
- 3: Most claims are supported, but one or two claims lack clear evidence or are partially contradicted.
- 2: Multiple unsupported claims exist, or a central claim is contradicted by the retrieved context.
- 1: The answer is largely fabricated with little to no grounding in the retrieved context.

### 2. Citation Accuracy (1-5)
- 5: Every inline citation points to a real retrieved passage that directly supports the cited claim. No misattributions.
- 4: All citations are to real passages; one citation may be slightly imprecise but still directionally correct.
- 3: One citation points to a passage that does not support the claim, or a supported claim is missing a citation.
- 2: Multiple citation errors, or citations point to irrelevant passages.
- 1: Citations are fabricated, point to non-existent sources, or are systematically misleading.
- N/A: No citations were provided in the answer.

### 3. Abstention Appropriateness (1-5)
- 5: The model correctly answered when context was sufficient and correctly abstained or expressed uncertainty when context was insufficient.
- 4: The model answered appropriately but could have expressed slightly more caution on one edge case.
- 3: The model answered a question that the context could not fully support, or abstained when sufficient context was available.
- 2: The model confidently answered a question with clearly insufficient or contradictory context.
- 1: The model fabricated an answer when it should have abstained, or refused to answer a well-supported question.
- N/A: The trace does not involve an abstention decision.

### 4. Source Conflict Handling (1-5)
- 5: When retrieved passages conflict, the answer acknowledges the disagreement and presents both sides without fabricating a resolution.
- 4: The answer acknowledges conflict but slightly favors one side without justification.
- 3: The answer presents one side of a conflict as fact without acknowledging the other side.
- 2: The answer invents a middle ground or resolution not supported by any source.
- 1: The answer ignores clear conflicts and presents a fabricated consensus.
- N/A: No source conflicts were present in the retrieved context.

## OUTPUT FORMAT
Return a valid JSON object with this exact schema:
{
  "overall_faithfulness_score": <float between 1.0 and 5.0>,
  "dimension_scores": {
    "claim_support": {
      "score": <int 1-5>,
      "justification": "<trace-anchored explanation>",
      "evidence_spans": ["<quoted passage text or answer segment>"]
    },
    "citation_accuracy": {
      "score": <int 1-5 or null if N/A>,
      "justification": "<trace-anchored explanation>",
      "evidence_spans": ["<quoted passage text or answer segment>"]
    },
    "abstention_appropriateness": {
      "score": <int 1-5 or null if N/A>,
      "justification": "<trace-anchored explanation>",
      "evidence_spans": ["<quoted passage text or answer segment>"]
    },
    "source_conflict_handling": {
      "score": <int 1-5 or null if N/A>,
      "justification": "<trace-anchored explanation>",
      "evidence_spans": ["<quoted passage text or answer segment>"]
    }
  },
  "unsupported_claims": [
    {
      "claim": "<the unsupported claim>",
      "closest_retrieved_passage": "<best available passage or null>",
      "severity": "critical|major|minor"
    }
  ],
  "hallucination_flags": [
    {
      "type": "fabrication|contradiction|misattribution|overgeneralization",
      "description": "<what was hallucinated>",
      "trace_reference": "<answer segment or citation ID>"
    }
  ]
}

## CONSTRAINTS
- Do not speculate about what the model might have intended. Score only what is present in the trace.
- If a dimension is not applicable, set its score to null and explain why in the justification.
- The overall_faithfulness_score must be the mean of the applicable dimension scores, rounded to one decimal place.
- Every justification must reference specific text from the retrieved context or generated answer.
- If the retrieved context is empty, score claim_support as 1 and note the retrieval failure.

Adapt this template by adjusting the rubric thresholds to match your product's risk tolerance. For regulated domains, lower the threshold for flagging unsupported claims and require human review when the overall score falls below 4.0. The severity field in unsupported claims should map to your incident response playbook: critical triggers immediate review, major goes to a quality queue, and minor feeds a trend dashboard. Before deploying, run this prompt against a golden set of 50 traces with known faithfulness issues to calibrate whether the model-graded scores correlate with human judgments. If correlation is below 0.8, refine the rubric descriptions or add few-shot examples of borderline cases.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the RAG Answer Faithfulness Evaluation Rubric Prompt. Each placeholder must be populated from a production trace before evaluation can run reliably.

PlaceholderPurposeExampleValidation Notes

[GENERATED_ANSWER]

The full text output produced by the RAG system that must be evaluated for faithfulness

The capital of France is Paris. Paris has been the capital since the 10th century.

Must be non-empty string. Truncation allowed only if marked with [TRUNCATED] token. Reject if null or whitespace-only.

[RETRIEVED_CONTEXT]

The complete set of passages, documents, or chunks retrieved and provided to the generator in the trace

[{doc_id: 'doc_42', passage: 'Paris is the capital and most populous city of France...', score: 0.94}]

Must be valid JSON array of objects with at least 'passage' field. Empty array is valid and should trigger abstention evaluation. Reject if missing or unparseable.

[SOURCE_DOCUMENTS]

Original source documents with identifiers and full text, used for citation alignment verification

[{source_id: 'src_17', title: 'France Geography Report', content: '...', timestamp: '2024-03-15'}]

Must be valid JSON array. Each object requires 'source_id' and 'content'. Timestamp optional but recommended for temporal grounding checks. Null allowed if citation alignment is out of scope.

[USER_QUERY]

The original user question or instruction that triggered the RAG pipeline

What is the capital of France and when did it become the capital?

Must be non-empty string. Preserve exact user input including typos. Required for abstention appropriateness and query-answer relevance checks.

[CITATION_SPANS]

Inline citation markers from the generated answer mapped to source document identifiers and character offsets

[{citation_id: 'cite_1', source_id: 'src_17', answer_span: [32, 47], source_span: [0, 45]}]

Must be valid JSON array if citations exist. Each object requires 'citation_id', 'source_id', and 'answer_span'. Null allowed for uncited answers. Validate span offsets are within string bounds.

[TRACE_ID]

Unique identifier for the production trace being evaluated, used for audit trail and result anchoring

trace_2025-03-15_14-32-17_a1b2c3

Must be non-empty string. Should match trace system's ID format. Used to link evaluation results back to specific trace events for debugging.

[EVAL_RUN_ID]

Identifier for this evaluation run, enabling comparison across repeated evaluations of the same trace

eval_run_2025-03-16_batch_3_v2

Must be non-empty string. Recommended format includes date and version. Enables tracking of rubric changes over time when the same trace is re-evaluated.

[RUBRIC_VERSION]

Version identifier for the faithfulness rubric being applied, supporting rubric evolution tracking

faithfulness_rubric_v2.1

Must be non-empty string. Use semantic versioning or date-based versioning. Critical for reproducing historical evaluation results and detecting rubric drift.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the faithfulness rubric prompt into an automated evaluation pipeline with validation, retries, and human review gates.

This prompt is designed to run as a batch evaluation step within a CI/CD pipeline or a scheduled monitoring job, not as a real-time user-facing check. The typical integration point is after a RAG system has produced an answer and the full trace—including the user query, retrieved documents, and final output—has been logged. You feed the trace into this prompt, receive a structured rubric score, and write that score to your observability platform (e.g., LangSmith, Braintrust, or a custom metrics store). The prompt expects a JSON object containing [QUERY], [RETRIEVED_CONTEXT] (an array of document objects with id, content, and optional timestamp), and [GENERATED_ANSWER]. The output is a JSON object matching the [OUTPUT_SCHEMA] you define, which should include at minimum a faithfulness_score (0-100), a severity classification, and a justifications array keyed to each rubric dimension.

Validation and retry logic is critical because the prompt's output must be machine-readable for downstream dashboards and alerts. Wrap the model call in a validation layer that parses the JSON response and checks for required fields, correct types, and score ranges. If validation fails, implement a single retry with the error message injected into the prompt as additional context (e.g., 'Your previous output failed JSON schema validation with error: [ERROR]. Please correct and return valid JSON only.'). If the retry also fails, log the raw output and flag the trace for human review. For high-stakes domains (healthcare, legal, finance), always route severity: critical results to a human review queue before the score is accepted. Use a model with strong JSON mode and instruction-following capabilities—GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are appropriate choices. Avoid smaller or older models that may hallucinate the rubric structure or misalign justifications with trace evidence.

Cost and latency management requires batching and caching. Group evaluation requests to process multiple traces in a single batch call when your provider supports it, or use asynchronous workers with concurrency limits to avoid rate limiting. Cache the prompt prefix (the rubric instructions and output schema) to reduce per-request token costs. For production monitoring, sample traces rather than evaluating every response—start with 10% random sampling plus 100% of traces where user feedback signals a problem. Store the rubric scores alongside trace IDs in your observability platform so you can correlate faithfulness regressions with prompt version changes, embedding model updates, or knowledge base modifications. Do not use this prompt as a real-time guardrail that blocks user responses; the latency and cost are too high, and the rubric is designed for offline analysis, not synchronous decision-making.

IMPLEMENTATION TABLE

Expected Output Contract

Schema for the structured JSON object the model must return. Use this contract to validate outputs programmatically before accepting a score.

Field or ElementType or FormatRequiredValidation Rule

faithfulness_score

number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. Parse check: JSON number type, not string.

overall_grade

enum string

Must be one of: 'faithful', 'mostly_faithful', 'mixed', 'mostly_unfaithful', 'unfaithful'. Schema check: exact string match.

dimensions

array of objects

Array length must be >= 1. Each object must contain 'name' (string), 'score' (number 0.0-1.0), and 'justification' (string).

dimensions[].name

string

Must match a dimension listed in the prompt rubric (e.g., 'claim_support', 'citation_accuracy', 'abstention_appropriateness', 'source_conflict_handling').

dimensions[].score

number (0.0-1.0)

Same range and type rules as faithfulness_score.

dimensions[].justification

string

Must reference at least one specific trace event ID or source span. Null or empty string not allowed.

unsupported_claims

array of objects

Can be empty array if no unsupported claims found. Each object must contain 'claim_text' (string) and 'trace_event_id' (string or null).

unsupported_claims[].claim_text

string

Must be a direct quote or close paraphrase of a claim from the generated output. Empty string not allowed.

unsupported_claims[].trace_event_id

string or null

If null, justification must explain why no trace event could be identified. If string, must match a trace event ID format from the input.

summary

string

Must be 1-3 sentences. Must mention the overall grade and the primary reason for the score. Null or empty string not allowed.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when evaluating RAG faithfulness with a rubric and how to guard against it.

01

Rubric Drift Across Model Versions

What to watch: The same rubric prompt produces different score distributions after a model upgrade, not because quality changed but because the model interprets the rubric criteria differently. Guardrail: Pin the evaluation model version, run a calibration set of scored traces before and after any model change, and flag statistically significant score shifts for human review.

02

Citation Format Parsing Failures

What to watch: The evaluator model fails to parse inline citations (e.g., [1], [doc_3]) and incorrectly marks supported claims as unsupported because it cannot map the citation to the retrieved source. Guardrail: Standardize citation formats in the generation prompt, include a citation format key in the evaluator's context, and add a pre-processing step that normalizes citation references before rubric scoring.

03

Over-Penalizing Abstention Correctness

What to watch: The rubric penalizes the model for abstaining when evidence is genuinely insufficient, conflating correct abstention with a failure to answer. Guardrail: Include a dedicated abstention evaluation dimension in the rubric that scores whether the model correctly identified evidence gaps, and weight it separately from faithfulness to avoid dragging down scores for appropriate caution.

04

Source Conflict Misclassification

What to watch: When retrieved sources contradict each other, the evaluator marks the output as unfaithful for not reconciling the conflict, even when the model appropriately acknowledges disagreement. Guardrail: Add a source-conflict handling criterion to the rubric that rewards transparent acknowledgment of conflicting evidence rather than penalizing the absence of a definitive answer.

05

Trace-to-Rubric Evidence Mismatch

What to watch: The evaluator hallucinates justifications by citing trace events that don't exist or misattributing claims to the wrong retrieved passage, making the rubric score untrustworthy. Guardrail: Require the evaluator to output exact trace event IDs and passage spans in its justification, then run a secondary validation step that verifies each cited trace reference actually exists in the source trace data.

06

Implicit Claim Blind Spots

What to watch: The rubric evaluator misses unsupported claims that are implied rather than explicitly stated, such as background assumptions or inferred relationships that the retrieved context does not actually support. Guardrail: Include an explicit instruction to extract both stated and implied claims before scoring, and add a few-shot example showing how to flag an implied-but-unsupported claim with the closest-but-insufficient evidence from the trace.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to score RAG answer faithfulness against production traces. Each criterion targets a specific failure mode. Apply the test method to every response before shipping.

CriterionPass StandardFailure SignalTest Method

Claim Support

Every factual claim maps to at least one retrieved passage in the trace

Output contains a statement not found in or reasonably inferable from retrieved context

Extract atomic claims; for each, run substring match against retrieved passages; flag unmatched claims

Citation Accuracy

Every inline citation points to a real source document ID present in the trace

Citation references a document not in the retrieval trace or cites a passage that contradicts the claim

Parse citation markers; cross-reference against trace document IDs; verify cited span supports the claim

Abstention Appropriateness

Model abstains when no retrieved passage provides sufficient evidence; model answers when evidence exists

Model answers confidently with no supporting evidence OR abstains when relevant evidence is present in trace

Check retrieval relevance scores; if all scores below threshold and model answered, flag; if scores above threshold and model abstained, flag

Source Conflict Handling

When retrieved sources disagree, output acknowledges the conflict or presents both perspectives

Output presents one side of a source conflict as definitive fact without qualification

Cluster retrieved passages by stance; if multiple stances exist and output mentions only one without hedging, flag

Evidence Distortion

Generated claims preserve the meaning, scope, and certainty level of the source passage

Output amplifies a tentative source finding into a definitive claim or reverses the source's conclusion

Compare claim certainty markers against source passage hedging language; flag mismatches in strength or direction

Temporal Grounding

Time-sensitive claims include temporal qualifiers matching source document timestamps

Output presents outdated information as current or omits date context when source is time-bound

Extract temporal expressions from output; compare against document timestamp in trace; flag missing or mismatched qualifiers

Multi-Hop Chain Integrity

Each inferential step in a multi-hop claim is supported by a distinct retrieved passage

Output makes a compound claim where intermediate reasoning step has no trace evidence

Decompose multi-hop claims into steps; verify each step has a supporting passage in trace; flag broken chains

Attribution Span Precision

Citation spans cover exactly the claim they support without over-claiming or under-claiming

Citation span includes unsupported adjacent content or fails to cover the full supported claim

Extract cited text spans; verify each span's content is fully supported by the cited source; flag span boundary errors

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base rubric prompt and a small set of 10-20 annotated traces. Remove strict schema enforcement initially. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with the prompt as-is. Focus on whether the rubric dimensions make sense for your domain before adding automation.

code
SYSTEM: You are a faithfulness evaluator...
[ORIGINAL RUBRIC PROMPT]

USER: Evaluate this trace:
Question: [USER_QUESTION]
Retrieved Context: [RETRIEVED_PASSAGES]
Generated Answer: [MODEL_OUTPUT]

Watch for

  • Rubric dimensions that don't apply to your use case (e.g., multi-hop citation chains when you only do single-hop retrieval)
  • Overly strict scoring that flags acceptable paraphrasing as unfaithful
  • Model grading its own outputs more leniently than human evaluators would
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.