> ## 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 Config • AI Agent SDK

> HandoffConfig: Unified configuration for handoff behavior.

# HandoffConfig

> Defined in the [**handoff**](../modules/handoff) module.

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

Unified configuration for handoff behavior.

This consolidates all handoff-related settings including context policy,
timeouts, concurrency control, and safety features.

Attributes:
context\_policy: How to share context during handoff (default: summary for safety)
max\_context\_tokens: Maximum tokens to include in context
max\_context\_messages: Maximum messages to include (for LAST\_N policy)
preserve\_system: Whether to preserve system messages in context
timeout\_seconds: Timeout for handoff execution
max\_concurrent: Maximum concurrent handoffs (0 = unlimited)
detect\_cycles: Enable cycle detection to prevent infinite loops
max\_depth: Maximum handoff chain depth
async\_mode: Enable async execution
on\_handoff: Callback when handoff starts
on\_complete: Callback when handoff completes
on\_error: Callback when handoff fails

## Properties

<ResponseField name="context_policy" type="ContextPolicy">
  No description available.
</ResponseField>

<ResponseField name="max_context_tokens" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_context_messages" type="int">
  No description available.
</ResponseField>

<ResponseField name="preserve_system" type="bool">
  No description available.
</ResponseField>

<ResponseField name="timeout_seconds" type="float">
  No description available.
</ResponseField>

<ResponseField name="max_concurrent" type="int">
  No description available.
</ResponseField>

<ResponseField name="detect_cycles" type="bool">
  No description available.
</ResponseField>

<ResponseField name="max_depth" type="int">
  No description available.
</ResponseField>

<ResponseField name="async_mode" type="bool">
  No description available.
</ResponseField>

<ResponseField name="on_handoff" type="Optional">
  No description available.
</ResponseField>

<ResponseField name="on_complete" type="Optional">
  No description available.
</ResponseField>

<ResponseField name="on_error" type="Optional">
  No description available.
</ResponseField>

<Accordion title="Internal & Generic Methods">
  * **from\_dict**: Create config from dictionary.
  * **to\_dict**: Convert config to dictionary.
</Accordion>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/handoff.py#L37">
  `praisonaiagents/agent/handoff.py` at line 37
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Configuration Overview" icon="gear" href="/docs/configuration/index" />

  <Card title="Agent Config" icon="robot" href="/docs/configuration/agent-config" />

  <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>
