Inferensys

Prompt

Error Severity Classification Prompt

A practical prompt playbook for using Error Severity Classification Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the ideal job-to-be-done, required inputs, and operational boundaries for the Error Severity Classification Prompt.

This prompt is designed for incident response teams and SREs who need to triage production errors at scale. It classifies raw error logs, alert payloads, or incident reports into severity levels (SEV1 through SEV5) based on user impact, system scope, and recoverability. Use this prompt when you need a consistent, auditable triage queue that aligns with your SLA definitions and historical incident patterns. The prompt expects structured input containing error details, affected services, and current observability signals.

The ideal user is an on-call engineer or incident commander facing a high volume of alerts who needs to separate critical outages from minor degradations before human investigation begins. The prompt requires specific context to function reliably: a defined error taxonomy, current SLA thresholds, affected service criticality ratings, and recent deployment or config change logs. Without this context, severity assignments will be generic and potentially misaligned with business impact. The prompt is not a replacement for on-call judgment in novel catastrophic failures, nor does it handle real-time paging decisions without human review. It also cannot classify errors from services or failure modes absent from its provided taxonomy.

Before deploying this prompt, ensure you have a calibrated severity framework that defines what constitutes each level in your organization. Run the prompt against a labeled dataset of at least 50 historical incidents and measure agreement with human-assigned severities. Pay special attention to SEV1/SEV2 boundary errors—these are the most costly to misclassify. If agreement falls below 90% on critical severities, refine your input context or add few-shot examples drawn from your actual incident history. Never use this prompt to automatically trigger paging or escalation without a human approval step for SEV1 and SEV2 classifications.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Error severity classification requires clear operational definitions and calibration data to be reliable in production.

01

Good Fit: Structured Incident Triage

Use when: you have a defined incident taxonomy, SLA tiers, and historical severity examples. The prompt excels at applying consistent severity labels across a queue of production errors when fed structured error payloads and impact metadata. Guardrail: Provide at least 5 calibrated examples per severity level and validate against a golden dataset of 50+ incidents before production use.

02

Bad Fit: Novel Failure Modes Without Precedent

Avoid when: the error type has never been seen before and no historical incident data exists for calibration. The model will default to surface-level heuristics like error count or user reports rather than understanding systemic blast radius. Guardrail: Route novel errors to a human-in-the-loop queue and only add them to automated classification after a postmortem creates a labeled example.

03

Required Inputs: Impact, Scope, and Recoverability

What to watch: the prompt cannot classify severity from an error code alone. It needs structured context: number of affected users, service criticality, data loss potential, recovery path, and time since onset. Guardrail: Build a pre-processing step that enriches each error with these fields from monitoring systems before the prompt runs. Reject classification requests with missing required fields.

04

Operational Risk: SLA Misalignment

What to watch: the model may apply generic severity heuristics that conflict with your organization's specific SLA definitions. A database timeout might be SEV1 for a payments service but SEV3 for an internal reporting tool. Guardrail: Include your SLA definitions directly in the prompt context and run weekly calibration checks comparing model classifications against on-call engineer determinations.

05

Operational Risk: Severity Drift During Incidents

What to watch: as an incident evolves, new information may change the appropriate severity, but the model classifies a snapshot. A SEV3 that spreads to a second region should become SEV1. Guardrail: Re-run classification every 5 minutes during active incidents with updated impact data. Flag any severity change for human confirmation before updating the incident record.

06

Operational Risk: Over-Classification Under Pressure

What to watch: during major outages, the model may escalate everything to SEV1 because every error looks critical when the system is degraded. This floods on-call rotations and desensitizes responders. Guardrail: Cap the number of concurrent SEV1 classifications and require a second model call or human review when the cap is exceeded. Log over-classification rates for post-incident review.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt template for classifying error severity that you can paste directly into your orchestration layer.

This template is designed to be dropped into your incident triage pipeline. It expects structured input about a production error and returns a severity classification with justification, impact assessment, and recommended response actions. Replace every square-bracket placeholder with live data from your monitoring systems, alert payloads, or incident management tools before each inference call. The template includes calibration anchors against your historical incident data and SLA definitions to prevent severity inflation or underestimation.

text
You are an incident severity classifier for a production engineering team. Your task is to classify the severity of a production error based on impact, scope, and recoverability. You must produce a structured classification with justification and recommended response actions.

## INPUT
[ERROR_DETAILS]

## CLASSIFICATION RULES
Use the following severity levels:
- **SEV0 (Critical):** Complete service outage affecting all users, data loss or corruption in progress, security breach with active exploitation, or revenue loss exceeding [$CRITICAL_REVENUE_THRESHOLD] per minute.
- **SEV1 (High):** Major feature unavailable for >[MAJOR_FEATURE_THRESHOLD]% of users, significant performance degradation blocking core workflows, or data inconsistency requiring immediate rollback.
- **SEV2 (Medium):** Partial feature degradation affecting <[PARTIAL_FEATURE_THRESHOLD]% of users, non-blocking errors with workaround available, or delayed processing within SLA but requiring attention.
- **SEV3 (Low):** Cosmetic issues, non-critical warnings, or errors affecting <[LOW_IMPACT_THRESHOLD]% of users with no workflow blockage.

## CALIBRATION ANCHORS
Use these historical examples to calibrate your classification:
[HISTORICAL_INCIDENT_EXAMPLES]

## SLA CONTEXT
Current SLA definitions:
[SLA_DEFINITIONS]

## OUTPUT SCHEMA
Return a JSON object with this exact structure:
{
  "severity": "SEV0|SEV1|SEV2|SEV3",
  "confidence": 0.0-1.0,
  "impact_summary": "One-sentence description of user-facing impact",
  "affected_scope": {
    "user_percentage": "estimated percentage or 'unknown'",
    "services": ["list of affected services"],
    "regions": ["list of affected regions or 'global'"]
  },
  "recoverability": "immediate|workaround_available|manual_intervention_required|unknown",
  "justification": "Evidence-based reasoning linking the error to the severity level, referencing specific calibration anchors where applicable",
  "recommended_actions": ["ordered list of immediate response steps"],
  "escalation_needed": true/false,
  "escalation_target": "on-call team or individual if escalation_needed is true, otherwise null"
}

## CONSTRAINTS
- If the error affects a revenue-critical path, bias toward higher severity.
- If the error has a known workaround that restores full functionality, reduce severity by one level.
- If insufficient information exists to classify confidently, set confidence below 0.7 and flag escalation_needed as true.
- Do not invent impact data. If user percentage is unknown, state 'unknown'.
- Reference specific calibration anchors in your justification when the error pattern matches a historical incident.

Adaptation guidance: Replace [ERROR_DETAILS] with structured error data from your observability pipeline—include the error message, stack trace, affected endpoint, user impact signals, and any alert context. Populate [HISTORICAL_INCIDENT_EXAMPLES] with 3-5 real incidents from your postmortem database, each showing the error signature and the severity level that was ultimately assigned. Fill [SLA_DEFINITIONS] with your organization's actual response time targets per severity tier. The revenue and percentage thresholds in the severity definitions should be tuned to your specific service's scale—a 5% user impact might be SEV0 for a small B2B product but SEV2 for a consumer app with millions of users. Test the prompt against 10-20 historical incidents where you know the correct severity, and adjust the calibration anchors until the model's classifications match your team's actual severity assignments at least 85% of the time before deploying to production triage.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the Error Severity Classification Prompt needs to work reliably. Validate each before inference to prevent misclassification and ensure consistent triage output.

PlaceholderPurposeExampleValidation Notes

[ERROR_PAYLOAD]

Raw error object or log line to classify

{"error": "ConnectionTimeout", "service": "payment-api", "status": 504, "trace_id": "abc123"}

Must be a non-empty string or valid JSON object. Reject null or whitespace-only inputs. Validate JSON parseability if structured input is expected.

[SERVICE_CONTEXT]

Service name, criticality tier, and ownership info

Must include service name and tier. Validate tier against allowed enum: [Tier-0, Tier-1, Tier-2, Tier-3]. Reject if service name is missing.

[SEVERITY_DEFINITIONS]

Organization-specific severity level criteria with SLAs

SEV1: Complete outage, revenue impact > $10K/min, 15-min response. SEV2: Degraded, no revenue loss, 1-hr response.

Must define at least 3 severity levels with concrete impact thresholds. Validate that each level has a response time target and an escalation path. Reject definitions that are purely subjective.

[HISTORICAL_INCIDENTS]

Recent incidents for calibration and deduplication

[{"id": "INC-421", "error": "ConnectionTimeout", "service": "payment-api", "severity": "SEV1", "ts": "2024-01-15"}]

Optional but strongly recommended. If provided, must be a valid JSON array. Validate each entry has id, error, and severity fields. Null allowed if no history exists.

[OUTPUT_SCHEMA]

Expected JSON schema for the classification output

{"severity": "SEV1", "confidence": 0.95, "justification": "...", "dedup": false}

Must be a valid JSON Schema object. Validate required fields: severity, confidence, justification. Confidence must be a float between 0.0 and 1.0. Reject schemas missing justification requirement.

[CALIBRATION_THRESHOLD]

Minimum confidence score to auto-accept classification

0.85

Must be a float between 0.5 and 1.0. Values below 0.5 indicate the prompt is unreliable. Validate range. If confidence is below this threshold, route to human review.

[MAX_RETRIES]

Maximum retry attempts if classification confidence is low

3

Must be a positive integer between 1 and 5. Validate range. Retries should use varied phrasing or additional context. After max retries, escalate to on-call without further delay.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the severity classification prompt into a production incident response pipeline with validation, retries, and human review gates.

The Error Severity Classification Prompt is designed to sit at the entry point of your incident triage pipeline, consuming raw error telemetry and producing a structured severity assessment before the incident reaches a human responder or automated runbook. In production, this prompt should be wrapped in a thin service layer that handles input normalization, output validation, and routing. The prompt expects a structured input payload containing the error signature, affected service, user impact indicators, and any available recovery context. Before calling the model, your harness should assemble this payload from your observability stack—pulling error codes from your APM, user impact counts from your analytics pipeline, and recovery status from your orchestration layer. Never pass raw, unnormalized log lines directly to the prompt; the classification quality depends on consistent input structure.

After the model returns a severity classification, your harness must validate the output against a strict schema before acting on it. The expected output is a JSON object with fields for severity_level (one of SEV0, SEV1, SEV2, SEV3, SEV4), confidence_score (0.0 to 1.0), justification (a concise explanation tied to the input evidence), and recommended_escalation (a boolean indicating whether this should bypass normal triage queues). Implement a post-processing validator that rejects any response where severity_level is not in the allowed enum, where confidence_score falls below a configurable threshold (start at 0.7 and tune based on your false-positive tolerance), or where the justification field is empty or fails to reference specific input fields. For SEV0 and SEV1 classifications, route the incident to an on-call responder immediately but always include the model's justification and confidence score so the human can override. For SEV2 and below, queue the incident in your ticketing system with the classification attached as metadata. Log every classification decision—including the raw prompt, model response, validation result, and final routing action—for auditability and prompt drift monitoring.

Model choice matters here. Use a model with strong instruction-following and structured output capabilities; GPT-4o, Claude 3.5 Sonnet, or equivalent are appropriate for this task. Avoid smaller or older models that may struggle with the nuanced trade-offs between SEV1 and SEV2 classifications, where the difference often hinges on subtle impact-scope distinctions. Set temperature to 0 or a very low value (0.1 maximum) to minimize variance in severity calls. If your incident volume is high, consider implementing a lightweight pre-filter: errors with zero user impact and known transient signatures can skip the LLM classification entirely and auto-resolve as SEV4. For high-risk domains—financial services, healthcare, critical infrastructure—always require human acknowledgment for SEV0 and SEV1 classifications within a defined SLA window. The prompt includes a [RISK_LEVEL] parameter; set this to high for regulated environments to instruct the model to prefer over-classification when uncertain, reducing the risk of a critical incident being misclassified as low severity.

Calibration is an ongoing process, not a one-time setup. Maintain a golden dataset of 50–100 historical incidents with expert-assigned severity labels, and run the prompt against this dataset weekly or after any prompt change. Track precision and recall per severity level, paying special attention to SEV0 recall (you cannot afford to miss a critical incident) and SEV3/SEV4 precision (you do not want low-severity noise flooding your on-call rotations). When the model disagrees with the historical label, log the disagreement for human review—these cases often reveal either prompt weaknesses or inconsistencies in your historical labeling. Integrate these evals into your CI/CD pipeline for the prompt itself, treating prompt changes with the same rigor as code changes. If your SLA definitions or incident taxonomy change, update the [CONSTRAINTS] block in the prompt template and re-run the full calibration suite before deploying.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the model's JSON response when classifying error severity. Use this contract to parse, validate, and store the triage output programmatically.

Field or ElementType or FormatRequiredValidation Rule

error_id

string

Must match the [ERROR_ID] from the input exactly. No modification allowed.

severity_level

enum: SEV0 | SEV1 | SEV2 | SEV3 | SEV4

Must be one of the five defined severity levels. No other values accepted.

classification_rationale

string

Must be 2-5 sentences referencing specific evidence from [ERROR_CONTEXT] and [SLA_DEFINITIONS]. Cannot be generic.

impact_scope

object

Must contain 'affected_users' (string or null) and 'affected_services' (array of strings). Null only if genuinely unknown.

recoverability

enum: automatic | manual | unknown

Must be one of the three values. If 'automatic', a 'recovery_mechanism' field must be present.

calibration_check

object

Must contain 'similar_historical_incident' (string or null) and 'confidence_score' (float 0.0-1.0). Score must be >= 0.5.

suggested_sla_tier

string

Must match a tier name from the provided [SLA_DEFINITIONS] input. Validation fails if tier name is hallucinated.

requires_immediate_escalation

boolean

Must be true if severity_level is SEV0 or SEV1, otherwise false. No exceptions.

PRACTICAL GUARDRAILS

Common Failure Modes

Error severity classification prompts fail in predictable ways when deployed in production incident response. These cards cover the most common failure modes, why they happen, and how to guard against them before an incident escalates.

01

Severity Drift Under Load

What to watch: When multiple incidents fire simultaneously, the model starts classifying everything as SEV1 or SEV0, overwhelming on-call teams with false critical alerts. This happens because the prompt lacks relative prioritization context and the model overweights recency. Guardrail: Include a hard constraint that no more than one active SEV0 can exist at a time, and require explicit justification when upgrading severity. Add a pre-classification step that groups related alerts before severity assignment.

02

SLA Definition Misalignment

What to watch: The model applies generic severity heuristics that don't match your organization's actual SLA definitions, recovery time objectives, or business impact tiers. A database replica lag might be SEV2 in your SLA but the model classifies it as SEV1 because it sees 'database' and 'degraded.' Guardrail: Inject your exact SLA definitions, RTO/RPO targets, and severity tier criteria into the prompt context on every call. Validate classifications against historical incidents where severity was correctly assigned by humans.

03

Missing Impact Scope Evidence

What to watch: The model assigns severity based on the error type alone without considering blast radius, affected user count, or revenue impact. A payment processing error affecting 3 beta users gets the same severity as one affecting all production traffic. Guardrail: Require the prompt to extract and weigh explicit impact signals—user count, region, feature criticality, revenue path—before assigning severity. If impact scope is unknown, default to a lower severity with a flag for human escalation rather than assuming worst case.

04

Recoverability Blindness

What to watch: The model overweights error type and underweights whether the system can self-heal or requires manual intervention. A transient timeout with automatic retry success gets classified the same as a persistent data corruption requiring manual restore. Guardrail: Add a recoverability axis to the classification schema. Require the prompt to check for automated recovery signals—retry success rates, circuit breaker state, self-healing status—before finalizing severity. Errors that self-resolve within the SLA window should never exceed SEV3.

05

Historical Calibration Decay

What to watch: The prompt works well during initial testing against curated historical incidents but drifts as new error patterns, services, and failure modes emerge in production. Classification accuracy degrades silently because there's no ongoing calibration feedback loop. Guardrail: Implement a weekly calibration run against the last 7 days of human-classified incidents. Flag any error category where model severity diverges from human-assigned severity by more than one tier. Use these divergences to update few-shot examples in the prompt.

06

Justification Hallucination

What to watch: The model produces confident-sounding but factually wrong justifications for severity assignments, citing non-existent metrics, fabricated user impact numbers, or incorrect service dependencies. This erodes trust when on-call engineers act on the classification. Guardrail: Constrain justifications to only reference evidence explicitly present in the input incident payload. Require the output schema to separate 'evidence from input' from 'inferred impact.' Add a validator that rejects justifications containing metrics or service names not found in the source incident data.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a pass/fail basis before shipping the Error Severity Classification Prompt. Run these tests against a golden dataset of historical incidents with known severities and SLA definitions.

CriterionPass StandardFailure SignalTest Method

Severity label assignment

Output severity matches the calibrated severity from historical incident data for at least 90% of test cases

Model assigns SEV1 to a known SEV3 incident or vice versa; severity distribution differs significantly from historical baseline

Run prompt against 50+ labeled historical incidents; compute exact-match accuracy and confusion matrix

Justification quality

Every severity classification includes a justification that references at least one concrete dimension: user impact, revenue impact, data loss risk, or recovery complexity

Justification is missing, generic (e.g., 'it seems important'), or contradicts the assigned severity level

Parse justification field; check for presence of impact dimension keywords; human review on 10% sample

SLA alignment

Assigned severity maps correctly to the organization's defined SLA tiers (response time, escalation path) as provided in [SLA_DEFINITIONS]

SEV1 assigned to an incident with a 24-hour response SLA target; severity implies wrong on-call rotation or escalation policy

Cross-reference output severity against [SLA_DEFINITIONS] lookup table; flag mismatches

Multi-dimensional impact handling

When an incident affects multiple dimensions (e.g., data loss + revenue impact), the model selects the highest applicable severity rather than averaging or defaulting to the lowest

Model assigns SEV3 when data loss (SEV1 criterion) is present alongside a SEV3 availability issue

Test with synthetic incidents that combine SEV1 and SEV3 impact signals; verify output is SEV1

Uncertainty expression

When input evidence is ambiguous or incomplete, the model either requests clarification or assigns severity with an explicit confidence qualifier (e.g., 'tentative SEV2 pending user-impact confirmation')

Model assigns a definitive severity without noting missing information when key fields like [USER_IMPACT_COUNT] or [REVENUE_IMPACT] are null or 'unknown'

Feed incidents with deliberately missing fields; check output for uncertainty markers or clarification requests

Edge case: partial degradation

Partial service degradation affecting a subset of users is classified consistently with the organization's degradation policy (typically SEV2 or SEV3, not SEV1)

Partial degradation of a non-critical feature is escalated to SEV1; or full outage of a critical path is downgraded to SEV3

Test with scenarios specifying exact degradation scope and user percentage; verify against policy thresholds in [SEVERITY_POLICY]

Output schema compliance

Output strictly matches [OUTPUT_SCHEMA] with all required fields present and correctly typed; no extra fields or markdown wrapping

Missing required field like 'severity_justification'; severity field contains free text instead of enum value; output wrapped in markdown code fences

Parse output as JSON; validate against [OUTPUT_SCHEMA] using schema validator; reject on any validation error

Recoverability assessment

Classification considers whether the error is self-recovering, requires manual intervention, or has an existing runbook, and reflects this in the severity or a separate 'recoverability' field

Model assigns SEV1 to a self-healing transient error that resolves within the SLA window; or ignores that no runbook exists for a SEV1 incident

Test with incidents that include auto-recovery signals; verify severity is downgraded or recoverability field is populated correctly

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single severity scale and minimal calibration. Replace [HISTORICAL_INCIDENT_DATA] with a few hand-labeled examples. Drop the SLA mapping step and focus on getting consistent severity labels from raw incident descriptions.

code
Classify this error by severity (SEV1-SEV4):
[ERROR_DESCRIPTION]

Use these definitions:
- SEV1: Complete outage, customer-facing, no workaround
- SEV2: Major degradation, customer-facing, partial workaround
- SEV3: Minor impact, internal or limited scope
- SEV4: Cosmetic, no user impact

Watch for

  • Inconsistent severity assignment across similar errors
  • Over-classification when the model defaults to SEV1 for any customer mention
  • Missing justification that makes it hard to calibrate later
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.