Prompt Library ⚙️ Technical Agent Handoff and Escalation Protocol
GPT-4o ⚙️ Technical Advanced

Agent Handoff and Escalation Protocol

Design a robust handoff and escalation system for multi-agent pipelines that ensures tasks complete reliably even when individual agents fail.

👁 6 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Agent Handoff and Escalation Protocol

You are an AI systems reliability engineer. Design a complete handoff and escalation protocol for [AGENT_SYSTEM_NAME].

## System Overview

- System name: [AGENT_SYSTEM_NAME]
- Number of agents: [AGENT_COUNT]
- Maximum acceptable failure rate: [MAX_FAILURE_RATE]%
- SLA: complete every task within [SLA_WINDOW]
- Human escalation available: [YES_OR_NO]

## Handoff Types

**Successful Handoff**
- Trigger: an agent completes its sub-task
- Payload: what data is passed to the receiving agent
- Acknowledgment: how the receiving agent confirms receipt
- Timeout: how long before the sender flags a missing acknowledgment

**Conditional Handoff**
- Trigger: agent output meets [CONDITION] threshold
- Routing logic: how the orchestrator decides which agent receives next
- Context preservation: what state is carried across the handoff

**Emergency Handoff**
- Trigger: agent fails, times out, or produces invalid output
- Immediate action: what happens in the first 30 seconds
- Replacement strategy: which agent takes over and with what context

## Escalation Ladder

| Tier | Trigger | Response | Who Handles | Max Wait |
|------|---------|----------|-------------|----------|
| 1 | [CONDITION] | Retry with same agent | Orchestrator | [TIME] |
| 2 | [CONDITION] | Handoff to backup agent | Orchestrator | [TIME] |
| 3 | [CONDITION] | Pause and flag for review | Human | [TIME] |
| 4 | [CONDITION] | Abort task and notify | Human | [TIME] |

## Context Preservation Package

Define what the handoff package must contain:
- Task ID and lineage
- Original user intent
- Work completed so far (with confidence scores)
- Work remaining
- Constraints the receiving agent must respect
- Known failure modes already attempted

## Recovery Procedures

Write step-by-step recovery for each failure mode:
- Agent output falls below [QUALITY_THRESHOLD]
- Agent exceeds [COST_LIMIT] before completing
- Circular dependency detected between agents
- Conflicting instructions from orchestrator and sub-agent

## Audit Trail

Define the log entry format for every handoff and escalation event, and the metrics to track for reliability reporting.

📝 Fill in the blanks

Replace these placeholders with your own content:

[AGENT_SYSTEM_NAME]
[AGENT_COUNT]
[MAX_FAILURE_RATE]
[SLA_WINDOW]
[YES_OR_NO]
[CONDITION]
[TIME]
[QUALITY_THRESHOLD]
[COST_LIMIT]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.