handoff
Function
This function is defined in the handoff module.Create a handoff configuration for delegating tasks to another agent. This is a convenience function that creates a Handoff instance with the specified configuration. It supports both the legacy API and the new unified HandoffConfig with tool security boundary enforcement.
Signature
Parameters
Agent
required
The target agent to hand off to
Optional[str]
Custom tool name (defaults to transfer_to_<agent_name>)
Optional[str]
Custom tool description
Optional[Callable]
Callback function executed when handoff is invoked
Optional[type]
Type of input expected by the handoff (for structured data)
Optional
Function to filter/transform input before passing to target agent
Optional[HandoffConfig]
HandoffConfig for advanced settings
Optional[str]
Shorthand for config.context_policy (“full”, “summary”, “none”, “last_n”)
Optional[float]
Shorthand for config.timeout_seconds
Optional[int]
Shorthand for config.max_concurrent
Optional[bool]
Shorthand for config.detect_cycles
Optional[int]
Shorthand for config.max_depth
Optional
Tool boundary mode (“intersect” = secure by default, “passthrough” = legacy)
Optional
List of tool names to always block regardless of intersection
Returns
Handoff
A configured Handoff instance
Usage
Uses
HandoffConfigContextPolicyHandoffToolPolicyHandoff
Source
View on GitHub
praisonaiagents/agent/handoff.py at line 1001
