Skip to main content

Handoff Configuration

This page provides comprehensive documentation for configuring handoffs in PraisonAI, including handoff filters, delegation strategies, routing rules, and advanced orchestration patterns.

Handoff System Overview

The handoff system enables agents to delegate tasks to other agents based on expertise, availability, or specific conditions. This creates flexible multi-agent workflows with intelligent task routing.

Basic Handoff Configuration

YAML Configuration

Configure handoffs directly in YAML files using the nested handoff: block:

Handoff Policy Options

Handoff Filters

Filter Types and Configuration

Composite Filters

Dynamic Filter Functions

Advanced Delegation Settings

Delegation Strategies

Conditional Handoffs

Handoff Chains and Workflows

Handoff Routing Rules

Static Routing

Dynamic Routing

Rule-Based Routing

Tool Policy

HandoffConfig.tool_policy (HandoffToolPolicy) enforces tool boundaries when one agent hands off to another. Default mode is intersect (secure): the target receives only tools shared with the source, minus any blocked_tools.
The handoff() factory also accepts shorthand kwargs: See Handoff Tool Policy for modes, patterns, and migration guidance.

Handoff Security and Validation

Tool policy (HandoffConfig.tool_policy) is the primary tool-level security mechanism during handoffs. The settings below cover transport, authorisation, and payload validation.

Performance Optimization

Caching and Optimization

Complete Handoff Configuration Example

Environment Variables

Best Practices

  1. Use appropriate filters to ensure tasks are routed to capable agents
  2. Implement fallback mechanisms for handling failures
  3. Monitor handoff performance and adjust strategies accordingly
  4. Cache routing decisions for frequently occurring patterns
  5. Set reasonable timeouts to prevent indefinite waiting
  6. Implement circuit breakers for unreliable agents
  7. Use batching for high-volume scenarios
  8. Maintain audit trails for compliance and debugging

See Also