A handoff transfers the conversation: the other agent takes over and answers the user, and the original agent is out of the loop. The SDK gives you two ways to involve another agent, and the handoff is the one for triage that routes to a specialist who should own the rest of the conversation.
Before you start
You need a working OpenAI Agents SDK triage agent. Write the specialist job in one line first, and give the specialist a handoffDescription: it is the only thing the delegating model reads when deciding whether to transfer.
Create the specialist and list it in handoffs
Create the specialist agent with its own instructions and a clear handoffDescription, for example handles billing questions and refunds. Add it to the triage agent handoffs list. The receiving agent sees the entire conversation history by default; trim it with an input_filter if the history is long.
Test the transfer with a specialist question
Ask the triage agent a billing question and check the reply comes from the specialist. Then ask a general question and check it stays with triage. If every question transfers, the handoffDescription is too broad.
Worked example: Triage and billing for a fictional shop
Maple Shop is a fictional online shop. Its triage agent hands billing questions to a billing specialist. The table shows the routing.
| Question | Handled by | Why |
|---|---|---|
| Where is my order? | Triage agent | A general question |
| Why was I charged twice? | Billing specialist | A billing question |
| How do I return a helmet? | Triage agent | A general question |
Expected result (UNTESTED): the billing question is answered by the specialist, and the other two stay with triage. We checked the OpenAI Agents SDK guides, which describe handoffs and the handoffDescription field, but we did not run the agents on this machine.
Limits
A handoff gives the conversation away: the triage agent cannot take it back. Use a handoff when the specialist should own the rest of the conversation, and use an agent as a tool when the main agent should stay in charge and merely consult.
