Inferensys

Prompt

Hallucination Severity Classification Prompt

A practical prompt playbook for using Hallucination Severity Classification Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Hallucination Severity Classification Prompt.

This prompt is designed for production monitoring and incident response teams who need to move beyond binary hallucination detection. Its job is to classify a detected hallucination—an unsupported or fabricated claim in an AI-generated output—into a defined severity tier, such as 'minor imprecision,' 'material misstatement,' or 'critical fabrication.' The ideal user is an AI engineer, MLOps lead, or trust and safety operator building an automated evaluation pipeline where not all hallucinations are equal. A hallucinated date in a marketing draft is a nuisance; a hallucinated drug dosage in a clinical summary is a safety incident. This prompt provides the structured judgment needed to trigger the right response: a log entry, a retry, a human review queue, or an immediate escalation.

Use this prompt when you already have a hallucination detection signal—from a sentence-level grounding check, a factual consistency scorer, or a human flag—and you need to decide what to do next. It requires the original user query or task context, the AI-generated output, the specific hallucinated claim, and the source evidence (or a note that no evidence exists). The prompt is not a hallucination detector itself; it assumes the hallucination has been identified. Do not use it as a first-pass filter on raw outputs, as it will waste tokens and latency on content that may be fully grounded. It is also not a substitute for a human review policy in high-risk domains; for regulated workflows, the severity classification should inform, not replace, human judgment.

The output is a structured severity classification with a rationale, a confidence score, and a recommended action. This makes it directly wireable into alerting thresholds: for example, any classification of 'critical' with confidence above 0.9 triggers a PagerDuty alert, while 'minor' classifications are batched for weekly review. Before deploying, calibrate the severity definitions against your own risk taxonomy—a 'material misstatement' in e-commerce product specs differs from one in financial audit summaries. Run a calibration set of 20-30 known hallucinations with human-assigned severities to verify the prompt's alignment before trusting it in an automated escalation path.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Hallucination Severity Classification Prompt delivers reliable value and where it introduces operational risk.

01

Good Fit: Production Monitoring Pipelines

Use when: You need automated triage of hallucination incidents in a live RAG or summarization system. The prompt classifies severity from minor imprecision to critical fabrication, enabling tiered alerting. Guardrail: Pair with a grounding detection prompt first; this classifier should only receive confirmed hallucinations, not raw outputs.

02

Good Fit: Incident Response Workflows

Use when: An on-call engineer or trust-and-safety reviewer needs a structured severity label to decide escalation paths. Guardrail: Always include the source evidence and the hallucinated claim in the input. Never ask the model to recall facts from training data alone.

03

Bad Fit: Real-Time User-Facing Blocking

Avoid when: You need to block a response before it reaches the user. Severity classification is a post-hoc analysis tool, not a pre-generation guard. Latency and the need for the full output make it unsuitable for synchronous blocking. Guardrail: Use a lightweight pass/fail groundedness gate upstream for real-time decisions.

04

Required Inputs

Must provide: The original user query, the full AI-generated response, the specific hallucinated claim(s) already detected, and the relevant source evidence. Guardrail: Missing evidence forces the model to guess severity from surface language alone, producing dangerously unreliable classifications.

05

Operational Risk: Severity Inflation

Risk: The model may over-classify minor stylistic imprecision as a major hallucination, causing alert fatigue and eroding trust in the monitoring system. Guardrail: Calibrate the severity rubric with human-annotated examples and run inter-rater reliability checks weekly against a golden dataset of known-severity cases.

06

Operational Risk: Context Window Truncation

Risk: Long source documents or multi-turn conversations may be truncated in the prompt, causing the classifier to miss mitigating context and inflate severity. Guardrail: Implement a pre-processing step that extracts only the most relevant evidence passages before classification, and log truncation warnings alongside severity scores.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt for classifying detected hallucinations by severity to enable tiered alerting and escalation.

This prompt template is designed to be integrated into a production monitoring pipeline. It assumes that a hallucination has already been detected by an upstream process, such as a factual consistency check. The job of this prompt is not to find the hallucination, but to classify its operational severity so that your system can respond appropriately—whether that means logging a minor imprecision, flagging a record for human review, or triggering an immediate incident response for a critical fabrication.

code
You are a production safety classifier for an AI system. Your task is to classify the severity of a detected hallucination in a generated output.

## INPUT
[GENERATED_OUTPUT]

[SOURCE_MATERIAL]

[DETECTED_HALLUCINATION_DESCRIPTION]

## CLASSIFICATION TASK
Analyze the detected hallucination described above. Classify its severity based on the potential for real-world harm, regulatory impact, or user misinformation.

## SEVERITY LEVELS
- **CRITICAL**: The hallucination fabricates a dangerous instruction, a serious safety risk, a legal/financial obligation, or a medical claim. It could cause direct harm if acted upon. Requires immediate incident response.
- **HIGH**: The hallucination invents a significant factual claim, a key statistic, a named entity's action, or a core piece of evidence not present in the source. It substantially misrepresents the source material. Requires immediate human review.
- **MEDIUM**: The hallucination introduces a minor factual error, a plausible but unsupported detail, or a slight misattribution. It does not change the core meaning but is factually incorrect. Suitable for batch review.
- **LOW**: The hallucination is a minor imprecision, a stylistic overstatement, or a trivial detail that is not strictly supported but does not mislead. It is a quality issue but not a factual risk. Suitable for logging and trend analysis.

## CONSTRAINTS
- Classify based on the *potential impact* of the hallucination, not just its textual size.
- If the hallucination involves [RESTRICTED_DOMAINS], automatically classify as HIGH or CRITICAL.
- If unsure between two levels, choose the higher severity.
- Do not re-evaluate whether a hallucination exists; assume the provided description is accurate.

## OUTPUT_SCHEMA
Return a single JSON object:
{
  "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
  "rationale": "A concise explanation referencing the specific claim and its potential impact.",
  "recommended_action": "One of: 'page_oncall', 'create_review_ticket', 'batch_review_queue', 'log_for_trend'."
}

To adapt this template, replace the [RESTRICTED_DOMAINS] placeholder with a list of your application's high-risk areas, such as ['medical advice', 'financial instructions', 'legal obligations']. The [DETECTED_HALLUCINATION_DESCRIPTION] should be a structured string from your upstream detector, including the specific sentence and the evidence gap. Ensure the upstream process provides a clear, machine-readable description to avoid ambiguity in classification. For high-stakes deployments, always log the rationale field for auditability and calibrate the severity thresholds against a golden dataset of human-labeled incidents.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Hallucination Severity Classification Prompt. Each variable must be populated before the prompt is sent. Validation notes describe how to verify the input is well-formed and safe before classification runs.

PlaceholderPurposeExampleValidation Notes

[DETECTED_HALLUCINATION]

The specific text span or claim already flagged as a potential hallucination by an upstream detector

The product launched in Q3 2024 with 2M users

Must be a non-empty string. Should be the exact output substring from the prior detection step. Truncate if longer than 2000 characters to avoid diluting severity signals

[SOURCE_EVIDENCE]

The ground-truth source material the claim should be checked against

Product launch date: Q1 2025. User count at launch: 500K beta users

Must be a non-empty string. Prefer the specific passage used by the upstream detector. If no source exists, set to 'NO_SOURCE_AVAILABLE' and expect a CRITICAL severity classification

[CLAIM_TYPE]

The category of factual claim being evaluated to calibrate severity thresholds

numerical_claim

Must be one of: numerical_claim, entity_claim, temporal_claim, attribution_claim, causal_claim, quote_claim, or general_factual. Use the upstream detector's classification if available, otherwise default to general_factual

[OUTPUT_CONTEXT]

The full AI-generated response containing the hallucinated claim for severity context

Full paragraph or multi-turn response surrounding the flagged claim

Must be a non-empty string. Include at least 200 characters before and after the hallucinated span. Null allowed only if the hallucination is a standalone output with no surrounding context

[DEPLOYMENT_CONTEXT]

The risk profile of the deployment environment to weight severity appropriately

customer_facing_financial_product

Must be one of: internal_tool, customer_facing_low_risk, customer_facing_high_risk, regulatory_workflow, or public_content. Default to customer_facing_high_risk if unknown. This field gates escalation thresholds

[UPSTREAM_CONFIDENCE]

The confidence score from the hallucination detector that first flagged this claim

0.87

Must be a float between 0.0 and 1.0. Values below 0.5 should trigger a review of whether severity classification is warranted. Null allowed if no upstream confidence is available, but severity classification reliability degrades

[PREVIOUS_SEVERITY]

The severity classification from any prior run on the same claim for drift detection

MAJOR

Must be one of: NONE, MINOR, MODERATE, MAJOR, CRITICAL, or null. If provided and the new classification differs by more than one level, flag for human review regardless of confidence. Null on first run

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Hallucination Severity Classification Prompt into a production monitoring pipeline with validation, retries, and tiered alerting.

The Hallucination Severity Classification Prompt is designed to sit downstream of a hallucination detection step. In a production RAG or content-generation pipeline, you first run a detection prompt that identifies unsupported claims, then pass each flagged claim into this severity classifier. This two-stage architecture keeps the classification prompt focused on severity judgment rather than detection, which improves reliability and makes each stage independently testable. The classifier expects a structured input containing the claim text, the source evidence, and the detection reason—typically the output of a Factual Consistency Check or Unsupported Claim Flagging prompt.

Wire this prompt as a post-detection processing step in your evaluation harness. After the detection prompt returns flagged claims, iterate over each claim and call the severity classifier with the claim, its associated evidence, and the detection context. Implement a JSON schema validator on the output to enforce the expected structure: severity_level (one of CRITICAL, MAJOR, MINOR, NEGLIGIBLE), severity_score (numeric 0-100), rationale, and escalation_recommended (boolean). If the output fails schema validation, retry once with the validation error included in the prompt context. If it fails again, log the failure and default to MAJOR severity with a requires_manual_review flag set to true. This conservative fallback prevents silent failures in your monitoring pipeline.

Model choice matters for severity classification. Use a model with strong reasoning capabilities (GPT-4, Claude 3.5 Sonnet, or equivalent) because distinguishing between a minor imprecision and a critical fabrication requires nuanced judgment. Set temperature=0 for deterministic outputs. For high-throughput pipelines, consider batching multiple claims into a single prompt call with clear delimiters, but keep batch sizes small (3-5 claims) to avoid attention dilution. Log every classification result with the full input context, model version, and timestamp for audit trails. If your system operates in a regulated domain (healthcare, finance, legal), route all CRITICAL and MAJOR classifications to a human review queue before any downstream action is taken.

Tiered alerting should be configured based on severity thresholds. CRITICAL classifications should trigger immediate pager alerts—these represent fabricated facts that could cause user harm or regulatory exposure. MAJOR classifications should create tickets in your incident management system for same-day review. MINOR classifications can feed into a weekly quality report. NEGLIGIBLE findings (minor wording imprecision with no factual impact) can be logged for trend analysis without alerting. Implement a severity trend monitor that tracks the ratio of CRITICAL+MAJOR classifications over time; a sudden spike often indicates a retrieval pipeline degradation or a prompt regression that needs immediate investigation.

Before deploying to production, calibrate the severity classifier against a golden dataset of 50-100 human-annotated examples spanning all four severity levels. Measure inter-rater agreement between the LLM judge and your human annotators using Cohen's kappa or quadratic weighted kappa. Target a kappa above 0.7 before trusting automated severity routing. Re-calibrate whenever you change the underlying model or significantly modify the prompt. Avoid using this classifier on outputs where the source evidence itself may be unreliable—the severity judgment is only as sound as the grounding detection that feeds it.

PRACTICAL GUARDRAILS

Common Failure Modes

Hallucination severity classification fails in predictable ways. Here are the most common failure modes, why they happen, and how to prevent them before they reach production dashboards or incident channels.

01

Severity Inflation for Minor Imprecision

What to watch: The classifier treats stylistic variation or minor paraphrasing as a hallucination, flagging 'critical' severity for outputs that are factually correct but not verbatim matches. This floods incident channels with false positives and erodes trust in the monitoring system. Guardrail: Include explicit severity definitions with examples distinguishing acceptable paraphrase from factual deviation. Add a 'negligible' severity tier for immaterial differences and require at least one factual error for 'major' or 'critical' classification.

02

Missing Severity Escalation for Fabricated Citations

What to watch: The classifier correctly detects unsupported claims but fails to escalate when the model fabricates entire sources, DOIs, or named entities. Fabricated citations are operationally more dangerous than unsupported opinions but often receive the same severity score. Guardrail: Add a dedicated citation-fabrication check as a severity multiplier. If a hallucination includes invented references, automatically escalate to 'critical' regardless of the base severity score. Log fabricated identifiers separately for source-audit workflows.

03

Context Window Truncation Masking Hallucinations

What to watch: When source documents exceed the classifier's context window, the prompt truncates evidence mid-document. The classifier then marks claims as hallucinated because the supporting passage was cut off, producing false hallucination alerts. Guardrail: Chunk source documents before classification and run verification per chunk. If a claim cannot be verified due to truncation, classify it as 'unverifiable' rather than 'hallucinated.' Log truncation events separately for retrieval pipeline debugging.

04

Ambiguous Claims Defaulting to Lowest Severity

What to watch: When the classifier encounters claims that are partially supported or ambiguous, it defaults to 'minor' severity to avoid over-flagging. This buries genuinely concerning hallucinations that require human review under a flood of low-severity noise. Guardrail: Require the classifier to output a confidence score alongside severity. Route low-confidence classifications to a human review queue regardless of assigned severity. Set a minimum confidence threshold for automated severity assignment.

05

Severity Drift Across Model Versions

What to watch: When the underlying LLM judge is updated, severity distributions shift without any change to the rubric. A previously 'minor' hallucination becomes 'major' under the new model, breaking alerting thresholds and making historical comparisons unreliable. Guardrail: Pin the judge model version in production configs. Run a calibration suite of 50-100 labeled examples across severity levels before deploying any model update. Alert if severity distribution shifts by more than 10% from baseline.

06

Numerical Hallucinations Receiving Same Severity as Qualitative Ones

What to watch: The classifier assigns identical severity to a fabricated statistic and a minor tonal misstatement. In finance, healthcare, or operations contexts, numerical fabrication is categorically more dangerous and requires different escalation. Guardrail: Add domain-specific severity modifiers. If the hallucination involves a number, percentage, date, or measurement, apply a one-tier severity escalation. Define domain-critical entity types in the prompt and instruct the classifier to treat fabrication of those types as automatically elevated.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Hallucination Severity Classification Prompt before deploying it in production. Each row defines a pass/fail criterion, the expected behavior, and a concrete test method. Run these tests against a curated set of known hallucination examples to calibrate the prompt's severity judgments.

CriterionPass StandardFailure SignalTest Method

Severity Level Assignment

Prompt correctly classifies a known minor imprecision as 'minor' and a known critical fabrication as 'critical'.

Prompt assigns 'minor' to a fabricated statistic or 'critical' to a minor date error.

Run against a golden dataset of 20 pre-labeled hallucination examples with known severity levels. Measure exact match accuracy.

Output Schema Compliance

Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed.

Output is missing the 'severity' field, 'rationale' is a string instead of an array, or JSON is unparseable.

Validate output with a JSON schema validator. Check field presence, types, and enum values for 'severity'.

Severity Enum Adherence

Output 'severity' field is exactly one of the allowed enum values: 'minor', 'moderate', 'major', 'critical'.

Output contains a severity value not in the allowed enum, such as 'low', 'high', or 'severe'.

Assert that output.severity is in ['minor', 'moderate', 'major', 'critical'] using a strict enum check.

Rationale Grounding

Every claim in the 'rationale' array references a specific piece of evidence from [SOURCE_TEXT] or explicitly notes its absence.

Rationale contains unsupported assertions like 'this is clearly wrong' without citing the source text.

For each rationale item, check if it contains a direct quote from [SOURCE_TEXT] or an explicit statement that evidence is missing. Flag items with neither.

Confidence Score Calibration

Confidence score is >= 0.8 for unambiguous cases and <= 0.5 for genuinely ambiguous edge cases.

Prompt assigns 0.95 confidence to a borderline case or 0.3 confidence to an obvious fabrication.

Test with 10 unambiguous and 10 ambiguous examples. Measure whether confidence scores correlate with ground-truth difficulty labels.

Empty Input Handling

Prompt returns a valid output with severity 'null' or 'minor' and a rationale explaining that no hallucination was detected when [CLAIM] is empty or identical to [SOURCE_TEXT].

Prompt fabricates a hallucination classification or returns a malformed response for empty input.

Submit an empty [CLAIM] string and a [CLAIM] that exactly matches [SOURCE_TEXT]. Verify output is valid and indicates no hallucination.

Multi-Claim Decomposition

When [CLAIM] contains multiple factual assertions, the prompt classifies the overall severity based on the most severe individual hallucination and notes all issues in the rationale.

Prompt only flags one hallucination and ignores a more severe one in the same input.

Submit a [CLAIM] with one minor and one critical hallucination. Verify severity is 'critical' and rationale addresses both.

Source Absence Handling

When [SOURCE_TEXT] is empty or null, prompt returns severity 'null' with a rationale stating that grounding cannot be assessed without source material.

Prompt hallucinates a severity classification or fabricates source evidence when none is provided.

Submit a valid [CLAIM] with an empty [SOURCE_TEXT]. Verify output.severity is null and rationale explains the inability to assess.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Enforce strict JSON output with schema validation on every call. Add a confidence score (0.0–1.0) and require the model to cite the specific hallucinated span from the output and the contradicting evidence from the source. Wire into an incident routing system: Minor → log only, Major → alert channel, Critical → page on-call. Add retry logic with temperature variation for low-confidence classifications.

Prompt modification

Add to the prompt: Output ONLY valid JSON matching this schema: {"severity": "MINOR|MODERATE|MAJOR|SEVERE|CRITICAL", "confidence": 0.0-1.0, "hallucinated_span": "exact text", "contradicting_evidence": "source passage", "rationale": "string"}. Include a [SEVERITY_DEFINITIONS] block with per-level criteria and escalation rules.

Watch for

  • Schema drift under high load or long contexts
  • Confidence scores that don't correlate with actual error rates
  • Silent failures when JSON parsing breaks
  • Alert fatigue if Major threshold is too sensitive
  • Missing human review for Severe/Critical classifications before customer impact
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.