Practical guide · Agent orchestration
How to design handoffs between AI agents
A handoff changes who owns a task. Treat it as a typed system boundary, with an explicit destination, a compact evidence package, acceptance criteria, and one accountable agent. Adding more specialist prompts without that boundary creates routing errors, lost constraints, loops, and polished answers that nobody verified.
Published November 22, 2026 · 13 minute read
The short answer
Keep one manager when specialists only provide bounded evidence. Transfer control when a specialist should speak or act directly. Use deterministic code when the route follows known rules. Whichever pattern you choose, pass a structured contract rather than an improvised summary, cap transfers, preserve the original goal, and test the final external outcome.
Choose the control pattern before adding agents
OpenAI's orchestration guide separates agents-as-tools from handoffs. A manager calls a specialist as a tool when the manager should combine the evidence and own the answer. A handoff makes the specialist active when routing itself changes the instructions and the specialist should own the rest of the turn. Code-owned routing is safer when a field, policy, or workflow state determines the destination.
| Pattern | Use it when | Main risk |
|---|---|---|
| Specialist as tool | One manager must combine several bounded results. | The manager may distort or omit specialist evidence. |
| Agent handoff | A specialist should take ownership and respond directly. | History, authority, or user constraints may transfer badly. |
| Code-owned route | The destination follows deterministic fields or policy. | Rigid categories may reject a legitimate edge case. |
Define a handoff contract
OpenAI's handoff documentation supports typed handoff input, filters for the history sent to the next agent, dynamic availability, and a callback at transfer time. Those controls are useful only after the application defines what the receiver needs. Keep the original request separate from the sender's interpretation, and distinguish facts from assumptions.
| Field | Purpose | Validation |
|---|---|---|
| task_id | Correlates the transfer with one end-to-end run. | Required, immutable, unique within the workflow. |
| original_goal | Preserves what the user asked for. | Copied from trusted application state. |
| reason_for_transfer | Explains why this specialist is needed. | Short enum plus optional detail. |
| acceptance_criteria | Defines what completion means. | At least one testable condition. |
| evidence | Carries source IDs, tool results, and relevant artifacts. | Bounded size, provenance, and access checks. |
| open_questions | Names unresolved decisions without disguising them as facts. | Explicit owner or clarification path. |
| authority | States allowed reads, writes, approvals, and escalation. | Computed by the server, never granted by model text. |
| return_to | Names the next owner and terminal condition. | Allowed destination and hop budget. |
{
"task_id": "support-1842",
"original_goal": "Resolve a duplicate charge",
"reason_for_transfer": "refund_policy_exception",
"acceptance_criteria": ["Confirm eligibility", "Require approval before refund"],
"evidence": [{"type": "charge", "id": "ch_782", "status": "captured"}],
"open_questions": ["Was the second order delivered?"],
"authority": {"read": ["orders"], "write": [], "approval_required": true},
"return_to": "support_manager"
}
A worked support handoff
A support manager receives a duplicate-charge request. It retrieves both charge records, confirms that the account is authenticated, and routes the case to a refund specialist. The transfer includes the original request, charge IDs, policy version, missing delivery status, and a rule that any refund needs approval. It does not include the full conversation, unrelated account history, or permission to issue money.
The specialist can ask for the missing delivery status, determine eligibility, and prepare a proposed refund. It returns the decision, cited policy, exact amount, and approval request to the manager. The manager remains responsible for the user-facing explanation. If the specialist cannot establish eligibility, it returns an unresolved result rather than transferring the task to another agent.
Limit loops and lost ownership
Google ADK documents multi-agent workflows as a way to separate responsibilities and control execution. Production experience shows why the control matters. Microsoft's Azure SRE agent account reports discovery problems, prompt conflicts, transfer loops, and tunnel vision in a system with many specialists.
- Assign one owner at every step and one terminal owner for the final outcome.
- Set a maximum transfer count and detect repeated agent pairs with no new evidence.
- Allow receivers to reject an incomplete contract without silently taking ownership.
- Preserve the original goal and acceptance criteria outside model-generated summaries.
- Escalate when no permitted route can complete the task.
Control context at the boundary
The Google context architecture article separates durable session history, searchable memory, artifacts, and the smaller working context shown to a model. A receiver rarely needs the sender's full transcript. Pass the original goal, validated state, relevant evidence, and artifact references. Keep bulky logs and files outside the prompt, then let the receiver load them if needed.
Use the long context versus retrieval guide to decide which material belongs in the working prompt, which should be retrieved, and which should remain an artifact.
Test routing, transfer, and completion
- Create cases for every valid destination, each ambiguous boundary, and requests that should stay with the manager.
- Assert the contract schema, original goal, evidence IDs, authority, and return owner at every transfer.
- Remove one required field and verify that the receiver rejects the transfer without acting.
- Inject stale and conflicting evidence, then check whether the workflow asks for clarification or escalates.
- Force a repeated route and verify that the hop budget stops the loop.
- Grade the final system state and user outcome, not only the route selected.
- Trace each transfer and turn reviewed production failures into regression cases with the agent observability workflow.
AI agent handoff checklist
- The workflow needs a specialist instead of one agent with a narrower tool set.
- The manager, handoff, or code-owned route was chosen explicitly.
- One owner is accountable before and after every transfer.
- The contract preserves the original goal, acceptance criteria, and evidence provenance.
- Authority comes from application state and does not expand during transfer.
- Context is bounded, with large material stored as retrievable artifacts.
- Hop limits, loop detection, rejection, and escalation paths exist.
- Tests cover routing, contract validity, receiver behavior, and final outcome.