Inferensys

Prompt

Incomplete Task Handoff Prompt

A practical prompt playbook for using Incomplete Task Handoff Prompt in production AI workflows.
Engineer reviewing agent handoff workflow on laptop, task routing diagrams visible, technical office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise job-to-be-done for the Incomplete Task Handoff Prompt, identifying the ideal user, required context, and critical situations where this prompt should not be used.

This prompt is a structured serialization protocol for agent state, designed for orchestration engineers who must transfer a partially completed unit of work from one agent to another. The primary job-to-be-done is lossless context transfer when an agent has been interrupted, timed out, or reached its capability boundary. The ideal user is an AI platform engineer building a multi-agent orchestration layer who needs a machine-readable handoff package that a receiving agent can parse and act on without re-executing completed work or misinterpreting intermediate results. The required context includes the original task definition, a list of completed subtasks with their outputs, a list of remaining subtasks, any preserved intermediate artifacts (e.g., tool call results, retrieved documents, partial code), and a clear specification of the capabilities the receiving agent must possess.

Use this prompt when the sending agent has made meaningful progress that would be expensive or impossible to reproduce, and the receiving agent is a different specialization or instance that lacks the sending agent's short-term memory. Concrete triggers include: a tool-call timeout after retrieving 3 of 5 required documents, a context-window overflow during a long chain-of-thought, a capability gap where the current agent cannot perform the next required action (e.g., a planning agent handing off to a code-execution agent), or a preemptive handoff to a more cost-effective model for remaining simpler subtasks. The prompt is also appropriate when an orchestrator detects an agent health-check failure and must reroute in-flight work. In all cases, the sending agent must have enough context to accurately describe what is done and what remains; do not use this prompt if the agent itself cannot reliably enumerate its own progress.

Do not use this prompt when the task is fully complete and only a final response is needed—that is a standard output, not a handoff. Do not use it when the failure is unrecoverable and requires human intervention with full context; in that case, use an Agent Human-in-the-Loop Handoff Prompt instead. Avoid using this prompt when the receiving agent is identical in capability and context to the sending agent, as the handoff overhead exceeds the benefit of a simple retry. Critically, do not use this prompt if the sending agent cannot distinguish between completed and uncompleted work, as a hallucinated progress report will corrupt the downstream agent's execution. For high-risk domains such as healthcare or finance, the handoff package must include an [EVIDENCE_LOG] with source grounding for every completed subtask, and the receiving agent should be instructed to re-validate any intermediate results that influence a final decision. The next step after reading this section is to review the prompt template and adapt the [COMPLETED_SUBTASKS] and [REMAINING_WORK_ITEMS] schemas to match your agent graph's specific task decomposition format.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Incomplete Task Handoff Prompt works, where it fails, and what you must have in place before relying on it.

01

Good Fit: Agent Chain Recovery

Use when: an upstream agent times out, crashes, or hits a tool failure and you must preserve partial progress for a downstream agent. Guardrail: the handoff must include completed subtasks, remaining work items, and preserved intermediate results so the receiving agent never restarts from zero.

02

Bad Fit: Real-Time User-Facing Chat

Avoid when: a user is waiting for a synchronous response and the handoff adds latency without user visibility. Guardrail: if handoff is unavoidable, surface a progress indicator and never expose raw agent-to-agent handoff payloads to the user.

03

Required Input: Structured Progress State

What to watch: the prompt cannot reconstruct progress from unstructured logs or raw conversation. Guardrail: the upstream agent must emit a machine-readable progress object with completed tasks, pending tasks, intermediate artifacts, and failure context before the handoff prompt is invoked.

04

Required Input: Receiving Agent Capability Contract

What to watch: handing off to an agent that lacks the required tools or permissions causes silent failure. Guardrail: the handoff prompt must include a required-capabilities field, and the orchestration layer must validate the receiving agent against it before routing.

05

Operational Risk: Context Loss Under Pressure

What to watch: when an agent fails mid-task, the handoff prompt may be invoked with incomplete state because the failing agent never finished writing its progress. Guardrail: implement a pre-handoff state flush that forces the failing agent to persist partial state before the handoff prompt runs, even during timeout or crash signals.

06

Operational Risk: Duplicate Work from Ambiguous Boundaries

What to watch: if the handoff does not clearly mark what is done versus what is pending, the receiving agent repeats completed work or skips critical steps. Guardrail: the handoff schema must include explicit status markers—COMPLETED, IN_PROGRESS, NOT_STARTED—for every subtask, and the receiving agent must be instructed to respect them.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template for generating a structured handoff package when an agent cannot complete its assigned task.

This prompt template is designed to be pasted directly into your orchestration layer. It instructs a model to act as a failing agent that must produce a lossless handoff artifact for a successor agent. The template uses square-bracket placeholders for all dynamic inputs, ensuring no unresolved tokens leak into the final request. Before sending this to the model, replace every placeholder with the actual values from your execution context.

code
You are an agent in a multi-agent workflow. Your task was to [ORIGINAL_TASK_DESCRIPTION], but you are unable to complete it due to [FAILURE_REASON].

Your only job now is to produce a structured handoff package so a successor agent can resume the work without losing context or repeating completed steps. Do not attempt to solve the original task. Do not fabricate results.

Generate a JSON object conforming to this exact schema:
{
  "handoff_version": "1.0",
  "originating_agent": "[AGENT_ID]",
  "failure": {
    "reason": "[FAILURE_REASON]",
    "failure_type": "[FAILURE_TYPE]",
    "timestamp": "[CURRENT_TIMESTAMP]"
  },
  "completed_subtasks": [
    {
      "subtask_id": "string",
      "description": "string",
      "result": "string | object",
      "artifacts": ["string"]
    }
  ],
  "remaining_work": [
    {
      "subtask_id": "string",
      "description": "string",
      "priority": "high | medium | low",
      "dependencies": ["subtask_id"],
      "estimated_effort": "string"
    }
  ],
  "intermediate_state": {
    "key_findings": ["string"],
    "working_data": {},
    "assumptions": ["string"],
    "open_questions": ["string"]
  },
  "required_capabilities": ["string"],
  "context_for_successor": "string"
}

Rules:
- Populate `completed_subtasks` only with work that is fully finished and verified. If you are unsure, list it under `remaining_work` with a note.
- The `intermediate_state.working_data` object must contain all partial results, intermediate calculations, and retrieved context. Preserve everything.
- `required_capabilities` must list the tools, permissions, or knowledge the successor agent needs. Be specific (e.g., "access to customer_db:read", not "database access").
- `context_for_successor` is a free-text field where you must explain the user's original intent, any decisions you made, and pitfalls to avoid.
- If [RISK_LEVEL] is "high", you must also flag any safety, compliance, or data-handling concerns in `context_for_successor`.

[INPUT]
[CONTEXT]

To adapt this template, start by mapping your agent's internal state to the completed_subtasks and intermediate_state fields. The most common failure mode is an agent claiming a subtask is complete when it is not; if your agent cannot assert completion with high confidence, add a confidence field to each subtask object and enforce a minimum threshold before marking it complete. For high-risk workflows, always route the handoff JSON through a validation step that checks for missing required fields and non-empty remaining_work arrays before forwarding to the successor agent. Never send a handoff with an empty required_capabilities list—this is a strong signal that the failing agent did not properly diagnose its own limitations.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Incomplete Task Handoff Prompt. Each placeholder must be populated before the prompt is sent. Missing or malformed variables cause context loss and handoff failures.

PlaceholderPurposeExampleValidation Notes

[ORIGINAL_REQUEST]

The full user request or task definition that initiated the agent chain

Analyze Q3 sales data across all regions and produce a board-ready summary with regional breakdowns and anomaly flags

Required. Must be non-empty. Truncation allowed if over 4000 tokens but must preserve task intent and constraints

[COMPLETED_SUBTASKS]

Structured list of subtasks that were fully completed before the handoff

  1. Data extraction from Snowflake (complete, 14,203 rows). 2. Regional aggregation for NA and EMEA (complete, validated). 3. Anomaly detection pipeline executed (complete, 7 anomalies flagged)

Required. Each entry must include subtask name, completion status, and artifact reference. Null not allowed. Minimum one entry

[REMAINING_WORK_ITEMS]

Structured list of subtasks that still need execution by the receiving agent

  1. APAC regional aggregation (data extracted but not aggregated). 2. Board summary narrative draft (not started). 3. Chart generation for anomaly visualization (not started)

Required. Each entry must include subtask name, current state, and dependency notes. May be empty array if all work complete but handoff still required for review

[INTERMEDIATE_RESULTS]

Preserved outputs, data references, and artifacts from completed work that the receiving agent needs

Regional aggregates stored at s3://analytics/q3-2025/regional_agg.parquet. Anomaly report at internal://reports/anomalies-q3.json. Raw extraction schema in handoff appendix

Required. Must include storage locations, file paths, or inline data. Validate that references are resolvable by the receiving agent. Null not allowed

[FAILURE_CONTEXT]

Description of why the handoff is occurring, including error messages, timeout details, or capability gaps

Primary agent timed out after 120s during APAC aggregation step. Tool call to regional-db returned code 504. Agent capability gap: cannot generate charts

Required. Must include failure type, affected subtask, and specific error or limitation. Use 'NONE' if handoff is planned rather than failure-driven

[RECEIVING_AGENT_CAPABILITIES]

List of capabilities the receiving agent must have to complete the remaining work

Must support: regional aggregation over Parquet, narrative generation with executive tone, chart generation (bar and line), anomaly explanation in business language

Required. Each capability must be testable. Avoid vague entries like 'good at analysis'. Validate that capabilities map to remaining work items

[CONSTRAINTS_AND_POLICIES]

Active constraints, policies, or rules that the receiving agent must respect

Output must fit 2-page board format. No raw PII in output. Anomaly explanations must cite detection method. Regional data must not be cross-shared if region-locked

Required. Include format constraints, data handling rules, compliance requirements, and tone policies. Null not allowed if original task had constraints

[HANDOFF_TIMESTAMP_AND_TTL]

When the handoff was created and how long the context remains valid before requiring refresh

Created: 2025-07-11T14:32:00Z. TTL: 3600s. Context invalid after 2025-07-11T15:32:00Z due to data freshness requirements

Required. Timestamp must be ISO 8601. TTL in seconds. Validate that receiving agent checks TTL before processing. Null not allowed

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Incomplete Task Handoff Prompt into an orchestration layer or agent framework with validation, retries, and lossless context transfer.

The Incomplete Task Handoff Prompt is designed to sit at the boundary between two agents in a multi-agent pipeline. When an upstream agent cannot complete its assigned work—due to a timeout, tool failure, policy refusal, or capability gap—this prompt structures the handoff so the receiving agent gets a complete picture of what was done, what remains, and what intermediate results are available. In an orchestration framework, this prompt should be invoked by the supervisor or orchestrator agent immediately after detecting an incomplete termination signal from the upstream agent. The orchestrator should capture the upstream agent's final state, partial outputs, and any error context, then populate the [COMPLETED_SUBTASKS], [REMAINING_WORK_ITEMS], [INTERMEDIATE_RESULTS], and [FAILURE_CONTEXT] placeholders before calling the handoff prompt.

Wire this prompt into your agent framework as a structured handoff function that runs before routing work to the next agent. The function should: (1) validate that all required fields in the handoff payload are populated—empty [COMPLETED_SUBTASKS] is acceptable if nothing was finished, but missing [REMAINING_WORK_ITEMS] should trigger an error; (2) serialize intermediate results in a format the receiving agent can consume, preserving file handles, database cursors, or API response objects as structured references rather than raw text dumps; (3) attach a unique handoff ID and timestamp for traceability across agent boundaries; (4) log the full handoff payload to your observability pipeline so you can audit context transfer fidelity later. If the receiving agent is a different model or has different tool access, include a [REQUIRED_CAPABILITIES] field that the orchestrator checks against the receiving agent's capability registry before routing—mismatches should escalate to a human operator rather than silently failing downstream.

For production reliability, implement a handoff validation step before the receiving agent begins work. This validator should confirm that the handoff payload is parseable, that all referenced intermediate results are accessible, and that the remaining work items are actionable given the receiving agent's known capabilities. If validation fails, retry the handoff prompt once with an explicit error message injected into [FAILURE_CONTEXT]. If validation fails twice, escalate to a human-in-the-loop queue with the partial handoff package and a structured summary of what could not be validated. Avoid the common failure mode of passing incomplete handoffs silently—this is the primary cause of duplicated work and conflicting agent actions in multi-agent systems. Use the eval criteria defined in the playbook (completeness of handoff, accuracy of state capture, clarity of boundary marking) as automated guardrails in your CI/CD pipeline before deploying any changes to the handoff prompt or the surrounding orchestration logic.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the structured handoff package produced by the Incomplete Task Handoff Prompt. Use this contract to validate the receiving agent's input before resuming work.

Field or ElementType or FormatRequiredValidation Rule

handoff_id

string (UUID v4)

Must parse as valid UUID v4. Reject if missing or malformed.

origin_agent_id

string

Must match a known agent identifier in the orchestration registry. Reject if unknown.

target_capabilities

string[]

Array must contain at least one capability tag. Each tag must match a capability in the receiving agent's manifest.

completed_subtasks

object[]

Each object must include 'subtask_id' (string), 'result_summary' (string), and 'artifacts' (object). Empty array is valid if no subtasks completed.

remaining_work_items

object[]

Each object must include 'item_id' (string), 'description' (string), 'priority' (enum: critical|high|medium|low), and 'estimated_effort' (string). Array must not be empty.

intermediate_results

object

Must be a valid JSON object. May be empty {}. Each key must map to a serializable value. Reject if contains circular references.

context_snapshot

object

Must include 'user_intent' (string), 'session_state' (object), and 'constraints' (string[]). Reject if user_intent is empty string.

failure_boundary

object

Must include 'last_successful_step' (string), 'failure_reason' (string), and 'safe_to_resume' (boolean). Reject if safe_to_resume is true but failure_reason is empty.

PRACTICAL GUARDRAILS

Common Failure Modes

Incomplete task handoffs are the most common failure mode in multi-agent pipelines. These cards identify what breaks first when context is lost between agents and how to guard against silent data loss.

01

Silent Context Truncation

What to watch: The sending agent omits critical intermediate results, assumptions, or failed attempts because the handoff prompt doesn't explicitly require them. The receiving agent proceeds with incomplete information and produces plausible but wrong output. Guardrail: Require a structured handoff schema with mandatory fields for completed subtasks, remaining work, preserved artifacts, and explicit 'not attempted' markers. Validate field presence before forwarding.

02

Capability Mismatch Blindness

What to watch: The receiving agent accepts a handoff it cannot complete because the handoff payload doesn't declare required capabilities. The agent either fabricates results or fails silently after partial processing. Guardrail: Include a required_capabilities field in every handoff payload. The receiving agent must self-assess against those requirements and escalate if gaps exist before attempting work.

03

State Contamination Across Handoffs

What to watch: Stale state from a failed upstream agent leaks into the handoff payload, causing the receiving agent to act on outdated assumptions, user intent, or intermediate conclusions. Guardrail: Timestamp all state fields in the handoff payload. The receiving agent must compare timestamps against the current session clock and flag any state older than the last confirmed user interaction.

04

Implicit Completion Assumptions

What to watch: The handoff prompt uses ambiguous language like 'handle the rest' or 'finish the task,' leaving the receiving agent to guess what 'done' means. Scope boundaries blur and work is duplicated or dropped. Guardrail: Define explicit completion criteria as a checklist in the handoff payload. Each item must have a binary completed flag and a verified_by field. The receiving agent must not mark items complete without evidence.

05

Missing Failure Context

What to watch: When an agent hands off after a partial failure, it omits what it tried, what failed, and why. The receiving agent repeats the same failing approach or cannot distinguish between 'not tried' and 'tried and failed.' Guardrail: Require an attempt_log array in every handoff where the sending agent records each action taken, its outcome, and any error messages. The receiving agent must review this log before planning its own approach.

06

Handoff Validation Gap

What to watch: No automated check verifies that the handoff payload is complete, well-formed, and actionable before the receiving agent consumes it. Corrupted or empty handoffs propagate through the pipeline undetected. Guardrail: Run a lightweight validator agent or schema check on every handoff payload before routing. Reject handoffs missing required fields, containing unresolved placeholders, or exceeding staleness thresholds. Log rejections for operator review.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the Incomplete Task Handoff Prompt before production deployment. Each row defines a pass standard, a failure signal, and a reproducible test method.

CriterionPass StandardFailure SignalTest Method

Completed Subtask Inventory

All completed subtasks from [PARTIAL_RESULTS] appear in the handoff with status 'completed' and preserved outputs

Missing completed subtask or output truncated

Diff the input [PARTIAL_RESULTS] task list against the handoff completed-items list; flag any missing entries

Remaining Work Enumeration

Every incomplete or unstarted subtask from [TASK_LIST] not present in completed items is listed with status 'pending' or 'blocked'

Silently dropped pending task or ambiguous status label

Parse the handoff for a remaining-work section; cross-reference against the full [TASK_LIST] minus completed items

Intermediate Result Preservation

All intermediate artifacts, partial outputs, and working state from [INTERMEDIATE_STATE] appear in the handoff payload without modification

Intermediate result missing, summarized instead of preserved, or hallucinated content added

Hash or checksum comparison of [INTERMEDIATE_STATE] fields against handoff payload; flag any field not present verbatim

Required Capability Declaration

Handoff explicitly lists the capabilities the receiving agent must have, derived from remaining subtask requirements

Capability list is generic, missing a required capability, or absent entirely

Parse the capability-requirements block; verify each remaining subtask's tool or skill dependency has a corresponding capability entry

Blocking Condition Documentation

Any blocker, missing dependency, or reason a subtask could not proceed is documented with a specific reason string

Blocker described as 'unknown', 'error', or omitted when [PARTIAL_RESULTS] indicates a failure reason

Check that every subtask with status 'blocked' has a non-empty, non-generic blocker-description field

Lossless Context Transfer Score

Automated eval confirms no task-relevant context from [CONTEXT] was dropped in the handoff summary

Key constraint, user preference, or domain rule from [CONTEXT] absent from handoff

Run a structured extraction eval: list all constraints from [CONTEXT], verify each appears in the handoff context-summary or constraints block

Handoff Schema Compliance

Output strictly matches the [OUTPUT_SCHEMA] with all required fields present and correctly typed

Missing required field, extra field not in schema, or type mismatch

Validate the JSON output against the [OUTPUT_SCHEMA] using a schema validator; reject on any violation

No Fabrication in Gaps

No subtask output, completion claim, or intermediate result is invented for work not present in [PARTIAL_RESULTS]

Handoff claims a subtask is 'completed' when [PARTIAL_RESULTS] shows it was never started or failed

Assert that every completed-item in the handoff has a corresponding entry in [PARTIAL_RESULTS] with a matching task ID and output

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single receiving agent and minimal validation. Focus on getting the handoff structure right before adding orchestration logic. Replace [RECEIVING_AGENT_CAPABILITIES] with a simple text description of what the next agent can do.

Watch for

  • Missing intermediate results that the receiving agent needs
  • Overly verbose handoff summaries that bury the remaining work
  • No explicit 'not started' markers for untouched subtasks
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.