> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# handoff • AI Agent SDK

> Handoff functionality for agent-to-agent delegation.

# handoff

<Badge color="blue">AI Agent</Badge>

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

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.agent import handoff
```

## Classes

<CardGroup cols={2}>
  <Card title="ContextPolicy" icon="brackets-curly" href="../classes/ContextPolicy">
    Policy for context sharing during handoff.
  </Card>

  <Card title="HandoffConfig" icon="brackets-curly" href="../classes/HandoffConfig">
    Unified configuration for handoff behavior.
  </Card>

  <Card title="HandoffError" icon="brackets-curly" href="../classes/HandoffError">
    Base exception for handoff errors.
  </Card>

  <Card title="HandoffCycleError" icon="brackets-curly" href="../classes/HandoffCycleError">
    Raised when a cycle is detected in handoff chain.
  </Card>

  <Card title="HandoffDepthError" icon="brackets-curly" href="../classes/HandoffDepthError">
    Raised when max handoff depth is exceeded.
  </Card>

  <Card title="HandoffTimeoutError" icon="brackets-curly" href="../classes/HandoffTimeoutError">
    Raised when handoff times out.
  </Card>

  <Card title="HandoffInputData" icon="brackets-curly" href="../classes/HandoffInputData">
    Data passed to a handoff target agent.
  </Card>

  <Card title="HandoffResult" icon="brackets-curly" href="../classes/HandoffResult">
    Result of a handoff operation.
  </Card>

  <Card title="Handoff" icon="brackets-curly" href="../classes/Handoff">
    Represents a handoff configuration for delegating tasks to another agent.
  </Card>

  <Card title="handoff_filters" icon="brackets-curly" href="../classes/handoff_filters">
    Common handoff input filters.
  </Card>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="handoff()" icon="function" href="../functions/handoff">
    Create a handoff configuration for delegating tasks to another agent.
  </Card>

  <Card title="prompt_with_handoff_instructions()" icon="function" href="../functions/prompt_with_handoff_instructions">
    Add handoff instructions to an agent's prompt.
  </Card>
</CardGroup>

### Constants

| Name                        | Value                                                                                                                                                                                                         |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RECOMMENDED_PROMPT_PREFIX` | `'You have the ability to transfer tasks to specialized agents when appropriate. \nWhen you determine that a task would be better handled by another agent with specific expertise, \nuse the transfer to...` |

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Handoffs Concept" icon="hand-holding" href="/docs/concepts/handoffs" />

  <Card title="Handoffs Feature" icon="arrow-right-arrow-left" href="/docs/features/handoffs" />
</CardGroup>
