Skip to main content

handoff

AI Agent Handoff functionality for agent-to-agent delegation. This module provides handoff capabilities that allow agents to delegate tasks to other agents, similar to the OpenAI Agents SDK implementation. Unified Handoff System:
  • Handoff: LLM-driven (tool call) or programmatic agent-to-agent transfer
  • HandoffConfig: Configuration for context policy, timeouts, concurrency, safety
  • Replaces/absorbs Agent.delegate() and SubagentDelegator functionality

Import

Classes

ContextPolicy

Policy for context sharing during handoff.

HandoffToolPolicy

Policy for tool boundary enforcement during handoff.

HandoffConfig

Unified configuration for handoff behavior.

HandoffInputData

Data passed to a handoff target agent.

HandoffResult

Result of a handoff operation.

Handoff

Represents a handoff configuration for delegating tasks to another agent.

handoff_filters

Common handoff input filters.

TypedHandoff

Typed handoff with schema validation using Pydantic models.

Functions

handoff()

Create a handoff configuration for delegating tasks to another agent.

parallel_handoffs()

Execute multiple handoffs in parallel with concurrency control.

prompt_with_handoff_instructions()

Add handoff instructions to an agent’s prompt.

Constants


Handoffs Concept

Handoffs Feature