Agent handoff: how to pass work between AI agents without losing context
An agent handoff transfers the next step to another agent, together with the context needed to carry it out. Pass the objective, decisions and evidence, unresolved questions, current state revision and next owner. Inside one framework, use its documented transfer primitive; across frameworks with people participating, consider a shared coordination layer rather than relying on a summary alone.
What should travel with an agent handoff?
A conversation transcript, a transfer argument and application state are different things. OpenAI's handoff documentation separates the receiving agent's conversation history from the input_type payload passed to the handoff callback. That payload supplies transfer metadata; it does not replace the receiving agent's main input. Treat the history and the task record as separate parts of your contract. See OpenAI Agents SDK handoffs.
- Objective and constraints: the requested outcome, permissions and stopping condition.
- Decisions and evidence: accepted conclusions, their reasons and references to original records.
- Unresolved questions: uncertainty, missing inputs and rejected options that still matter.
- Ownership and revision: the receiving agent, task ID, current state revision and acceptance status.
This checklist is a design recommendation, not a claim that every framework fills these fields automatically. Record the transfer before acting on it, and distinguish sent from accepted. A recipient should reject a stale revision or ask for clarification rather than silently reconstructing the missing rationale.
What gets lost when context crosses the boundary?
Summaries can keep the answer while dropping its conditions: an approval for one proposal becomes an apparent approval for every proposal. A tool result may be summarized without its source, or an unresolved question may read like a settled fact. Preserve the evidence reference and the revision to which a decision applies. Give the recipient access only to the records its task requires.
OpenAI documents input_filter for changing the history passed onward. Its documentation also warns that nested handoff history is a representation change, not sensitive-data redaction. Select or redact permitted inputs deliberately; do not assume a shorter transcript removes secrets. LangChain's multi-agent example explicitly selects messages for the destination rather than treating all state as equally useful. Sources: OpenAI Agents SDK handoffs and LangChain handoffs.
How do the main frameworks represent the transfer?
Compare the same three criteria: transfer primitive, context surface and ownership consequence. These are documented mechanisms, not scores. CrewAI delegation belongs in the comparison, but delegation is not automatically a transfer of the active conversation. Sources reviewed November 11, 2026: OpenAI Agents SDK handoffs, LangChain handoffs, Microsoft Agent Framework handoff orchestration, CrewAI agents.
| Approach | Transfer primitive | Context surface | Ownership consequence |
|---|---|---|---|
| OpenAI Agents SDK | Handoffs exposed as model tools; handoff() customization | Conversation history; optional input filter and callback metadata | Receiving agent takes over the conversation |
| LangChain / LangGraph | Tool returns Command with state update; multi-agent example uses goto | Selected messages and active-agent state | State and routing identify the next active agent |
| Microsoft Agent Framework | Configured handoff connections between agents | Documentation describes full conversation context at transfer | Receiving agent continues; contrast with agent-as-tools |
| CrewAI | allow_delegation enables delegation to other agents | Task delegation; a full-history conversation-transfer contract is not documented in the pages we reviewed | Do not equate delegated work with a new conversation owner |
Use the framework's mechanism when agents share its execution model. Add your own acceptance, validation and failure handling around the transfer. A routing tool identifies the destination; it does not prove that the next agent finished the task or that a business action was authorized.
How should you test a handoff before using it?
Test a missing evidence record, a corrected decision, a recipient that never accepts, and a repeated transfer. Check that each case retains one current owner and stops or escalates with a reason. Compare the recipient's actual inputs with the transfer contract, not just its final answer. Keep retry identity separate from task identity so a repeated message does not create duplicate work.
Use the handoff checklist for the transfer note, the handoffs pattern for control-flow tradeoffs, and the context guide for shared facts. These checks complement, rather than replace, the framework's own handoff mechanism.
What do people ask about agent handoff?
Is an agent handoff the same as calling another agent as a tool?
Not necessarily. A tool call can return work to the original agent, while a handoff makes the receiving agent active. OpenAI and Microsoft document this distinction; define the next owner explicitly in your task record.
Should every handoff include the entire transcript?
No. Pass permitted context that supports the next decision, with references to fuller evidence when needed. OpenAI documents history filtering, and LangChain's multi-agent handoff example selects destination messages. Preserve conditions and uncertainty when reducing context.
Updated November 11, 2026