handoff moves the conversation to another agent from inside an operation tree.
Use it when the tree decides where the conversation goes — after a lookup,
inside an if. When the model should pick a destination from what the
caller asks for, use the agent’s handoffs field instead. To
reach a person, use transfer.
Config
Set exactly one of
target_agent_id and agent_name; neither or both is
refused at save.
summary is text, not a request
The tree runs after the model’s tool call, so there is no second model call to
write a summary. summary resolves like any template, and what it resolves to is
what the target receives:
{{args.summary}}— declare asummaryproperty on this tool’sjson_schemaand describe what to put in it; the model writes it when it calls the tool.{{tooldata.brief}}— something an earlier operation published.- Fixed prose, optionally with tokens.
What is checked when
At run time
messageis queued before the target is built and always plays to the end before the target speaks. The target then runs itson_enterhook, then speaks itsgreeting, or opens frominstructionsand its prompt if it has none.handoffis terminal: nothing may follow it in its chain.- A call allows 25 handoffs in total, counting both
handoffsand this operation. Past that, the agent tells the caller it cannot pass them on again. - In a test run the handoff is
simulated: the step reports the resolved target, context, summary and message,
the run returns
handed_off: true, and the target is never loaded.
Next
Handoffs
Routing by tree, from the team’s side.
Context policies
What
transcript, summary and none carry.