Inferensys

Prompt

SLA Breach Risk Routing Prompt

A practical prompt playbook for using the SLA Breach Risk Routing Prompt in production AI workflows to detect and escalate potential SLA violations before they occur.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the operational context, required inputs, and boundaries for the SLA Breach Risk Routing Prompt.

This prompt is for operations engineers building proactive breach detection into routing middleware. Its job is to assess whether current queue depth, agent availability, and elapsed time create an SLA breach risk and to determine the correct escalation path. Use this prompt when you need a deterministic, auditable risk score that controls queue reordering, agent allocation, or management escalation before a breach occurs. The prompt assumes you have real-time queue metrics, agent status data, and defined SLA targets available as structured inputs. It is designed to be called synchronously within a routing decision loop, where its output directly influences the next action the system takes.

Do not use this prompt for post-breach reporting, root-cause analysis, or customer-facing breach notifications. It is not designed to explain why a breach happened or to generate a narrative summary for stakeholders. It is also not a substitute for a full capacity planning model; it makes a point-in-time risk assessment based on current state, not a long-term forecast. The prompt works best when the inputs are fresh (seconds old, not minutes) and when the SLA targets are expressed as concrete time thresholds. If your queue metrics are sampled infrequently or your agent status data is stale, the risk score will be unreliable and may trigger false escalations.

Before deploying this prompt, ensure you have a well-defined escalation policy that the prompt's output can map to. The prompt will return a risk level and a recommended action, but your application layer must enforce what those actions mean—such as reordering a queue, paging an on-call engineer, or moving a ticket to a manager's review bucket. Pair this prompt with a validation layer that checks for missing or out-of-range input fields, and log every risk assessment with its inputs and outputs for auditability. In high-stakes environments, consider adding a human approval step for critical risk scores before automated actions are taken.

PRACTICAL GUARDRAILS

Use Case Fit

Where the SLA Breach Risk Routing Prompt delivers value and where it introduces operational risk. Use these cards to decide if this prompt fits your routing middleware before you integrate it.

01

Good Fit: Real-Time Queue Monitoring

Use when: your routing middleware has access to live queue depth, agent availability, and elapsed-time signals. The prompt excels at comparing current state against SLA targets and flagging tickets that will breach without intervention. Avoid when: queue data is stale, sampled, or delayed by more than 60 seconds—the model will make escalation decisions on outdated information.

02

Bad Fit: Static Ticket Triage

Avoid when: you need a one-time priority label at ticket creation without ongoing reassessment. This prompt is designed for continuous breach detection, not initial classification. Use instead: a Priority and Urgency Scoring Prompt for intake triage, then layer this prompt into your escalation loop for active queue management.

03

Required Input: SLA Context Window

What to watch: the prompt cannot calculate breach risk without explicit SLA targets per ticket. Guardrail: always provide the ticket's SLA tier, response-time target, and resolution-time target as structured fields in the prompt context. Missing or implicit SLAs produce hallucinated risk scores. Validate that every ticket carries its SLA contract before invoking breach assessment.

04

Operational Risk: Over-Escalation During Queue Spikes

What to watch: normal queue fluctuations during peak hours can trigger false breach alarms, flooding escalation paths and exhausting on-call teams. Guardrail: implement a cooldown threshold—require breach risk to persist across two consecutive assessments before escalating. Add a minimum queue-age filter to prevent new tickets from triggering immediate breach flags.

05

Operational Risk: Missing Agent Context

What to watch: the prompt may escalate tickets when agents are actively working on them but haven't updated ticket state. Guardrail: include agent assignment status and last-activity timestamps in the prompt context. Suppress breach flags for tickets with recent agent activity unless the SLA window has definitively closed.

06

Boundary: Not a Replacement for SLO Monitoring

What to watch: teams may treat this prompt as their primary SLA compliance monitor, but it operates per-ticket, not across the aggregate. Guardrail: use this prompt for individual ticket routing decisions. Pair it with a separate SLO monitoring system that tracks aggregate breach rates, burn rates, and error budgets. The prompt escalates tickets; your SLO dashboard escalates systemic issues.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template for assessing SLA breach risk and recommending escalation actions.

This prompt template is designed to be embedded in a routing middleware function. It takes a support ticket and its current operational context—queue depth, agent availability, and elapsed time—and produces a structured risk assessment. The output is not a conversational reply; it is a machine-readable JSON object that your application can use to re-prioritize a queue, trigger a PagerDuty alert, or move a ticket into an escalation workflow. The template uses square-bracket placeholders for all dynamic inputs, making it safe to copy directly into your codebase as a string literal or a version-controlled prompt asset.

text
You are an SLA breach risk assessment engine. Your only job is to analyze the provided ticket and queue context and return a structured JSON risk assessment. Do not generate conversational text, apologies, or markdown formatting outside the JSON block.

## INPUT
[TICKET_DETAILS]

## QUEUE CONTEXT
[QUEUE_CONTEXT]

## OUTPUT SCHEMA
Return a single JSON object with the following fields:
- "breach_risk": string, one of "NONE", "LOW", "MEDIUM", "HIGH", "IMMINENT"
- "risk_factors": array of strings, the specific factors contributing to the risk level (e.g., "queue_depth_exceeded", "sla_window_95_percent_consumed", "no_available_agents")
- "recommended_action": string, one of "standard_routing", "priority_queue", "immediate_escalation", "on_call_alert"
- "action_rationale": string, a brief, evidence-based explanation for the recommended action
- "escalation_target": string or null, the specific team or on-call group to alert if escalation is recommended

## CONSTRAINTS
- Base your assessment strictly on the provided ticket and queue context. Do not infer information not present.
- The SLA window is defined in the queue context. If it is missing, treat the risk as "LOW" and note the missing data in "risk_factors".
- If the ticket is already in a "breached" or "resolved" state, set "breach_risk" to "NONE" and "recommended_action" to "standard_routing".
- Do not recommend escalation for normal queue fluctuations. A "HIGH" or "IMMINENT" risk requires a specific, time-bound threat of missing the SLA target.

To adapt this template, replace [TICKET_DETAILS] with a structured string containing the ticket's priority, status, creation timestamp, and current SLA target. Replace [QUEUE_CONTEXT] with a snapshot of the current operational state: the number of tickets ahead in the queue, the number of available agents with the right skills, and the average handle time for this ticket type. In production, these placeholders should be populated by your application layer, not by the model. The output schema is intentionally strict; you should validate the returned JSON against this schema before acting on the recommended_action. A common failure mode is the model returning a plausible but incorrect escalation_target. Always cross-reference this field against your live on-call rotation before dispatching an alert.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. All variables should be populated from your queue monitoring system, agent workforce management tool, and account service before invoking this prompt.

PlaceholderPurposeExampleValidation Notes

[QUEUE_DEPTH]

Current number of tickets waiting in the relevant support queue

47

Must be a non-negative integer. Null not allowed. Validate with parseInt and check >= 0. Source from queue monitoring system API.

[AGENT_AVAILABILITY]

Count of agents currently online and available in the relevant skill group

3

Must be a non-negative integer. Null not allowed. Validate with parseInt and check >= 0. Source from workforce management tool.

[ELAPSED_TIME_MINUTES]

Minutes since the ticket was created or last customer response

215

Must be a non-negative integer or float. Null not allowed. Calculate from ticket creation timestamp minus current time. Validate > 0.

[SLA_TARGET_MINUTES]

The contracted SLA response or resolution time in minutes for this account tier

240

Must be a positive integer. Null not allowed. Source from account service or contract metadata. Validate > 0 and <= 10080 (1 week).

[ACCOUNT_TIER]

Normalized account tier label from the account service

premium

Must be one of the enumerated tier values defined in your routing config. Null not allowed. Validate against allowed tier list. Source from account service.

[TICKET_PRIORITY]

Current priority label assigned to the ticket

P2

Must be a string matching your priority schema. Null allowed if unassigned. Validate against allowed priority values. Source from ticketing system.

[BREACH_THRESHOLD_PERCENT]

Percentage of SLA target consumed that triggers breach risk classification

80

Must be an integer between 1 and 100. Default to 80 if not provided. Validate range. Source from operations config or hardcoded default.

[QUEUE_DRAIN_RATE]

Average tickets resolved per agent per minute in this queue over the last hour

0.15

Must be a positive float. Null allowed if no recent resolution data. Calculate from queue analytics. Validate > 0 if present. Source from queue monitoring system.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the SLA Breach Risk Routing Prompt into a production routing middleware system with validation, retry, and human review gates.

This prompt is designed to sit inside a routing middleware layer, not as a standalone chatbot. It should be invoked when a support ticket, incident, or task enters a queue and the system needs to decide whether to escalate based on SLA breach risk. The prompt expects structured input—current queue depth, agent availability, elapsed time, SLA target, and ticket priority—and returns a structured escalation decision. Do not call this prompt on every queue event; instead, trigger it on a scheduled heartbeat (e.g., every 60 seconds for active queues) or on ticket arrival when the queue is already above a warning threshold. This prevents unnecessary model invocations during normal operations and keeps latency predictable.

Wire the prompt into a decision function that first hydrates the required variables from your queue monitoring system, ticket system, and workforce management tool. The function should construct the prompt payload, call the model with a low temperature (0.0–0.2) for deterministic routing decisions, and parse the JSON output. Validate the output against a strict schema: the escalation_decision field must be one of escalate, warn, or no_action; the confidence field must be a float between 0.0 and 1.0; and the reasoning field must be a non-empty string. If validation fails, retry once with the same payload and a note in the system prompt that the previous output was malformed. If the second attempt also fails, log the failure and default to a safe fallback—typically warn with a human review flag—rather than silently dropping the event. For high-severity queues (e.g., Sev1 incidents), always require a human to confirm any escalate decision before it triggers paging or notification workflows. This human-in-the-loop gate prevents alert fatigue from model over-escalation during normal queue fluctuations.

Log every invocation with the input variables, model output, validation result, and final routing action. This audit trail is critical for tuning the prompt over time and defending routing decisions during incident reviews. Monitor for over-escalation by tracking the ratio of escalate decisions to actual SLA breaches over a rolling 7-day window; if the prompt escalates more than 20% of tickets that do not breach SLA, recalibrate the thresholds or add a cooldown period. Also monitor for under-escalation by tracking missed SLA breaches where the prompt returned no_action. Use these metrics to drive prompt version updates, not to silently override the model. Finally, do not use this prompt as the sole arbiter of SLA compliance—it is a risk detection signal, not a replacement for deterministic SLA timers and queue monitors that should run independently in your infrastructure.

IMPLEMENTATION TABLE

Expected Output Contract

Downstream systems must validate the model response against this contract before acting on the assessment. Any field failing validation should trigger a retry or fallback to the default routing path.

Field or ElementType or FormatRequiredValidation Rule

breach_risk_level

enum: ["NONE", "LOW", "MEDIUM", "HIGH", "CRITICAL"]

Must be exactly one of the five enum values. Reject any response that returns a different string or a numeric score.

breach_confidence

float between 0.0 and 1.0

Must parse as a float. Must be >= 0.0 and <= 1.0. If confidence is below 0.7 and risk_level is HIGH or CRITICAL, flag for human review.

estimated_minutes_to_breach

integer or null

Must be a positive integer or null. If risk_level is NONE, this field must be null. If risk_level is not NONE, this field must be a positive integer.

contributing_factors

array of strings

Must be a JSON array. Each element must be a non-empty string. Array must not be empty when risk_level is not NONE. Each factor must reference a specific metric: queue_depth, agent_availability, elapsed_time, or sla_target.

recommended_escalation_path

enum: ["STANDARD_QUEUE", "PRIORITY_QUEUE", "TEAM_LEAD", "ONCALL_ESCALATION", "EXECUTIVE_ESCALATION"]

Must be exactly one of the five enum values. If risk_level is NONE or LOW, must be STANDARD_QUEUE. If risk_level is CRITICAL, must be ONCALL_ESCALATION or EXECUTIVE_ESCALATION.

sla_target_hours

float

Must be a positive float representing the SLA response-time target in hours. Must match the value extracted from [SLA_CONTEXT] or [ACCOUNT_TIER]. Reject if the value does not match the input context.

current_queue_depth

integer

Must be a non-negative integer. Must match the value provided in [QUEUE_METRICS]. Reject if the model hallucinates a different queue depth than the input.

assessment_timestamp

ISO 8601 datetime string

Must parse as a valid ISO 8601 datetime. Must be within 5 minutes of the system clock at validation time. Reject if timestamp is in the future or more than 5 minutes stale.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when routing based on SLA breach risk and how to prevent it before it reaches production.

01

Over-Escalation on Normal Queue Fluctuations

What to watch: The prompt treats every temporary queue spike as a breach risk, flooding escalation paths with false alarms. Guardrail: Require sustained threshold violation over a configurable window (e.g., 3 consecutive checks) before escalating. Include a trend_direction field in the output to distinguish transient spikes from genuine degradation.

02

Stale Data Poisoning the Risk Assessment

What to watch: The prompt receives outdated queue depth or agent availability data, causing it to escalate on resolved issues or miss active breaches. Guardrail: Require a data_freshness_timestamp for every input metric. If any input is older than the SLA window, the prompt must output assessment_valid: false and refuse to route until fresh data is provided.

03

Ignoring Business Hours and Shift Calendars

What to watch: The prompt calculates breach risk against 24/7 targets when the actual SLA only applies during business hours, triggering false escalations overnight. Guardrail: Pass an active_hours_schedule parameter and require the prompt to calculate remaining time only within active windows. Include a time_remaining_active_hours field separate from wall-clock time.

04

Single-Ticket Tunnel Vision

What to watch: The prompt assesses breach risk for one ticket in isolation without considering its position in the queue, misranking urgency. Guardrail: Include queue_position and tickets_ahead_count in the input context. Require the prompt to explain why this specific ticket is at risk relative to others ahead of it, not just based on its own elapsed time.

05

Silent Misclassification of Severity

What to watch: The prompt conflates customer tier with ticket severity, routing a low-severity VIP ticket ahead of a critical standard-tier ticket. Guardrail: Require separate severity_score and tier_priority fields in the output. Add a conflict-resolution rule: severity always beats tier when breach risk is calculated, with an explicit override justification required for exceptions.

06

Missing Fallback When SLA Terms Are Ambiguous

What to watch: The prompt encounters a request type or account that maps to multiple possible SLAs and guesses instead of flagging ambiguity. Guardrail: Require the prompt to output sla_ambiguity_detected: true and candidate_slas: [] when multiple contracts could apply. Route to a human review queue with all candidates presented, never to an automated escalation path.

IMPLEMENTATION TABLE

Evaluation Rubric

How to test output quality before shipping. Run these eval cases against a golden dataset of 50+ tickets with known breach outcomes before deploying any prompt change.

CriterionPass StandardFailure SignalTest Method

Breach Risk Classification Accuracy

Risk label matches golden label for >= 90% of cases

False positives > 10% or false negatives > 5%

Run against 50 labeled tickets; compute precision/recall per risk tier

Over-Escalation During Normal Queue Fluctuation

Escalation rate < 5% when queue depth is within 1 std dev of weekly average

Escalation triggered by normal diurnal queue depth variation

Inject synthetic queue metrics at normal, elevated, and spike levels; measure escalation trigger rate

Under-Escalation During Actual Breach Conditions

Escalation triggered for 100% of tickets where elapsed time > 80% of SLA window and queue depth > threshold

Silent failure to escalate when SLA window is nearly exhausted

Test with elapsed_time set to 90% of SLA and queue_depth at 2x threshold; verify escalation flag is true

SLA Tier Extraction Accuracy

[SLA_TIER] matches contract tier for >= 95% of tickets

Tier misclassification causes wrong escalation threshold

Parse [SLA_TIER] output against known tier labels; flag mismatches

Confidence Score Calibration

Low-confidence scores (< 0.7) correlate with ambiguous or missing inputs

High confidence assigned to tickets with missing [QUEUE_DEPTH] or [ELAPSED_TIME]

Correlate confidence_score with input completeness; flag cases where missing inputs still produce confidence > 0.8

Output Schema Compliance

100% of outputs parse as valid JSON matching [OUTPUT_SCHEMA]

Missing required fields or type mismatches in production logs

Schema validation on every eval run; reject any output that fails JSON Schema check

Agent Availability Signal Handling

Escalation decision accounts for [AGENT_AVAILABLE] boolean correctly

Escalation triggered when agents are available and queue is manageable

Test with agent_available=true and queue_depth normal; verify escalation is false

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON schema. Use a lightweight model call without retries or strict validation. Focus on getting the breach_risk boolean and escalation_recommended flag correct before adding queue-depth math.

code
You are an SLA breach risk assessor. Given [QUEUE_DEPTH], [AGENT_COUNT], [ELAPSED_MINUTES], and [SLA_TARGET_MINUTES], return JSON with:
- breach_risk: boolean
- escalation_recommended: boolean
- risk_score: 0-100
- reasoning: string

Watch for

  • Over-escalation during normal queue fluctuations
  • Missing elapsed_minutes causing false negatives
  • Model treating all non-zero queues as breach risk
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.