This prompt is for orchestration engineers who need a structured, machine-readable summary when a sub-agent completes a delegated task. The core job-to-be-done is to force the model to extract results, confidence, unresolved items, assumptions, and next-step recommendations into a single, validated payload. This summary must be consumable by downstream agents, a supervisor agent, or a human reviewer without replaying the entire execution trace. Use this prompt inside an orchestrator's handoff pipeline: after a sub-agent returns its final output, before that output is merged into the parent workflow.
Prompt
Agent Handoff Summary Generation Prompt for Delegated Tasks

When to Use This Prompt
Defines the precise job-to-be-done for the Agent Handoff Summary prompt, identifying the ideal user, required context, and critical situations where it should not be applied.
The ideal user is an AI platform engineer or workflow builder integrating multiple specialized agents. Required context includes the original delegated task, the sub-agent's complete raw output, and any execution metadata like tool-call logs or error traces. The prompt is designed for asynchronous, structured handoffs where the receiving system needs to programmatically decide the next step—whether to merge the result, escalate for human review, or trigger a re-decomposition. It is not suitable for live conversation summarization, user-facing chat history, or tasks where the sub-agent's raw output is already a complete final answer for an end user.
Do not use this prompt when the sub-agent's output is a final, user-ready artifact that requires no further processing. Avoid it in low-latency, real-time chat systems where the overhead of generating a structured handoff payload adds unacceptable delay. It is also inappropriate for tasks where the sub-agent's internal reasoning trace is the primary artifact needed for debugging; in those cases, use a trace logging prompt instead. Before implementing, ensure your orchestration framework can parse and act on the structured output schema, and plan for validation failures by defining a retry or fallback path.
Use Case Fit
Where the Agent Handoff Summary prompt delivers reliable value and where it introduces unacceptable risk. Use these cards to decide whether this prompt belongs in your orchestration pipeline or if you need a different approach.
Good Fit: Structured Sub-Task Completion
Use when: a sub-agent has finished a well-scoped task and the orchestrator needs a machine-readable payload with results, confidence scores, unresolved items, and next-step recommendations. Guardrail: validate the output against a strict schema before the orchestrator consumes it. Reject handoffs that omit required fields or contain ambiguous completion status.
Good Fit: Multi-Agent Pipelines with Downstream Consumers
Use when: the handoff output will be parsed by another agent or automated system that needs structured context, not just a human reading a summary. Guardrail: include explicit assumptions_made and unresolved_items fields so downstream agents can detect gaps before acting on incomplete information.
Bad Fit: Real-Time Streaming or Sub-Second Latency Requirements
Avoid when: the system requires sub-second handoff generation or the handoff must be produced incrementally during task execution. This prompt is designed for post-completion synthesis, not streaming. Guardrail: use a lightweight status-update protocol for in-flight progress and reserve this prompt for final handoff packaging only.
Bad Fit: Unbounded or Poorly Scoped Sub-Tasks
Avoid when: the sub-agent's task had no clear completion criteria, input contract, or scope boundary. The handoff summary will inherit that ambiguity and produce unreliable confidence estimates. Guardrail: require a validated input contract before task dispatch. If the contract is missing, escalate for re-decomposition rather than generating a handoff.
Required Inputs: Structured Task Context and Raw Output
Risk: generating a handoff without the original task definition, acceptance criteria, and the sub-agent's raw output produces summaries that cannot be audited or validated. Guardrail: always pass [ORIGINAL_TASK_CONTRACT], [SUB_AGENT_RAW_OUTPUT], and [COMPLETION_CRITERIA] as inputs. Never accept a handoff generated from only the final answer.
Operational Risk: Silent Information Loss During Handoff
Risk: the summarization step drops details that matter to downstream agents, such as edge cases considered, tools that failed, or low-confidence assumptions. Guardrail: implement an information-loss detection check that compares key facts in the raw output against the handoff summary. Flag handoffs with missing evidence, dropped caveats, or overconfident conclusions for human review.
Copy-Ready Prompt Template
A reusable prompt template for generating structured handoff summaries when a delegated sub-task completes, ready to paste into your orchestrator.
This template produces a structured handoff payload that downstream agents or human reviewers can consume without replaying the entire sub-task execution. It forces the model to report results, confidence, unresolved items, assumptions, and next-step recommendations in a consistent shape. Use this prompt in your orchestrator's handoff generation step after a sub-agent returns its raw output but before that output is passed to the next agent in the chain.
textYou are generating a structured handoff summary for a completed sub-task. Your output will be consumed by another agent or a human reviewer who needs to understand what happened, what was produced, what remains unresolved, and what should happen next. ## INPUT Sub-task ID: [SUB_TASK_ID] Sub-task Description: [SUB_TASK_DESCRIPTION] Assigned Agent Role: [AGENT_ROLE] Original Input Contract: [INPUT_CONTRACT] Expected Output Contract: [OUTPUT_CONTRACT] Raw Agent Output: [RAW_AGENT_OUTPUT] Execution Metadata (tool calls, duration, retries): [EXECUTION_METADATA] ## CONSTRAINTS - Do not omit any section of the output schema. - If a field has no value, use null or an empty array as appropriate, but never drop the field. - Confidence scores must be between 0.0 and 1.0 with a brief justification. - Unresolved items must include a severity level: blocker, high, medium, or low. - Assumptions must be stated explicitly; do not bury them in narrative text. - Next-step recommendations must include a recommended action type: retry, escalate, handoff, complete, or await_input. ## OUTPUT_SCHEMA { "handoff_summary": { "sub_task_id": "string", "status": "completed | partial | failed | timed_out", "result": { "output": "object | null", "matches_contract": "boolean", "contract_violations": ["string"] }, "confidence": { "score": "number", "justification": "string" }, "unresolved_items": [ { "item": "string", "severity": "blocker | high | medium | low", "impact_on_downstream": "string" } ], "assumptions_made": ["string"], "evidence_citations": ["string"], "next_steps": [ { "action": "string", "action_type": "retry | escalate | handoff | complete | await_input", "target_agent_or_role": "string | null", "rationale": "string" } ], "information_loss_risk": "none | low | medium | high", "information_loss_details": "string | null" } } ## INSTRUCTIONS 1. Compare the raw agent output against the expected output contract. Flag any missing fields, type mismatches, or schema violations. 2. Extract explicit assumptions the agent made during execution. If the agent did not state assumptions, inspect the output for implicit ones and surface them. 3. Identify any items the agent flagged as unresolved, uncertain, or requiring further input. Assign a severity based on whether the unresolved item blocks downstream work. 4. Assess whether information was lost during the sub-task execution (e.g., truncated context, omitted details, compressed summaries). Rate the risk and explain. 5. Recommend concrete next steps. If the output is complete and valid, recommend handoff to the next agent. If incomplete, recommend retry with specific adjustments or escalation to a human. 6. Output only valid JSON. No markdown fences, no commentary outside the JSON object.
Adapt this template by adjusting the output schema fields to match your agent framework's handoff contract. If your orchestrator expects additional fields such as latency metrics, cost breakdowns, or tool-call traces, add them to the schema and update the instructions accordingly. For high-risk domains such as healthcare or finance, add a requires_human_review boolean field and set it to true whenever confidence is below 0.85 or unresolved items include a blocker. Always validate the generated JSON against your schema before passing it to the next agent; malformed handoff payloads are the most common cause of silent failures in multi-agent pipelines.
Prompt Variables
Placeholders required by the Agent Handoff Summary Generation Prompt. Each variable must be populated by the orchestrator before the handoff agent is invoked. Missing or malformed inputs cause information loss in downstream consumption.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[ORIGINAL_TASK] | The full task description assigned to the sub-agent, including constraints and expected output shape. | Analyze Q3 support tickets for top-5 root causes. Output JSON array with cause, count, and example ticket IDs. | Must be non-empty string. Compare against task registry to confirm this is the correct task instance. Null not allowed. |
[SUB_AGENT_ROLE] | The role definition and capability contract of the agent that executed the task. | Support Analytics Agent v2.1: Reads ticket exports, performs root-cause clustering, outputs structured findings. | Must match a known agent role in the capability registry. Stale role definitions trigger a warning. Null not allowed. |
[EXECUTION_RESULT] | The raw output produced by the sub-agent before any handoff transformation. | {"causes":[{"cause":"Payment gateway timeout","count":142,"ticket_ids":["T-891","T-904"]}]} | Must be parseable JSON or structured text. Schema check against the sub-agent's output contract. Null allowed only if the task failed entirely. |
[CONFIDENCE_SCORE] | The sub-agent's self-reported confidence in its result, on a 0.0 to 1.0 scale. | 0.87 | Must be a float between 0.0 and 1.0 inclusive. Values below [CONFIDENCE_THRESHOLD] should trigger human review flag in the handoff payload. Null allowed if the agent cannot self-assess. |
[ASSUMPTIONS_MADE] | A list of assumptions the sub-agent relied on during execution that may affect result validity. | ["Assumed tickets without status field are closed","Assumed timezone is UTC for all timestamps"] | Must be a JSON array of strings. Empty array is valid. Each assumption should be a declarative statement. Null not allowed; use empty array if no assumptions. |
[UNRESOLVED_ITEMS] | Items the sub-agent could not resolve, including missing data, ambiguous inputs, or capability gaps. | ["Could not classify 23 tickets due to non-English descriptions","Missing access to refund database for verification"] | Must be a JSON array of strings. Each item must describe a specific unresolved issue. Null not allowed; use empty array if fully resolved. |
[EXECUTION_METADATA] | Operational metadata about the sub-agent's execution run. | {"agent_id":"sa-v2-1","started_at":"2025-03-15T14:02:00Z","completed_at":"2025-03-15T14:04:12Z","tool_calls":4,"tokens_used":12400} | Must be a JSON object with at minimum agent_id, started_at, and completed_at. Timestamps must be ISO 8601. Null not allowed; failed executions still require metadata. |
[DOWNSTREAM_REQUIREMENTS] | Explicit requirements or constraints the next agent or human needs to know to consume this handoff correctly. | ["Next agent must deduplicate causes against Q2 baseline before reporting","Human reviewer must approve any cause with count < 10"] | Must be a JSON array of strings. Each requirement must be an actionable instruction for the downstream consumer. Null not allowed; use empty array if no special requirements. |
Implementation Harness Notes
How to wire the handoff summary prompt into an orchestrator or agent framework with validation, retries, and structured consumption.
This prompt is designed to be called by an orchestrator immediately after a delegated sub-task completes. The orchestrator should pass the sub-agent's raw output, the original task contract, and any execution metadata into the prompt's [SUB_TASK_OUTPUT], [ORIGINAL_TASK_CONTRACT], and [EXECUTION_METADATA] placeholders. The resulting handoff payload becomes the canonical record consumed by downstream agents, human reviewers, or audit systems. Do not treat this as an optional logging step—it is the interface contract between agents in a multi-agent pipeline.
Wire the prompt into your agent framework as a post-execution hook that fires before the orchestrator marks a sub-task as complete. Implement a validation gate that checks the output against the [OUTPUT_SCHEMA] before accepting it: confirm all required fields are present, confidence scores fall within 0.0–1.0, unresolved items are explicitly listed (even if empty), and next-step recommendations are actionable. If validation fails, retry once with the validation errors injected into [CONSTRAINTS] as explicit fix instructions. After a second failure, escalate to a human reviewer with the raw sub-agent output and both failed handoff attempts attached. Log every handoff payload—accepted or rejected—with a trace ID that links back to the original task decomposition so you can reconstruct the full agent decision chain during post-mortems or audits.
For model choice, prefer a model with strong instruction-following and structured output capabilities (GPT-4o, Claude 3.5 Sonnet, or equivalent). Set temperature to 0 or near-zero to maximize schema adherence. If your orchestrator supports tool calling, define the handoff schema as a structured tool and require the model to call it rather than relying on free-text JSON generation—this dramatically reduces parsing failures. When the sub-task domain is high-risk (healthcare, finance, legal), add a human review flag to the handoff payload that triggers mandatory approval before downstream agents can consume the result. Never allow an unvalidated handoff payload to flow into the next agent in the chain.
Common failure modes to instrument for: the model omits unresolved items because the sub-agent claimed full success, confidence scores don't match the actual output quality, assumptions are listed vaguely ('made reasonable assumptions'), and next-step recommendations are generic ('proceed to next step'). Add eval assertions that check for specific, falsifiable statements in each field. Track information loss by comparing the sub-agent's raw output token count to the handoff summary token count—if the compression ratio exceeds 10:1 without explicit justification, flag for review. Wire these metrics into your observability stack so you can detect handoff degradation before it corrupts downstream agent behavior.
Expected Output Contract
Fields, types, and validation rules for the structured handoff summary payload. Use this contract to build a parser that validates agent outputs before downstream consumption.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
[TASK_ID] | string (UUID) | Must match the dispatched task identifier. Reject on mismatch. | |
[STATUS] | enum: completed | partial | failed | escalated | Must be one of the four allowed values. Reject unknown statuses. | |
[SUMMARY] | string (plain text, max 500 tokens) | Must be non-empty. Truncate if over 500 tokens and flag for review. | |
[CONFIDENCE] | float (0.0 to 1.0) | Must parse as float within range. If below 0.6, trigger human review workflow. | |
[RESULT_PAYLOAD] | object (schema per task contract) | Must validate against the sub-task's defined output schema. Reject on schema mismatch. | |
[UNRESOLVED_ITEMS] | array of strings | Each item must be a non-empty string. Empty array is valid. Null is not allowed. | |
[ASSUMPTIONS] | array of strings | Each assumption must be a non-empty string. Empty array is valid. Null is not allowed. | |
[NEXT_STEP_RECOMMENDATIONS] | array of {action: string, agent: string, priority: enum} | Each recommendation must have non-empty action and agent fields. Priority must be high, medium, or low. |
Common Failure Modes
Handoff summaries fail silently. The downstream agent or human reviewer receives a payload that looks correct but is missing critical context, contains unresolved contradictions, or buries the signal in boilerplate. These are the most common failure modes and how to catch them before they propagate.
Silent Information Loss
What to watch: The handoff summary omits constraints, assumptions, or edge cases that were present in the original task but not explicitly required in the output schema. Downstream agents act on incomplete context without knowing it. Guardrail: Include an explicit 'unresolved items' and 'assumptions made' section in every handoff payload. Run a completeness check that diffs the original task requirements against the handoff fields before forwarding.
Overconfident Confidence Scores
What to watch: The generating agent reports high confidence on results that are actually speculative, extrapolated, or based on ambiguous evidence. Downstream agents trust the score and skip verification. Guardrail: Require confidence scores to be accompanied by explicit evidence anchors and uncertainty markers. Calibrate scores against actual outcomes over time and flag any handoff where confidence exceeds 0.9 without source grounding.
Schema Drift Between Agents
What to watch: The producing agent uses field names, types, or enum values that differ from what the consuming agent expects. Parsing fails silently, fields are dropped, or defaults are substituted without detection. Guardrail: Validate every handoff payload against the consumer's expected schema before forwarding. Reject or repair mismatched fields rather than passing them through. Log schema violations for contract review.
Context Contamination Across Handoffs
What to watch: The handoff summary includes irrelevant state from prior turns, other sub-tasks, or the orchestrator's internal reasoning. The downstream agent treats noise as signal and makes decisions on stale or unrelated context. Guardrail: Use explicit context packaging with inclusion and exclusion lists. Strip any data not explicitly required for the sub-task. Run a context leakage check that flags fields not in the input/output contract.
Missing Escalation Triggers in Handoff
What to watch: The handoff summary contains low-confidence results, unresolved contradictions, or missing required fields but does not flag them for human review or escalation. The orchestrator treats the handoff as complete and proceeds. Guardrail: Require every handoff to include an escalation flag with threshold-based triggers. If confidence is below threshold, required fields are null, or contradictions exist, mark the handoff as 'review required' and halt downstream execution until resolved.
Next-Step Recommendations Without Evidence
What to watch: The handoff includes plausible-sounding next-step recommendations that are not grounded in the actual results. Downstream agents or humans follow a recommendation that contradicts the evidence in the same payload. Guardrail: Require each next-step recommendation to cite specific result fields or evidence anchors that support it. Validate that recommendations are consistent with the reported outcomes before forwarding. Flag orphaned recommendations for removal.
Evaluation Rubric
Criteria for testing the quality and reliability of agent handoff summaries before deploying the prompt to production. Each row defines a pass standard, a failure signal, and a test method that can be automated or run manually during QA.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Schema Compliance | Output parses as valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and no extra fields | JSON parse error, missing required field, or unexpected field present | Automated schema validation against the defined JSON Schema; run on 100+ test cases |
Completeness of Results | All completed sub-tasks have a non-null |
| Field presence check; sample review of 20 handoff payloads for result substance |
Unresolved Items Enumeration | Every known gap, ambiguity, or incomplete item from the sub-task appears in | Known gaps from sub-task context are missing from | Diff test: compare sub-task input gaps against handoff |
Confidence Score Calibration |
|
| Spot-check 50 handoffs; compare confidence against human quality rating; require Spearman correlation > 0.6 |
Assumptions Transparency | Every assumption made during sub-task execution is listed in | Assumptions section is empty when sub-task context shows missing information, or assumptions lack rationale | Manual review of 10 handoffs where sub-task had incomplete inputs; require at least one assumption per gap |
Next-Step Actionability |
|
| Check that count of next steps >= count of unresolved items; verify each step has an actor and priority |
Information Loss Detection | Handoff summary preserves all critical data from sub-task output; no truncation, omission, or degradation of key values | Sub-task output contains a value not present in handoff summary, or numeric precision is lost without note | Automated field-by-field comparison between sub-task raw output and handoff payload; flag any missing critical fields |
Handoff Size Budget Compliance | Total handoff payload size is within [MAX_HANDOFF_TOKENS] and prioritizes high-signal information over verbose logs | Payload exceeds token budget by >10% or contains raw debug logs, full conversation history, or unreduced context | Token count check on generated payload; manual review of 5 oversized handoffs for bloat sources |
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 handoff summary prompt but relax strict schema enforcement. Focus on getting the right information into the summary before locking down the exact JSON shape. Use a simple markdown template instead of a typed schema for early iterations.
code## Handoff Summary - **Task ID:** [TASK_ID] - **Status:** [COMPLETED | FAILED | PARTIAL] - **Result:** [SUMMARY] - **Confidence:** [LOW | MEDIUM | HIGH] - **Unresolved Items:** [LIST] - **Assumptions Made:** [LIST] - **Next Steps:** [RECOMMENDATIONS]
Watch for
- Missing confidence scores that downstream agents need for routing decisions
- Overly verbose result summaries that bury the signal
- No distinction between facts and assumptions in the output

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