This prompt is a guardrail component designed to sit between hallucination detection and automated action. Its job is to classify a previously flagged hallucination by severity so your system can make a reliable decision: auto-repair a minor drift, queue a material error for human review, or block a safety-critical fabrication entirely. The ideal user is an AI safety engineer or platform developer building a production validation pipeline for a RAG application, customer-facing chatbot, or any system where unsupported output can cause user harm or erode trust. You should use this prompt only after a detection step—such as the Unsupported Statement Detection or Sentence-Level Grounding Verification prompt—has already identified a specific claim and its source evidence as problematic.
Prompt
Hallucination Severity Classification Prompt Template

When to Use This Prompt
Understand the role of the Hallucination Severity Classification Prompt in your output triage and escalation pipeline.
The prompt expects three concrete inputs: the original generated statement, the source evidence it was supposed to be grounded in, and the reason the detection step flagged it. From these, it produces a severity label (minor_paraphrase_drift, material_factual_error, complete_fabrication, or safety_critical_hallucination) along with a structured justification. This output is designed to be machine-readable so your application can route it without human parsing. For example, a material_factual_error on a product price might trigger a retry with stricter grounding instructions, while a safety_critical_hallucination in a medical context should immediately block the response and escalate to an on-call reviewer. Do not use this prompt on unverified outputs or as a standalone hallucination detector; it will not reliably identify unsupported claims on its own and will instead produce misleading severity assessments.
The primary failure mode to avoid is using this classifier without a high-quality detection step upstream. If the detection step produces false positives, the severity classifier will confidently label benign paraphrases as fabrications, leading to unnecessary escalations and broken user experiences. Before deploying this prompt, validate your detection pipeline's precision and recall against a labeled dataset. Once in production, log every severity classification alongside the original detection reason and the final action taken. This traceability is essential for auditing automated decisions and tuning your escalation thresholds over time.
Use Case Fit
Where the Hallucination Severity Classification Prompt works, where it fails, and what you must provide before deploying it as a triage gate.
Good Fit: Output Triage Pipelines
Use when: you already have a hallucination detector flagging spans and need a second-stage classifier to decide between auto-repair, human review, or blocking. Guardrail: Run severity classification only on flagged outputs, not on every generated token, to control latency and cost.
Bad Fit: Real-Time Streaming Guardrails
Avoid when: you need to interrupt a streaming response mid-token. Severity classification requires the full output and detected hallucination spans before it can judge impact. Guardrail: Pair with a lightweight streaming interrupt prompt for real-time use and invoke severity classification asynchronously for post-hoc triage.
Required Inputs
Must provide: the full generated output, the list of detected hallucination spans with their evidence context, and the domain or risk profile. Guardrail: Validate that hallucination spans include source offsets before calling the severity classifier. Missing evidence context forces the classifier to guess, producing unreliable severity labels.
Operational Risk: Severity Drift
What to watch: the classifier may inflate severity for minor paraphrase drift or deflate severity for subtle factual errors that change meaning. Guardrail: Calibrate severity thresholds against human-reviewed examples from your domain. Run a weekly spot-check of 50 classified outputs to detect drift.
Operational Risk: Escalation Loop
What to watch: a high-severity classification that always triggers human review can create a bottleneck if the detector is noisy. Guardrail: Implement a confidence threshold. If the severity classifier's own confidence is below 0.8, route to a second judge prompt or fall back to a conservative auto-repair path.
Domain Adaptation Required
What to watch: severity definitions that work for general Q&A fail for medical, legal, or financial outputs where a single fabricated number is safety-critical. Guardrail: Override the default severity rubric with domain-specific examples. A hallucinated dosage is always critical regardless of the classifier's generic scale.
Copy-Ready Prompt Template
A reusable prompt template for classifying hallucination severity with square-bracket placeholders ready for runtime substitution.
This prompt template classifies detected hallucinations into severity tiers—minor paraphrase drift, material factual error, complete fabrication, or safety-critical hallucination—and produces a structured severity label with justification. Use it as the classification step in an output triage pipeline where downstream actions depend on severity: auto-repair for minor drift, human review for material errors, and blocking for safety-critical fabrications. The template expects you to have already identified a specific hallucinated span before classification; pair it with a hallucination detection prompt upstream.
textYou are a hallucination severity classifier. Your job is to evaluate a detected hallucination and assign a severity level based on the definitions below. ## INPUT - Generated Output: [GENERATED_OUTPUT] - Hallucinated Span: [HALLUCINATED_SPAN] - Source Evidence: [SOURCE_EVIDENCE] - Domain Context: [DOMAIN_CONTEXT] ## SEVERITY LEVELS 1. MINOR_PARAPHRASE_DRIFT: The output paraphrases the source but introduces subtle meaning shifts, imprecise wording, or minor omissions that do not change the core factual claim. The information is substantially correct but not perfectly faithful. 2. MATERIAL_FACTUAL_ERROR: The output contains a factual claim that contradicts the source evidence, misstates a specific detail (name, number, date, relationship), or asserts something the source does not support. The error could mislead a reader or affect a downstream decision. 3. COMPLETE_FABRICATION: The hallucinated span has no basis whatsoever in the source evidence. The claim, entity, or detail is entirely invented and cannot be inferred from any provided context. 4. SAFETY_CRITICAL_HALLUCINATION: The hallucination could cause harm if acted upon—incorrect medical guidance, false legal claims, dangerous instructions, fabricated safety information, or misrepresented regulatory status. This overrides all other classifications when the content carries safety risk. ## CONSTRAINTS [CONSTRAINTS] ## OUTPUT SCHEMA Return valid JSON matching this schema: { "severity": "MINOR_PARAPHRASE_DRIFT | MATERIAL_FACTUAL_ERROR | COMPLETE_FABRICATION | SAFETY_CRITICAL_HALLUCINATION", "confidence": 0.0-1.0, "justification": "Specific explanation referencing the hallucinated span and source evidence. Quote the conflicting or missing evidence.", "recommended_action": "auto_repair | human_review | block_output", "escalation_required": true/false } ## EXAMPLES [EXAMPLES] Classify the hallucination now.
Adapting the template: Replace [GENERATED_OUTPUT] with the full model response, [HALLUCINATED_SPAN] with the specific text flagged by your detection step, and [SOURCE_EVIDENCE] with the retrieved passages or context the output should have been grounded in. Use [DOMAIN_CONTEXT] to specify the vertical (medical, legal, financial, general) so the classifier can calibrate safety-critical judgments appropriately. [CONSTRAINTS] should include any domain-specific severity rules—for example, in medical contexts, any fabricated medication name or dosage is automatically safety-critical. [EXAMPLES] should contain 2-4 few-shot demonstrations covering each severity level with clear justifications. For high-risk domains, always route SAFETY_CRITICAL_HALLUCINATION and MATERIAL_FACTUAL_ERROR classifications to human review before any automated action. Validate the output JSON against the schema programmatically and retry with a repair prompt if the model returns an invalid severity enum or missing required fields.
Prompt Variables
Inputs the prompt needs to work reliably. Validate each before calling the model. Missing or malformed inputs are the most common cause of severity misclassification.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DETECTED_HALLUCINATION] | The specific statement or span flagged by an upstream hallucination detector | The patient was prescribed 500mg of aspirin daily. | Must be a non-empty string. Reject if null or whitespace-only. Should be the exact text span from the output, not a paraphrase. |
[SOURCE_EVIDENCE] | The complete set of source passages provided to the generation step | SOURCE A: Patient chart notes from 2024-03-15 indicate... SOURCE B: Medication list shows... | Must contain at least one source passage. Validate that the text is not truncated. If empty, severity defaults to CRITICAL with root cause INSUFFICIENT_CONTEXT. |
[CLAIM_TYPE] | The category of the statement being checked (factual, numerical, entity, procedural, attribution) | numerical | Must be one of the allowed enum values: factual, numerical, entity, procedural, attribution, temporal. Reject unknown types. Use to weight severity—numerical and entity hallucinations are often higher risk. |
[OUTPUT_CONTEXT] | The full generated output surrounding the detected hallucination for context | Based on your chart, your current medications include... | Optional but strongly recommended. Provides semantic context for distinguishing paraphrase drift from fabrication. If null, the classifier operates on the isolated span only. |
[DOMAIN] | The application domain for risk calibration | healthcare | Must be one of: healthcare, legal, finance, general, technical, scientific. Controls severity thresholds—a minor numerical error in healthcare escalates differently than in general domains. |
[PREVIOUS_SEVERITY] | The severity assigned to this same span in a prior classification run, if retrying | MAJOR | Optional. If present, must be one of the severity labels. Used to detect classification drift. If the new classification differs by more than one level, flag for human review. |
[USER_VISIBLE_CONTEXT] | Whether the output containing the hallucination was shown to an end user | Must be boolean. If true, escalation urgency increases. A CRITICAL hallucination shown to a user requires immediate notification, not just logging. |
Implementation Harness Notes
How to wire the Hallucination Severity Classification prompt into a production triage pipeline with validation, retries, and escalation logic.
The Hallucination Severity Classification prompt is designed to sit after a hallucination detector and before an escalation or repair workflow. Its job is narrow: take a flagged hallucination (the claim, the source evidence, and the detector's output) and assign a severity label with justification. This prompt is not a detector itself—it assumes a prior step has already identified a candidate hallucination. In a production pipeline, you will typically call this prompt inside a post-generation validation layer, where each flagged span from a detector like Unsupported Statement Detection or Fabricated Detail Detection is routed here for severity triage.
Integration pattern. Wire the prompt as a single-turn classification call. Inputs must include: the original user query or task context, the full generated output, the specific hallucinated claim or span, the relevant source evidence passages, and the detector's confidence score or label. The prompt returns a JSON object with severity (one of minor_paraphrase_drift, material_factual_error, complete_fabrication, or safety_critical), a justification string, and a recommended_action (e.g., auto_repair, human_review, block). Validate the output against this schema immediately. If the model returns an unrecognized severity label or missing fields, retry once with a stricter schema reminder. After two failures, default to human_review and log the parse error for inspection.
Model choice and latency budget. Severity classification is a lower-latency, lower-cost step compared to detection or repair. A fast model (e.g., GPT-4o-mini, Claude Haiku, or a fine-tuned small classifier) is usually sufficient, provided you calibrate against a human-labeled severity dataset. If your use case is safety-critical—healthcare, legal, financial—run a periodic eval comparing the classifier's severity labels against expert human judgments. Track false negatives on safety_critical and complete_fabrication as your primary metric; a missed critical hallucination that gets auto-repaired instead of blocked is the worst failure mode.
Retry, logging, and escalation. Log every classification result with the input context hash, severity label, justification, and the detector's upstream confidence. This trace is essential for auditing triage decisions and tuning severity thresholds over time. If the prompt returns safety_critical, bypass any auto-repair step and route directly to a human review queue with the full context attached. For complete_fabrication, block the output from reaching the user and trigger a re-generation with stricter grounding instructions. For material_factual_error, you may attempt auto-repair using a separate repair prompt, but only if the domain risk tolerance allows it. For minor_paraphrase_drift, log and allow the output through with a quality flag for offline review.
What to avoid. Do not use this prompt as a standalone hallucination detector—it will miss hallucinations that were never flagged upstream. Do not skip schema validation on the output; an unparseable severity label in a production pipeline can silently drop a critical hallucination. Do not treat severity labels as static; periodically re-evaluate your severity taxonomy against real production incidents and adjust the prompt's definitions and examples accordingly. Finally, always include a human-review escape hatch: if the classifier's confidence is low or the input context is ambiguous, escalate rather than guess.
Expected Output Contract
Enforce this schema in your API call or post-process to validate. Each field must be present and conform to the specified type and validation rule before the severity classification is accepted downstream.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
severity_label | enum string | Must be one of: minor_paraphrase_drift, material_factual_error, complete_fabrication, safety_critical_hallucination. Reject any other value. | |
severity_score | float | Must be a number between 0.0 and 1.0 inclusive. Parse as float and check bounds. Higher score indicates greater severity. | |
justification | string | Must be non-empty and contain at least one reference to a specific claim or span from [DETECTED_HALLUCINATIONS]. Reject empty or purely generic justifications. | |
affected_claims | array of strings | Each element must match a claim text from the input [DETECTED_HALLUCINATIONS] list. Array must not be empty. Perform exact or fuzzy match against input claims. | |
recommended_action | enum string | Must be one of: auto_repair, human_review, block_output. Reject any other value. Action must align with severity_label per policy mapping. | |
confidence | float | Must be a number between 0.0 and 1.0 inclusive. If confidence is below [CONFIDENCE_THRESHOLD], escalate to human_review regardless of severity_label. | |
evidence_summary | string | If provided, must reference specific source passages from [SOURCE_EVIDENCE]. If null, allowed only when no evidence exists for the affected claims. Null otherwise triggers a warning. | |
classification_timestamp | ISO 8601 string | If provided, must parse as valid ISO 8601 datetime. If absent, the harness should stamp the current time before logging. |
Common Failure Modes
Hallucination severity classification fails in predictable ways. Here are the most common failure modes and how to guard against them before they reach production.
Severity Inflation on Ambiguous Cases
What to watch: The model classifies minor paraphrase drift or stylistic variation as a material factual error, flooding the review queue with false positives. This happens when the severity definitions lack clear boundaries between 'minor drift' and 'material error.' Guardrail: Anchor each severity level with 2-3 contrastive examples in the prompt. Add a tie-breaking rule: when uncertain between two adjacent severity levels, default to the lower one and flag for human calibration.
Missing Safety-Critical Hallucinations
What to watch: The classifier treats a fabricated dosage, contraindication, or safety instruction as a routine factual error instead of escalating it to safety-critical. This occurs when domain-specific danger signals aren't explicitly listed in the severity definitions. Guardrail: Include a domain-specific danger-signal checklist in the prompt (e.g., 'If the hallucination involves medication, dosage, allergy, or safety procedure, classify as safety-critical regardless of other factors'). Run periodic red-team tests with known safety-critical fabrications.
Context Window Truncation Masking Evidence
What to watch: When the source evidence and generated output together exceed the context window, the model classifies severity based on partial information. Fabrications near the end of long outputs go undetected because the relevant source passage was truncated. Guardrail: Chunk long outputs and verify each chunk against its corresponding evidence span before severity classification. If the full evidence-plus-output pair exceeds the context limit, split into overlapping segments and classify each independently, then take the maximum severity.
Justification-Classification Mismatch
What to watch: The model assigns a severity label but the written justification describes a different severity level—for example, labeling something 'minor drift' while the justification describes a completely fabricated statistic. This breaks downstream automation that relies on the label alone. Guardrail: Add a self-consistency check instruction: 'After writing your justification, re-read it and confirm the severity label matches. If the justification describes a more severe issue than the label, revise the label upward.' In the eval harness, use an LLM judge to compare label-justification pairs for consistency.
Over-Reliance on Surface Fluency
What to watch: Well-written but entirely fabricated outputs receive lower severity scores because the model confuses linguistic fluency with factual accuracy. A polished fabrication about a plausible-sounding study gets classified as 'minor drift' while a clumsily worded but factually supported statement gets flagged. Guardrail: Add an explicit instruction: 'Evaluate factual grounding only. Ignore writing quality, tone, confidence, and fluency. A well-written fabrication is still a fabrication.' Include a counterexample in the few-shot examples showing a fluent fabrication classified correctly as high severity.
Threshold Drift Across Model Versions
What to watch: When you upgrade the underlying model, severity classification thresholds shift silently. A model that previously classified 5% of outputs as 'material error' now classifies 15%, breaking downstream routing rules and review queue capacity. Guardrail: Maintain a golden dataset of 50-100 pre-classified hallucination examples spanning all severity levels. Run this dataset against every model version before deployment and alert if severity distribution shifts by more than 10% in any category. Version-lock the classification prompt with the model version in your observability traces.
Evaluation Rubric
Run these checks against a golden dataset with known severity labels. Each criterion validates a specific failure mode of the hallucination severity classifier. Use this rubric to gate prompt changes before production deployment.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Severity label accuracy | ≥90% exact match with human-annotated severity labels on golden set | Classifier assigns 'minor' to a complete fabrication or 'critical' to paraphrase drift | Run classifier on 100+ annotated examples; compute exact-match accuracy and confusion matrix per severity class |
Justification groundedness | Every justification sentence references a specific span from [DETECTED_HALLUCINATION] or [SOURCE_EVIDENCE] | Justification contains claims not traceable to input fields; hallucinated reasoning about why something is wrong | Spot-check 50 justifications; require span-level citation for each reasoning sentence; flag unsupported claims |
Critical severity recall | ≥95% recall on safety-critical hallucinations (fabricated medical advice, legal citations, financial figures) | Critical hallucination classified as 'major' or 'minor'; safety risk passes through triage undetected | Curate 30+ safety-critical examples; measure recall at 'critical' label; any miss triggers mandatory human review gate |
Minor severity precision | ≥85% precision on 'minor' label (paraphrase drift, stylistic variation, non-material wording changes) | Material factual errors classified as 'minor'; downstream auto-repair pipeline lets errors through | Sample 40 'minor' predictions; have domain expert verify each is genuinely non-material; compute precision |
Fabrication vs. error discrimination | ≥90% accuracy distinguishing 'complete fabrication' from 'material factual error' on ambiguous cases | Classifier labels unsupported but plausible-sounding claim as 'error' when no source evidence exists at all | Build 20 borderline test cases where evidence is absent vs. contradicted; measure discrimination accuracy |
Output schema compliance | 100% of outputs parse as valid JSON matching [OUTPUT_SCHEMA] with all required fields present | Missing 'severity' field; 'justification' is null or empty string; enum value outside allowed set | Validate all outputs against JSON Schema; reject any response that fails parse or schema check; count violations |
Confidence calibration | Confidence score correlates with human agreement: high confidence (>0.9) has ≥95% accuracy; low confidence (<0.7) has ≤70% accuracy | High-confidence predictions on wrong labels; low-confidence predictions on obviously correct labels | Bin predictions by confidence decile; compute accuracy per bin; check monotonic relationship between confidence and accuracy |
Edge case: empty hallucination list | When [DETECTED_HALLUCINATION] is empty or null, classifier returns severity='none' with justification='No hallucination detected in input' | Classifier invents a hallucination to classify; returns 'minor' or higher when no hallucination was provided | Test with 10 empty-input cases; verify severity='none' and justification matches expected template; flag any non-none output |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base severity classification prompt. Use a simple 3-level scale (Minor, Material, Critical) instead of the full taxonomy. Skip structured output enforcement initially—accept natural-language severity labels and justifications. Run against a small set of known hallucination examples to calibrate.
Prompt modification
Replace the full severity taxonomy with: Classify the hallucination as one of: [MINOR], [MATERIAL], or [CRITICAL]. Remove the [OUTPUT_SCHEMA] placeholder and ask for a single-line label followed by a one-sentence justification.
Watch for
- Inconsistent label usage across runs
- Model confusing severity with confidence
- Over-classifying paraphrases as material errors

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us