Inferensys

Prompt

Grounded vs Ungrounded Claim Classifier Prompt Template

A practical prompt playbook for classifying extracted claims as grounded, partially grounded, ungrounded, or contradicted by evidence. Designed for production monitoring pipelines that need structured JSON reports for dashboard ingestion and drift detection.
Analytics team reviewing AI metrics dashboard on large monitor, KPIs visible, modern data-driven office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the production monitoring job this classifier performs and when it is the right tool versus when you need a different approach.

This prompt is a production monitoring primitive, not an answer generator. Its job is to classify individual factual claims extracted from a generated answer against a set of provided evidence passages. You should use it inside an observability pipeline that runs asynchronously after responses are generated, feeding structured verdicts into dashboards, alerting systems, or drift detection tools. The ideal user is an evaluation engineer, AI quality lead, or platform engineer responsible for tracking grounding fidelity over time and catching hallucination regressions before they become user-facing incidents.

The classifier requires two pre-processed inputs: a list of discrete factual claims (extracted by a separate claim decomposition step) and a set of evidence passages retrieved for the original query. It returns one of four verdicts per claim: grounded (fully supported by evidence), partially grounded (some support but missing details), ungrounded (no evidence support), or contradicted (evidence directly refutes the claim). This structured output is designed for machine consumption—dashboard ingestion, automated alerts, and trend analysis—rather than human-readable explanations. Wire this into a batch evaluation job that runs on a sample of production traffic, not on every single response, unless you have latency and cost budgets that support it.

Do not use this prompt when you need inline citation verification during answer generation, when you lack a separate claim extraction step, or when your evidence set is empty or irrelevant. It is also not suitable for end-user-facing explanations; the verdicts are coarse labels meant for internal monitoring. If you need fine-grained span alignment between claims and source passages, use the Answer-to-Source Span Alignment prompt instead. If you need a calibrated confidence score rather than discrete verdicts, use the Answer Grounding Confidence Estimation prompt. This classifier is one component in a larger grounding verification stack—pair it with claim extraction upstream and alerting or dashboarding downstream.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Grounded vs Ungrounded Claim Classifier delivers reliable value and where it introduces operational risk. Use these cards to decide if this prompt template fits your monitoring pipeline before you integrate it.

01

Good Fit: Production Monitoring Pipelines

Use when: you need automated, structured claim-level grounding reports ingested into dashboards or drift detection systems. Why it works: the prompt returns a consistent JSON schema designed for machine consumption, making it ideal for continuous evaluation over time.

02

Bad Fit: Real-Time User-Facing Guardrails

Avoid when: latency budgets are under 500ms or you need to block a response before it reaches the user. Risk: classification over multiple claims adds inference time. Mitigation: use a lighter-weight span-level flagging prompt for synchronous pre-release checks and reserve this classifier for async monitoring.

03

Required Inputs: Answer and Evidence Pair

Mandatory: a generated answer string and the full evidence context used to produce it. Watch for: missing or truncated evidence that causes false ungrounded classifications. Guardrail: validate that evidence length and source IDs are present before calling the classifier; log empty-evidence calls as data quality incidents.

04

Operational Risk: Schema Drift Over Model Updates

What to watch: model upgrades can shift the distribution of verdict labels or alter JSON field names, breaking downstream dashboards. Guardrail: pin model versions in production, run regression tests against a golden claim set on every model change, and monitor verdict distribution for sudden shifts.

05

Operational Risk: Ambiguous Partial Grounding

What to watch: claims that combine grounded and ungrounded elements may be inconsistently classified as partially grounded vs ungrounded across runs. Guardrail: define clear annotation guidelines in the prompt for partial grounding, include few-shot examples of borderline cases, and track inter-run consistency as an eval metric.

06

Scale Limit: Cost Per Claim vs Per Answer

Risk: decomposing every answer into multiple claims multiplies inference cost and latency. Guardrail: sample claims for high-volume pipelines, use cheaper models for low-risk answer types, and set a maximum claim count per answer with truncation logging to catch runaway decomposition.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for classifying claims as grounded, partially grounded, ungrounded, or contradicted by evidence.

This prompt template is designed to be copied directly into your prompt library and wired into a production monitoring pipeline. It accepts a list of extracted claims and a set of evidence passages, then classifies each claim into one of four grounding categories: grounded (fully supported by the evidence), partially grounded (some but not all elements are supported), ungrounded (no evidence support found), or contradicted (evidence directly refutes the claim). The output is a structured JSON report suitable for dashboard ingestion, drift detection, and automated alerting. Replace every square-bracket placeholder with production data before use.

text
You are a claim grounding classifier. Your task is to evaluate each claim against the provided evidence and assign a grounding verdict.

## INPUT
Claims to evaluate:
[CLAIMS_LIST]

Evidence passages:
[EVIDENCE_PASSAGES]

## OUTPUT SCHEMA
Return a JSON object with the following structure:
{
  "claims": [
    {
      "claim_id": "string",
      "claim_text": "string",
      "verdict": "grounded | partially_grounded | ungrounded | contradicted",
      "supporting_evidence_ids": ["string"],
      "contradicting_evidence_ids": ["string"],
      "explanation": "string (1-2 sentences explaining the verdict)",
      "confidence": 0.0-1.0
    }
  ],
  "summary": {
    "total_claims": integer,
    "grounded_count": integer,
    "partially_grounded_count": integer,
    "ungrounded_count": integer,
    "contradicted_count": integer
  }
}

## CLASSIFICATION RULES
- **grounded**: Every factual element in the claim is explicitly stated in or directly inferable from the evidence. Cite the specific evidence IDs.
- **partially_grounded**: Some elements are supported but others are missing or unsupported. Identify which parts are grounded and which are not.
- **ungrounded**: No evidence passage supports any part of the claim. Do not guess or infer beyond what the evidence states.
- **contradicted**: At least one evidence passage directly refutes the claim. Cite the contradicting evidence IDs.

## CONSTRAINTS
[CONSTRAINTS]

## EXAMPLES
[EXAMPLES]

## RISK LEVEL
[RISK_LEVEL]

Return only valid JSON. Do not include markdown fences, commentary, or additional text.

Adaptation guidance: Replace [CLAIMS_LIST] with a JSON array of claim objects, each containing at minimum an id and text field. Replace [EVIDENCE_PASSAGES] with a JSON array of evidence objects, each with an id and content field. The [CONSTRAINTS] placeholder should be populated with domain-specific rules—for example, in healthcare you might add "Do not classify temporal statements as grounded unless the evidence explicitly includes a matching date or time range." The [EXAMPLES] placeholder should contain 3-5 few-shot examples covering each verdict type, including edge cases like claims that appear grounded but use different terminology than the evidence. Set [RISK_LEVEL] to high if this classifier gates user-facing responses, which should trigger additional validation and human review steps in your harness. For low-risk internal monitoring, set it to low and skip the review queue.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the Grounded vs Ungrounded Claim Classifier needs to work reliably. Replace each placeholder before sending the prompt to the model. Validation notes describe how to check the input before runtime.

PlaceholderPurposeExampleValidation Notes

[CLAIMS_LIST]

Array of individual factual claims extracted from the generated answer to classify

["The API returns 200 on success", "Latency is under 100ms", "The system never fails"]

Must be a valid JSON array of strings. Each string should be a single verifiable claim. Empty array allowed but returns empty report.

[EVIDENCE_PASSAGES]

Array of evidence objects with text and source metadata to ground claims against

[{"text": "API returns 200 for valid requests", "source": "docs/api-spec.md", "section": "Responses"}]

Must be a valid JSON array of objects. Each object requires a 'text' field. 'source' and 'section' are optional but recommended for traceability.

[CLASSIFICATION_TAXONOMY]

Enum of allowed verdicts for each claim-evidence pair

["grounded", "partially_grounded", "ungrounded", "contradicted"]

Must be a valid JSON array of strings. Do not modify the taxonomy without updating downstream dashboards and alert thresholds.

[CONFIDENCE_THRESHOLD]

Minimum confidence score required before a classification is considered reliable enough for automated action

0.85

Must be a float between 0.0 and 1.0. Classifications below this threshold should be routed for human review. Default 0.85 for production monitoring.

[OUTPUT_SCHEMA]

Expected JSON structure for each classified claim in the response

{"claim": "string", "verdict": "string", "confidence": "float", "evidence_span": "string|null", "rationale": "string"}

Must be a valid JSON Schema object or example structure. The model output must be validated against this schema post-generation. Reject responses that do not conform.

[MAX_CLAIMS_PER_BATCH]

Upper limit on claims processed in a single request to avoid timeout or context-window overflow

50

Must be a positive integer. Exceeding this should trigger batching logic in the application layer before the prompt is assembled. Monitor latency at batch boundaries.

[REQUIRE_EVIDENCE_SPAN]

Boolean flag controlling whether the model must quote the specific evidence text supporting its verdict

Must be true or false. Set to true for audit and compliance use cases. Set to false only for low-stakes monitoring where rationale alone is sufficient.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Grounded vs Ungrounded Claim Classifier into a production monitoring pipeline with validation, retry, logging, and human review.

The Grounded vs Ungrounded Claim Classifier is designed to operate as a post-generation guardrail inside a production monitoring pipeline, not as a one-off manual check. After your system generates an answer from retrieved evidence, you extract discrete claims from that answer (using a separate extraction step or the Claim-by-Claim Faithfulness Audit template), then pass each claim along with its source evidence to this classifier. The classifier returns a structured JSON verdict per claim: grounded, partially_grounded, ungrounded, or contradicted. This verdict feeds directly into your observability stack—dashboards, drift detectors, and alerting rules—so you can track grounding quality over time and catch regressions before users do.

To wire this into production, wrap the prompt call in a validation-retry-logging harness. First, validate the model's JSON output against a strict schema that requires the verdict field to be one of the four allowed enum values and the evidence_spans array to contain non-empty strings when the verdict is not ungrounded. If validation fails, retry once with the validation error injected into the prompt as additional context. Log every classification attempt—including the input claim, evidence, raw model response, validation result, retry count, and final verdict—to your tracing system (e.g., LangSmith, Braintrust, or custom OpenTelemetry spans). For high-risk domains such as healthcare or legal review, route any contradicted or partially_grounded verdict to a human review queue before the response reaches the end user. Model choice matters here: use a model with strong instruction-following and JSON mode (GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro) and set temperature=0 to minimize verdict instability.

The most common production failure mode is evidence-context truncation. If your retrieval pipeline passes long documents and the model's context window clips the relevant passage, the classifier may incorrectly return ungrounded for a claim that is actually supported. Mitigate this by pre-chunking evidence to the specific paragraphs or spans that are most relevant before calling the classifier. A second failure mode is verdict drift when you change the underlying model version—track verdict distributions per model version in your dashboard and run a regression suite of 50–100 labeled claim-evidence pairs before promoting any model or prompt change. Finally, do not use this classifier as a real-time blocking guard if latency is critical; batch classification runs asynchronously after response generation and feed aggregate metrics into your monitoring stack rather than adding synchronous latency to the user-facing path.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when classifying claims as grounded or ungrounded, and how to prevent it in production monitoring pipelines.

01

Evidence-Answer Boundary Blur

What to watch: The model treats its own generated answer as evidence, re-confirming claims it just made instead of checking against the provided source passages. This creates a self-reinforcing hallucination loop where unsupported claims are marked as grounded. Guardrail: Structure the prompt so evidence and answer are in strictly separated blocks. Include an explicit instruction: 'Only use the text in the EVIDENCE block. Do not treat the ANSWER block as a source.' Validate with a held-out set where evidence is intentionally insufficient.

02

Partial Grounding Overconfidence

What to watch: The classifier marks a claim as 'grounded' when only a fragment is supported. For example, 'The system processes 10,000 requests per second with 99.9% uptime' might have evidence for the throughput but not the uptime. Guardrail: Require the classifier to extract the specific evidence span for each claim. If any part of the claim lacks a matching span, force a 'partially_grounded' verdict. Add a post-processing rule: if the evidence span length is less than 40% of the claim length, flag for human review.

03

Implicit Inference Drift

What to watch: The model accepts reasonable-sounding inferences as grounded. If evidence says 'the team shipped the feature,' the classifier may mark 'the feature passed QA' as grounded because shipping implies testing. This is inference, not grounding. Guardrail: Add a constraint: 'A claim is grounded ONLY if the evidence explicitly states it or directly paraphrases it. Do not accept logical inferences, industry assumptions, or common-sense bridges.' Test with adversarial pairs where the inference is plausible but unsupported.

04

Contradiction Miss Due to Negation

What to watch: The classifier fails to detect contradictions when evidence uses negation, hedging, or counterfactuals. 'The system does not support batch processing' contradicts 'The system supports batch processing,' but surface-level similarity tricks the model. Guardrail: Include few-shot examples with explicit negation pairs. Add a pre-check step: extract all negated statements from evidence before classification. If a claim matches a negated statement, force a 'contradicted' verdict regardless of lexical overlap.

05

Multi-Source Attribution Collapse

What to watch: When evidence comes from multiple passages, the classifier merges facts across sources and marks a claim as grounded even though no single source contains all the required information. The claim is a synthesis, not a grounded statement. Guardrail: Require the classifier to cite which specific passage supports each claim. If a claim requires evidence from more than one passage to be fully supported, classify it as 'partially_grounded' and list the missing pieces. This prevents cross-source hallucination.

06

Temporal Mismatch Blindness

What to watch: A claim about current state is marked as grounded based on outdated evidence. 'The API supports v3 endpoints' is marked grounded because evidence from six months ago mentions v3 planning, but v3 was deprecated last month. Guardrail: Include evidence timestamps in the prompt and add a temporal check instruction: 'If the evidence is older than the claim's implied timeframe, flag as ungrounded regardless of content match.' For production, append a freshness score to each evidence passage before classification.

IMPLEMENTATION TABLE

Evaluation Rubric

Run this rubric against a golden dataset of at least 50 claim-evidence pairs with human-annotated verdicts. Each criterion targets a specific failure mode observed in production grounding classifiers.

CriterionPass StandardFailure SignalTest Method

Verdict Accuracy vs Human Gold

Cohen's kappa >= 0.80 against 2-human consensus

Kappa < 0.70 or systematic bias toward 'grounded' on ambiguous pairs

Run classifier on golden set; compute kappa and confusion matrix per verdict class

Partial Grounding Discrimination

Partially grounded recall >= 0.75 with precision >= 0.70

Classifier collapses partial into grounded or ungrounded; recall < 0.50

Isolate golden pairs labeled 'partially grounded'; measure recall and precision

Contradiction Detection Sensitivity

Contradiction recall >= 0.85; false negative rate < 0.15

Classifier labels contradictions as 'grounded' or 'partially grounded'

Test on adversarial pairs where evidence directly negates the claim

Null Evidence Handling

All null-evidence inputs classified as 'ungrounded' or 'insufficient evidence'

Any null-evidence input classified as 'grounded' or 'partially grounded'

Feed 20 claims with empty evidence array; verify 100% ungrounded rate

Schema Compliance

100% of outputs parse as valid JSON matching [OUTPUT_SCHEMA] with all required fields present

Missing fields, extra fields, or malformed JSON in > 2% of outputs

Validate all test outputs against JSON Schema; count parse failures and field violations

Confidence Calibration

Mean confidence for correct verdicts >= 0.80; mean confidence for incorrect verdicts <= 0.60

High confidence on wrong verdicts or low confidence on correct ones

Bin outputs by confidence score; compute accuracy per bin; check monotonicity

Latency Under Load

P95 latency <= 3 seconds per claim-evidence pair at 10 concurrent requests

P95 latency > 5 seconds or timeout rate > 2%

Load test with 50 concurrent pairs; measure P50, P95, P99 latency and timeout count

Edge Case: Multi-Evidence Conflict

Correctly identifies contradiction when evidence sources disagree

Classifier picks one source and ignores conflict; returns 'grounded'

Test with claim supported by source A but contradicted by source B in same evidence set

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Add strict JSON schema validation, retry logic (max 3 attempts with backoff), structured logging of verdicts and confidence scores, and a golden eval set of 100+ claim-evidence pairs with human-annotated ground truth. Wire the classifier into a monitoring pipeline that tracks grounding drift over time.

code
System: You are a production claim classifier. For each claim in [CLAIMS], determine if it is fully supported by [EVIDENCE].

Classification rules:
- grounded: All factual elements are explicitly supported by evidence
- partially_grounded: Some elements supported, others missing or inferred
- ungrounded: No supporting evidence found
- contradicted: Evidence directly refutes the claim

Return ONLY valid JSON matching [OUTPUT_SCHEMA]. Include [EVIDENCE_SPAN] for each grounded or contradicted claim. If evidence is empty, classify all claims as ungrounded.

User:
Claims: [CLAIMS]
Evidence: [EVIDENCE]
Output schema: [OUTPUT_SCHEMA]

Watch for

  • Silent format drift when model versions change
  • Missing human review for high-severity contradictions
  • Confidence scores that don't correlate with actual accuracy in production
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.