Use this prompt when you need a structured, human-readable summary of an agent's completed work before transferring context to another agent, a human reviewer, or an audit system. The primary job-to-be-done is creating a concise record that answers: what the agent did, what evidence it used, what decisions it made, and why those decisions were made. This is essential for platform engineers and orchestration builders who need handoff records that operators can read during incident review, that compliance teams can archive, and that downstream agents can use as orientation context before continuing work.
Prompt
Handoff Summary Generation Prompt Template

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the Handoff Summary Generation Prompt Template.
This prompt is designed for workflows where traceability and human interpretability matter more than machine-to-machine throughput. Ideal scenarios include: an agent completing a research task and handing findings to an analyst, a coding agent finishing a patch and handing off to a reviewer, or a triage agent escalating a complex case to a human operator with full context. The prompt expects inputs such as the agent's original task, actions taken, tools called, evidence retrieved, decisions made, and any unresolved items. It produces a structured summary with sections for task description, actions, evidence, decisions, rationale, and pending items.
Do not use this prompt when you need a machine-readable state serialization for direct consumption by another agent. For structured payloads with strict schemas, idempotency keys, and programmatic parsing, use the Agent Handoff State Serialization Prompt Template instead. Also avoid this prompt when the handoff target is a simple router or queue system that only needs a task ID and status code—the human-readable format adds unnecessary token overhead. This prompt is not suitable for real-time streaming handoffs where latency constraints prohibit generating a full narrative summary.
Before using this prompt, ensure you have access to the agent's execution trace, tool call logs, and any retrieved evidence. The quality of the handoff summary depends entirely on the completeness of this input context. If the agent's internal state is not observable or its decision points are not logged, the summary will contain gaps that mislead downstream consumers. Wire this prompt into your orchestration layer after agent completion but before context transfer, and validate the output against the eval checks described in the testing section of this playbook.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before using it in a production handoff pipeline.
Good Fit: Structured Agent-to-Agent Transfers
Use when: you have a defined upstream agent that completed a discrete unit of work and must pass a summary to a known downstream agent with a clear contract. Guardrail: validate that the upstream agent's output schema is stable before relying on this prompt for production handoffs.
Good Fit: Human-Readable Audit Trails
Use when: you need a concise, evidence-backed summary of agent decisions for human reviewers, compliance logs, or debugging sessions. Guardrail: always include source attribution fields in the output schema so reviewers can trace claims back to raw agent outputs.
Bad Fit: Real-Time Streaming Handoffs
Avoid when: the handoff must happen mid-stream before the upstream agent finishes its work. This prompt expects a complete upstream output. Guardrail: use a partial-result summary prompt instead and set a maximum wait timeout before forcing a degraded handoff.
Bad Fit: Unstructured or Missing Upstream Evidence
Avoid when: the upstream agent produces freeform text without citations, confidence scores, or structured reasoning. The summary will hallucinate rationale. Guardrail: require upstream agents to output a minimum evidence schema before invoking this handoff prompt.
Required Inputs
Must provide: upstream agent identity, completed task description, structured output with evidence, confidence scores, and any unresolved dependencies. Guardrail: run a completeness check prompt before handoff to catch missing fields that would cause downstream failure.
Operational Risk: Silent Context Loss
Risk: the summary omits critical nuance that the downstream agent needs, but the handoff appears successful. Guardrail: pair this prompt with a handoff confidence score eval and log summary-to-source fidelity metrics over time. Escalate when fidelity drops below threshold.
Copy-Ready Prompt Template
A copy-ready template for generating human-readable handoff summaries from agent execution traces.
This template produces a concise, structured summary of an agent's activity before transferring work to another agent or a human reviewer. It captures the agent's decisions, evidence used, rationale, and any unresolved items. Replace the square-bracket placeholders with your agent's actual execution data, tool outputs, and task context. The template is designed to be wired into an orchestration layer that collects trace data and injects it before calling the model.
textYou are generating a handoff summary for a downstream agent or human reviewer. Your summary must be self-contained, evidence-grounded, and actionable. ## INPUT DATA - Agent Identity: [AGENT_NAME] - Task Description: [TASK_DESCRIPTION] - Execution Trace (steps taken, tools called, outputs received): [EXECUTION_TRACE] - Partial Results (completed work products, intermediate findings): [PARTIAL_RESULTS] - Pending Actions (tasks not yet started or incomplete): [PENDING_ACTIONS] - Unresolved Dependencies (blockers, missing information, required inputs): [UNRESOLVED_DEPENDENCIES] - Confidence Assessment (per-finding or overall confidence levels): [CONFIDENCE_ASSESSMENT] - Source References (documents, API responses, database records cited): [SOURCE_REFERENCES] ## OUTPUT SCHEMA Produce a JSON object with the following fields: - "summary": A 2-4 sentence narrative of what the agent accomplished and why. - "key_decisions": An array of objects, each with "decision", "rationale", and "evidence_used" fields. - "completed_work": An array of completed deliverables with "item" and "status" fields. - "pending_work": An array of remaining tasks with "item", "priority", and "blocker" fields. - "confidence_flags": An array of findings where confidence is below threshold, each with "finding" and "confidence_level" fields. - "handoff_recommendations": Specific instructions for the receiving agent or human about what to do next. - "source_citations": An array of sources referenced, each with "source_id" and "relevance" fields. ## CONSTRAINTS - Do not invent facts not present in the execution trace. - If confidence is low on any finding, flag it explicitly in "confidence_flags". - Preserve the agent's stated rationale verbatim where possible; do not reinterpret. - If source references are provided, cite them by their source_id in relevant decisions. - If the execution trace is empty or the task was not attempted, state that clearly in the summary. - Do not speculate about what the downstream agent should do beyond what the trace supports.
To adapt this template, replace each bracketed placeholder with data from your agent's execution log. The EXECUTION_TRACE should include timestamps, tool calls, and raw outputs. The PARTIAL_RESULTS field should contain any work products already generated. Before deploying, validate that the model's output conforms to the JSON schema and that all cited sources exist in the provided references. For high-stakes handoffs, route the generated summary through a human review step before the downstream agent acts on it.
Prompt Variables
Variables required to assemble a reliable handoff summary prompt. Validate each before template assembly to prevent silent context loss or malformed handoff payloads.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[AGENT_IDENTITY] | Unique identifier and role description of the handing-off agent | research-agent-v2 (financial analyst) | Must match agent registry entry. Reject if missing or not in allowed agent list. |
[TASK_DESCRIPTION] | Original task or objective the agent was assigned | Analyze Q3 earnings call transcripts for revenue guidance changes | Must be non-empty string. Reject if truncated or contains only placeholder text. |
[ACTIONS_TAKEN] | Chronological list of actions the agent performed with tool names and parameters |
| Must be a valid JSON array of action objects. Each action requires tool_name, params, and timestamp fields. |
[EVIDENCE_SOURCES] | Citations for all sources used in decision-making with access paths | [{source_id: doc-451, title: AAPL Q3 2024 Transcript, retrieval_timestamp: 2024-08-02T14:30:00Z}] | Must be a valid JSON array. Each source requires source_id, title, and retrieval_timestamp. Reject if source_id is unresolvable. |
[DECISIONS_MADE] | Key decisions the agent made with rationale and confidence scores | Classified guidance as 'raised' based on CEO statement in section 4. Confidence: 0.92 | Must be a JSON array of decision objects. Each requires decision, rationale, and confidence (float 0.0-1.0). Reject if confidence below minimum threshold without flag. |
[UNRESOLVED_ITEMS] | Questions, ambiguities, or incomplete work requiring downstream attention | Could not resolve discrepancy between CFO and CEO guidance ranges in sections 4 and 7 | Must be a JSON array of unresolved item objects. Allow empty array. Each item requires description and severity (low, medium, high, blocker). |
[PARTIAL_RESULTS] | Structured output of completed work so far, even if incomplete | {extracted_guidance: {previous: 5-7%, current: 6-8%}, coverage: 0.85} | Must be valid JSON matching the task output schema. Validate against expected partial result contract. Reject if schema mismatch. |
[DOWNSTREAM_AGENT_CAPABILITY] | Expected capability requirements for the receiving agent | requires: [financial-analysis, guidance-classification, discrepancy-resolution] | Must be a JSON array of capability strings. Cross-reference against downstream agent registry. Flag if capability gap detected. |
Implementation Harness Notes
How to wire the Handoff Summary Generation prompt into an agent orchestration system with validation, retries, and observability.
The Handoff Summary Generation prompt is not a standalone artifact—it is a component inside an agent orchestration harness. In production, this prompt fires when an agent reaches a transfer boundary: task completion, escalation, or a capability gap. The harness is responsible for assembling the prompt's inputs from the agent's execution trace, invoking the model, validating the output, and routing the summary to the downstream agent or human reviewer. Treat this prompt as a deterministic function with a strict output contract; the harness enforces that contract before any downstream system consumes the summary.
Start by defining the input assembly pipeline. The prompt expects [AGENT_IDENTITY], [TASK_ORIGINAL_REQUEST], [ACTIONS_TAKEN], [EVIDENCE_USED], [DECISIONS_MADE], [UNRESOLVED_ITEMS], and [CONFIDENCE_ASSESSMENT]. These fields must be extracted from the agent's runtime state—tool call logs, retrieved documents, internal reasoning traces, and explicit decision records. Build a serialization layer that captures these fields at the handoff trigger point. If any required field is empty, the harness should either abort the handoff and request the agent to produce the missing data, or mark the field explicitly as `
unavailable"with a reason. Never passnull` or empty strings silently; downstream agents rely on these fields to avoid re-doing work or making decisions on incomplete context."
Model choice matters for this prompt. The task requires faithful summarization of agent actions, not creative generation. Use a model with strong instruction-following and low hallucination rates on structured summarization tasks—GPT-4o, Claude 3.5 Sonnet, or equivalent. Set temperature=0 or very low (0.1) to maximize factual consistency. If your orchestration system supports it, enable structured output mode (JSON mode, function calling with a strict schema, or constrained decoding) to enforce the output schema at the token level rather than relying on post-hoc parsing. The output schema should include: summary_text, key_decisions[] (each with decision, rationale, evidence_citation), unresolved_items[], confidence_score (0.0–1.0), and recommended_next_agent.
Validation is the critical gate. After the model returns, run a multi-check validator before the summary enters any downstream queue. Schema check: confirm all required fields exist and types match. Evidence grounding check: for each key_decisions[].evidence_citation, verify the citation references a source that exists in the original [EVIDENCE_USED] input—this prevents hallucinated citations. Rationale preservation check: use a second LLM call (or a lightweight classifier) to compare each decision's rationale against the original agent trace; flag any rationale that contradicts or invents facts not present in the trace. Confidence calibration check: if the agent's own confidence markers are available, compare the summary's confidence_score against them; large discrepancies trigger a review. If any check fails, the harness should either retry the prompt with the validation errors fed back as [CONSTRAINTS], or escalate to a human reviewer with the failed validation report attached.
Retry logic must be bounded. Configure a maximum of 2 retries for validation failures. On each retry, append the specific validation errors to the prompt as additional constraints (e.g., 'The previous output had a hallucinated citation for source X. Only cite sources present in [EVIDENCE_USED].'). If retries are exhausted, log the failure, attach the partial output and validation report to the handoff record, and flag the transfer for human review. Never silently accept a failed summary—downstream agents acting on incorrect handoff context create compounding errors that are expensive to untangle. Log every handoff attempt with the prompt version, model, input hash, output, validation results, and routing decision. This log becomes your audit trail and your debugging surface when handoff quality degrades.
Finally, wire the validated summary into your agent routing system. Use the recommended_next_agent field as a suggestion, not an automatic routing decision—your orchestrator should still verify that the recommended agent is available, within capability scope, and not already involved in the task chain (to prevent loops). If the confidence score falls below a configurable threshold (start with 0.7), route to a human review queue instead of an automated downstream agent. This harness design turns the prompt from a text generation exercise into a reliable, observable, and safe component of your multi-agent pipeline.
Expected Output Contract
Validation rules and format constraints for the handoff summary generated by the prompt. Use this contract to build a post-processing validator before the summary is passed to a downstream agent or logged for audit.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
summary_id | string (UUID v4) | Must parse as valid UUID v4. Reject if missing or malformed. | |
agent_id | string | Must match the agent identity pattern defined in [AGENT_REGISTRY]. Reject unknown agents. | |
task_id | string | Must be non-empty and match the upstream task identifier. Fail if null or whitespace-only. | |
decisions | array of objects | Array length >= 1. Each object must contain 'decision', 'rationale', and 'evidence_refs' keys. Reject empty array. | |
decisions[*].evidence_refs | array of strings | Each string must be a non-empty citation key matching [SOURCE_IDS]. Warn if any key is unresolved. | |
unresolved_items | array of strings | Array may be empty. If non-empty, each string must be non-null and non-whitespace. Reject if null. | |
confidence_score | number (0.0-1.0) | Must be a float between 0.0 and 1.0 inclusive. Reject if out of range or non-numeric. | |
handoff_to | string | Must match a valid agent role from [AGENT_REGISTRY] or be the literal 'human_approval_queue'. Reject unknown targets. |
Common Failure Modes
Handoff summaries break in predictable ways. These are the most common failure modes when generating summaries for agent-to-agent or agent-to-human transfer, with concrete guardrails to catch them before they cause downstream errors.
Rationale Collapse
What to watch: The summary states what the agent decided but omits why. Downstream agents or human reviewers cannot distinguish between evidence-based choices and guesses. Guardrail: Require a dedicated rationale field in the output schema and validate that it references specific evidence sources, not just restates the decision.
Source Amnesia
What to watch: The summary synthesizes findings without linking claims to their origin. When downstream agents or auditors need to verify a fact, the trail is lost. Guardrail: Enforce inline citation markers or a structured evidence array mapping each key claim to its source document, timestamp, and retrieval ID.
Silent Omission of Unresolved Items
What to watch: The summary covers completed work but drops pending actions, unanswered questions, or dependencies the upstream agent could not resolve. The downstream agent assumes a clean slate. Guardrail: Include a mandatory unresolved_items section in the output schema. Run a completeness eval that checks for gaps between the upstream agent's task list and the summary's coverage.
Confidence Inflation
What to watch: The summary presents all findings with equal certainty, hiding low-confidence results that need verification. Downstream agents act on weak evidence as if it were confirmed. Guardrail: Require a confidence score per finding. Add an eval that flags summaries where low-confidence upstream outputs appear without explicit uncertainty language or score degradation.
Context Window Truncation Artifacts
What to watch: When the upstream agent's full trace exceeds the context window, the summary generator receives truncated input and fabricates plausible-sounding completions for missing sections. Guardrail: Pre-check input completeness before summary generation. If truncation is detected, mark the summary with a truncated_input: true flag and list which sections were affected. Downstream agents must treat flagged summaries as incomplete.
Schema Drift Between Agents
What to watch: The summary is generated in a format the downstream agent cannot parse because field names, types, or required keys changed between versions. The handoff silently fails or triggers a parse error. Guardrail: Validate every handoff summary against the downstream agent's expected input schema before transfer. Reject or repair payloads that fail validation. Version the handoff schema and include a schema_version field in every summary.
Evaluation Rubric
Criteria for testing handoff summary quality before production deployment. 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 |
|---|---|---|---|
Decision Rationale Preservation | Every agent decision in the summary includes a non-empty rationale referencing at least one piece of evidence from [AGENT_ACTIONS] | Rationale field is empty, contains only generic text like 'based on analysis', or references evidence not present in the input | Parse output, extract all rationale fields, verify each contains a reference to a claim or source ID present in [AGENT_ACTIONS] |
Source Attribution Completeness | Every factual claim in the summary is attributed to a specific source from [EVIDENCE_LOG] with a source ID or citation string | Factual claim appears without any source reference, or citation points to a source not found in [EVIDENCE_LOG] | Extract all factual assertions, cross-reference each against [EVIDENCE_LOG] entries, flag unattributed claims |
Action Trace Coverage | Summary includes all actions from [AGENT_ACTIONS] with status (completed, failed, pending) and outcome | Any action from [AGENT_ACTIONS] is missing from the summary, or status is incorrect relative to the action's actual outcome | Diff the action IDs in [AGENT_ACTIONS] against action IDs mentioned in summary, verify status accuracy |
Unresolved Item Flagging | All unresolved dependencies, unanswered questions, and pending approvals from [PENDING_ITEMS] appear in the summary with explicit unresolved status | A pending item from [PENDING_ITEMS] is omitted or incorrectly marked as resolved | Extract unresolved items from summary, compare against [PENDING_ITEMS] list, check for omissions and status mismatches |
Confidence Level Honesty | Summary includes a confidence score or qualitative confidence indicator for each major decision, and low-confidence decisions are explicitly flagged | High-confidence language used for decisions where [CONFIDENCE_SCORES] indicates low confidence, or confidence indicators are absent entirely | Parse confidence indicators from summary, compare against [CONFIDENCE_SCORES] input, flag mismatches exceeding 0.2 on normalized scale |
Schema Compliance | Output matches [OUTPUT_SCHEMA] exactly: all required fields present, no extra top-level keys, field types correct | Missing required field, extra field not in schema, or type mismatch (e.g., string where array expected) | Validate output against [OUTPUT_SCHEMA] using JSON Schema validator, reject on any violation |
Token Budget Adherence | Summary length does not exceed [MAX_TOKENS] and does not truncate mid-sentence or omit required sections | Output exceeds [MAX_TOKENS] or ends with truncated sentence indicating content was cut off | Count tokens in output, verify <= [MAX_TOKENS], check last 50 characters for truncation patterns |
Human Readability | Summary is understandable by a human reviewer without consulting raw agent logs, uses plain language, and avoids internal agent IDs or opaque references | Summary contains unexplained agent IDs, internal state keys, or technical jargon that requires system knowledge to interpret | Human review by one team member unfamiliar with the specific agent run, pass if they can explain what happened and why |
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 template and remove structured output constraints. Use plain text generation to test summary quality before adding schema enforcement. Replace [OUTPUT_SCHEMA] with a simple instruction like "Write a clear summary of what happened." Skip eval checks and confidence scoring during early iteration.
Watch for
- Summaries that omit key decisions or rationale
- Hallucinated actions the agent never performed
- Missing source attribution when evidence is referenced
- Overly verbose output that buries critical handoff information

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