This playbook is for reliability engineers and platform architects who need to define a structured escalation policy for an agent. Use this prompt when you have an agent with a defined role and capability boundary, and you need to specify the exact conditions under which it must stop its own execution and hand off work. The prompt generates a decision tree with clear triggers, confidence thresholds, risk classifications, and the expected format for the handoff payload. It is not for defining the agent's core role or tool access; those should already be established before applying this escalation policy.
Prompt
Agent Role Escalation Policy Prompt

When to Use This Prompt
Define the exact conditions under which an agent must stop its own execution and hand off work to another agent, a human, or a fallback path.
Apply this prompt when you are integrating an agent into a production system where silent failures, overconfident actions, or unhandled capability gaps could cause downstream harm. Typical triggers include: the agent encounters a task outside its declared scope, its confidence score drops below a defined threshold, a tool returns an unrecoverable error, a safety policy is violated, or a human approval gate is required. The output is a machine-readable escalation policy that an orchestrator or agent harness can enforce programmatically. Do not use this prompt for defining the agent's primary role, tool contracts, or input/output schemas—those are separate contracts that this policy references.
Before running this prompt, you must have the agent's role definition, capability boundary contract, and tool access policy available as input context. The prompt expects these as structured inputs so it can reason about what falls inside versus outside the agent's authority. After generating the escalation policy, wire it into your agent harness as a pre-action and post-action check. Test it with both in-scope and out-of-scope requests, and validate that the handoff payload format is compatible with your orchestrator's ingestion contract. The most common failure mode is an escalation policy that is too permissive, allowing the agent to continue past its boundary, or too restrictive, causing unnecessary escalations that flood a human review queue.
Use Case Fit
Where the Agent Role Escalation Policy Prompt delivers value and where it introduces risk. Use this card grid to decide if this prompt fits your current operational context.
Good Fit: Multi-Agent Pipelines with Defined Roles
Use when: You have specialized agents with explicit capability boundaries and need deterministic handoff rules. Guardrail: The prompt produces a decision tree that prevents agents from operating outside their scope, reducing silent failures in production pipelines.
Bad Fit: Single-Agent Chatbots or Open-Ended Assistants
Avoid when: There is only one agent with no escalation targets or the agent's scope is intentionally unbounded. Guardrail: Using this prompt in single-agent systems adds unnecessary complexity and false-positive escalations. Default to a simple refusal policy instead.
Required Inputs: Agent Role Contracts and Confidence Thresholds
What to watch: The prompt cannot generate useful escalation rules without structured role definitions, capability boundaries, and confidence scoring mechanisms. Guardrail: Feed the prompt with explicit agent capability contracts and numeric confidence thresholds before expecting reliable escalation logic.
Operational Risk: Escalation Loops and Infinite Handoffs
What to watch: Poorly defined escalation policies can create circular handoffs where Agent A escalates to Agent B, which escalates back to Agent A. Guardrail: The prompt must include a maximum hop count and a terminal escalation target (human or dead-letter queue) to break cycles.
Operational Risk: Escalation Without Context Preservation
What to watch: Escalation policies often define triggers but neglect the handoff payload structure, causing the receiving agent to lack necessary context. Guardrail: The prompt must specify a structured handoff format including original intent, partial results, and failure reason to prevent context loss.
Bad Fit: Real-Time Systems Without Human Fallback
Avoid when: The system operates in a latency-sensitive loop where human escalation is impossible or the escalation target is unavailable. Guardrail: If no human or fallback agent is reachable within the required time window, use a graceful degradation prompt instead of an escalation policy.
Copy-Ready Prompt Template
A reusable prompt template for generating an agent escalation decision tree with triggers, handoff formats, and correctness tests.
The following prompt template is designed to be integrated into an agent orchestration layer or a reliability engineering workflow. It takes a structured description of an agent's role, its known capability gaps, and the operational risk context, and produces a concrete escalation policy. The output is a decision tree that can be directly translated into application logic, with clear triggers, expected handoff payloads, and test cases for validating the policy before deployment.
textYou are an escalation policy designer for a multi-agent system. Your task is to produce a strict, machine-actionable escalation decision tree for a single agent role. ## AGENT ROLE DEFINITION [AGENT_ROLE_DEFINITION] ## KNOWN CAPABILITY GAPS [CAPABILITY_GAPS] ## OPERATIONAL CONTEXT - Risk Level: [RISK_LEVEL] - Human Reviewer Available: [HUMAN_AVAILABLE] - Sibling Agents: [SIBLING_AGENT_LIST] - Fallback Paths: [FALLBACK_PATHS] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "agent_id": "string", "policy_version": "string", "escalation_tree": [ { "trigger_id": "string", "trigger_condition": "string describing the exact condition in plain language", "condition_type": "confidence_threshold | capability_gap | risk_threshold | policy_violation | tool_failure | timeout | ambiguous_request", "threshold_value": "number or string, null if not applicable", "escalation_target": "agent_id | human_reviewer | fallback_path | stop_execution", "handoff_payload_schema": { "required_fields": ["field_name"], "context_summary": "string template with placeholders", "evidence_package": ["list of artifacts to include"] }, "priority": "critical | high | medium | low", "cooldown_seconds": "number, minimum seconds before this trigger can fire again" } ], "default_no_escalation_behavior": "string describing what happens when no trigger fires", "test_cases": [ { "scenario": "string description", "expected_trigger": "trigger_id or null", "input_conditions": {} } ] } ## CONSTRAINTS - Every trigger_condition must be evaluable by application code without an LLM call. - Escalation targets must exist in the provided sibling agent list or fallback paths. - Include at least one test case for each trigger and at least two test cases where no escalation should occur. - For risk_level "high" or "critical", default to escalation when uncertain rather than silent continuation. - Handoff payloads must include enough context for the receiver to act without re-asking the user. Generate the escalation policy.
To adapt this template, replace each square-bracket placeholder with concrete values from your agent registry and operational runbooks. The [AGENT_ROLE_DEFINITION] should be the output of an Agent Role Definition Prompt or a structured role contract. The [CAPABILITY_GAPS] field should list specific tasks or domains the agent is not authorized or able to handle. For high-risk deployments, ensure the generated policy is reviewed by a human before it is encoded into orchestration logic, and run the included test cases against a simulated agent environment to verify that escalation triggers fire correctly and that no trigger condition produces a false negative under load.
Prompt Variables
Required inputs for the Agent Role Escalation Policy Prompt. Each placeholder must be populated before the prompt is assembled and sent. Missing or malformed variables will cause the escalation decision tree to be incomplete or produce unsafe routing.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[AGENT_ROLE_DEFINITION] | The full role contract of the agent whose escalation policy is being defined, including scope, authority, and stop conditions. | {"role_id": "billing-agent-v2", "scope": ["invoice_disputes", "payment_failures"], "authority_level": "tier-1", "stop_conditions": ["legal_claim", "refund_above_500"]} | Must be valid JSON with role_id, scope, authority_level, and stop_conditions fields. Reject if scope or stop_conditions is empty. |
[CAPABILITY_BOUNDARY] | The agent's capability boundary contract specifying tool access, domain limits, and explicit exclusions. | {"allowed_tools": ["lookup_invoice", "refund_api"], "domain_limits": ["billing_only"], "exclusions": ["account_closure", "fraud_investigation"]} | Must be valid JSON. Cross-validate that allowed_tools do not exceed the agent's actual tool access policy. Reject if exclusions conflict with scope. |
[RISK_THRESHOLDS] | Quantitative and qualitative thresholds that trigger escalation: confidence scores, monetary values, sentiment flags, and regulatory triggers. | {"min_confidence": 0.85, "max_financial_exposure_usd": 500, "escalate_on_sentiment": ["angry", "threatening_legal_action"], "regulated_intent_triggers": ["data_deletion_request", "opt_out"]} | Confidence must be a float between 0.0 and 1.0. Financial exposure must be a positive integer. Sentiment and regulated trigger lists must be non-empty arrays of strings. |
[ESCALATION_TARGETS] | The set of available escalation destinations: other agents, human queues, or fallback paths with their identifiers and capabilities. | {"targets": [{"id": "fraud-agent", "type": "agent", "accepts": ["fraud_investigation"]}, {"id": "billing-sme-queue", "type": "human", "accepts": ["legal_claim", "executive_complaint"]}]} | Must be valid JSON array of target objects. Each target requires id, type (agent or human), and accepts array. Reject if no human target exists for regulated triggers. |
[HANDOFF_FORMAT_SCHEMA] | The required output schema for a handoff payload, including required fields, status codes, and evidence packaging rules. | {"required_fields": ["escalation_reason", "confidence", "transcript_summary", "evidence_artifacts"], "status_codes": ["ESCALATED_CONFIDENCE", "ESCALATED_RISK", "ESCALATED_CAPABILITY_GAP"], "max_summary_length_chars": 2000} | Must be valid JSON. required_fields must be a non-empty array. status_codes must include at least one code per escalation trigger category. Reject if evidence_artifacts is required but no attachment mechanism is defined. |
[CONTEXT_WINDOW] | The current session context, conversation history, and any partial results the agent has produced before the escalation decision point. | {"session_id": "sess-9821", "turns": [{"role": "user", "content": "I was overcharged"}, {"role": "agent", "content": "I found a duplicate charge of $750"}], "partial_results": {"duplicate_charge_found": true, "amount": 750}} | Must be valid JSON. turns array must contain at least one user turn. partial_results must be null or an object. Reject if session_id is missing or empty. |
[POLICY_OVERRIDES] | Temporary or environment-specific overrides to the default escalation policy, such as maintenance windows, degraded tool availability, or executive hold instructions. | {"force_escalate_all": false, "degraded_tools": ["refund_api"], "maintenance_window": null, "executive_hold": false} | Must be valid JSON. force_escalate_all and executive_hold must be boolean. degraded_tools must be an array of strings or null. Reject if force_escalate_all is true but no escalation target is available. |
Implementation Harness Notes
How to wire the escalation policy prompt into a multi-agent orchestration layer with validation, retries, and human-in-the-loop review.
This prompt is not a standalone chatbot interaction. It is a policy-generation step that runs at agent registration time or during a policy refresh cycle. The output—a structured escalation decision tree—must be consumed by an orchestrator or agent runtime, not displayed directly to an end user. Treat the prompt as a configuration artifact generator: it produces a machine-readable policy that the system enforces at runtime. The implementation harness must validate the output against the expected schema, store it in a policy registry, and surface any ambiguity or missing triggers for human review before the policy goes live.
Wire the prompt into a policy provisioning pipeline. When a new agent role is defined or an existing role's scope changes, the pipeline assembles the prompt with the agent's capability boundary contract, tool access manifest, and risk classification as [CONTEXT]. The model returns a JSON escalation tree with trigger conditions, target escalation paths (agent ID, human queue, or fallback procedure), and required handoff payload schemas. Before accepting the output, run a structural validator that checks: every trigger has a non-empty condition, every target is a valid registered endpoint, and every handoff schema references known fields from the agent's output contract. Reject and retry with a repair prompt if validation fails. For high-risk domains, route the validated policy to a human reviewer through an approval queue before activation.
At runtime, the orchestrator evaluates escalation triggers after each agent step. If the agent's confidence score drops below the threshold defined in the policy, or if a stop-condition matches, the orchestrator reads the escalation target and assembles the handoff payload using the schema from the policy. Log every escalation event with the trigger that fired, the agent state at the time, and the target that received the handoff. This log becomes your audit trail for debugging incorrect escalations. Avoid hardcoding escalation paths in the orchestrator; always read them from the validated policy artifact. When updating the policy, run the new version through the same validation and review pipeline, and keep the previous version active until the new one passes all checks.
Expected Output Contract
Validate every escalation decision against this contract before the orchestrator acts on it. Each field must be present and conform to the stated rule.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
escalation_decision | object | Top-level object must exist and contain all required child fields | |
escalation_decision.triggered | boolean | Must be true or false; null is not allowed | |
escalation_decision.escalation_level | string (enum) | Must be one of: 'none', 'agent', 'human', 'fallback', 'stop' | |
escalation_decision.target_agent_id | string | null | Required when escalation_level is 'agent'; must match a registered agent ID from [AGENT_REGISTRY]; null otherwise | |
escalation_decision.reason_code | string (enum) | Must be one of: 'confidence_below_threshold', 'capability_gap', 'policy_violation_risk', 'tool_failure', 'ambiguous_request', 'explicit_escalation_request', 'safety_stop' | |
escalation_decision.confidence_score | number (0.0-1.0) | Must be a float between 0.0 and 1.0 inclusive; if below [CONFIDENCE_THRESHOLD], triggered must be true | |
escalation_decision.summary | string | Non-empty string; minimum 10 characters; must describe what triggered the escalation without revealing [PII_REDACTION_POLICY] violations | |
escalation_decision.handoff_payload | object | Must conform to the handoff schema defined in [HANDOFF_CONTRACT]; must include task_state, partial_results, and evidence_sources |
Common Failure Modes
Escalation policies fail silently when thresholds are vague, context is lost, or the agent doesn't know it's out of its depth. These are the most common production failure modes and how to prevent them.
Vague Confidence Thresholds
What to watch: The agent uses subjective language like 'high confidence' without a numeric anchor, leading to inconsistent escalation decisions across similar inputs. Guardrail: Define explicit numeric thresholds (e.g., confidence < 0.85) and require the agent to output a structured confidence score alongside every escalation decision.
Context Stripping During Handoff
What to watch: The escalation payload contains only the immediate trigger but drops prior turns, user intent, or partial work, forcing the receiving agent or human to re-establish context from scratch. Guardrail: Require a structured handoff schema that includes session_summary, prior_decisions, and pending_actions fields. Validate field presence before accepting the handoff.
Infinite Escalation Loops
What to watch: Agent A escalates to Agent B, which escalates back to Agent A because neither can resolve the request, creating a loop that burns compute and delays resolution. Guardrail: Include an escalation_chain list in the handoff payload. Each agent must append its ID and check for cycles before accepting. Terminate with a human review after N hops.
Capability Gap Blindness
What to watch: The agent attempts to handle a task that falls outside its defined capability boundary because the escalation trigger only fires on explicit errors, not on unrecognized task types. Guardrail: Add a pre-flight classification step that checks the request against the agent's capability contract before execution. Escalate immediately on mismatch rather than failing mid-task.
Missing Fallback Destination
What to watch: The escalation policy specifies when to escalate but not to whom, leaving the agent with no valid target when the primary escalation path is unavailable. Guardrail: Define a ranked fallback list per escalation trigger, including a human queue as the final destination. Test each path's availability during deployment validation.
Silent Escalation Without Audit Trail
What to watch: The agent escalates correctly but produces no durable record of the decision, trigger, or payload, making post-incident review impossible. Guardrail: Log every escalation event with a unique escalation_id, timestamp, trigger reason, confidence score, and full handoff payload to an append-only audit store before transferring control.
Evaluation Rubric
Use this rubric to test whether the generated escalation policy correctly identifies when an agent must escalate, to whom, and with what payload. Each criterion targets a specific failure mode observed in production escalation logic.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Escalation Trigger Completeness | All defined triggers (confidence below [CONFIDENCE_THRESHOLD], capability gap, risk level above [RISK_THRESHOLD], policy violation) appear in the output decision tree | Missing trigger category; trigger only covers one condition | Diff output triggers against the input [ESCALATION_TRIGGERS] list; assert set equality |
Target Routing Correctness | Each trigger maps to the correct escalation target: [HUMAN_QUEUE], [FALLBACK_AGENT], or [STOP_PATH] as specified in [ROUTING_MAP] | Trigger routes to wrong target; human escalation routes to another agent | For each trigger in test fixtures, assert output target matches expected target from [ROUTING_MAP] |
Handoff Payload Schema Compliance | Every escalation path includes a handoff payload matching [HANDOFF_SCHEMA] with required fields: summary, reason, evidence, and priority | Missing required field; extra unstructured text outside schema; wrong type for priority field | Parse output as JSON; validate against [HANDOFF_SCHEMA] using schema validator; flag missing or mistyped fields |
Confidence Threshold Boundary Behavior | Output correctly escalates when confidence equals [CONFIDENCE_THRESHOLD] minus 0.01 and does not escalate when confidence equals [CONFIDENCE_THRESHOLD] plus 0.01 | Escalation fires at wrong boundary; off-by-one threshold error; threshold ignored entirely | Run boundary test cases at threshold ± 0.01; assert escalation decision matches expected boolean per case |
Risk Level Discrimination | Output produces different escalation paths for low, medium, high, and critical risk levels as defined in [RISK_LEVELS] | All risk levels produce same escalation target; risk level ignored; critical risk routes to non-human path | Feed inputs varying only risk level; assert distinct escalation targets per level match [RISK_LEVELS] mapping |
Capability Gap Declaration Format | When escalating due to capability gap, output includes a structured gap declaration with missing capability name, attempted action, and suggested remedy from [CAPABILITY_CATALOG] | Gap reason is vague ('cannot do this'); missing capability name; no suggested remedy when catalog entry exists | Parse gap declaration field; assert capability name matches an entry in [CAPABILITY_CATALOG]; assert remedy field is non-empty |
Stop Condition vs. Escalation Distinction | Output correctly distinguishes between stop conditions (no further action, log only) and escalation conditions (handoff required) as defined in [STOP_CONDITIONS] | Stop condition triggers an escalation payload; escalation condition produces only a log entry with no handoff | For each [STOP_CONDITIONS] entry, assert output contains no handoff payload; for each escalation trigger, assert handoff payload exists |
Escalation Decision Audit Trail | Output includes a decision log with trigger evaluation results, threshold comparisons, and routing rationale for every escalation decision | Decision log missing; log contains only final decision without intermediate reasoning; threshold values not shown | Parse decision log field; assert it contains trigger name, evaluated value, threshold, comparison result, and selected target for each trigger evaluated |
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 a single-agent simulation. Use the base prompt with a simplified escalation tree (2-3 levels) and mock confidence scores. Replace [CONFIDENCE_THRESHOLD] with a hardcoded value like 0.7. Skip formal schema validation initially—focus on whether the model produces a recognizable decision tree.
codeYou are an escalation policy engine. Given a task [TASK_DESCRIPTION], an agent capability list [CAPABILITIES], and a confidence score [CONFIDENCE_SCORE], output one of: ESCALATE_TO_HUMAN, ESCALATE_TO_AGENT:[agent_name], or HANDLE_LOCALLY. If confidence is below 0.7, escalate.
Watch for
- Over-escalation on ambiguous inputs when confidence is hardcoded
- Missing fallback paths when the target agent is unavailable
- No distinction between capability gaps and confidence gaps

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