Handoffs are secure by default since PR #1848. The target agent only receives tools shared with the source agent. Use
tool_policy_mode="passthrough" only when you intentionally need legacy behaviour.Quick Start
How It Works
Modes
| Mode | Default? | Target tool set | Use when |
|---|---|---|---|
intersect | ✅ Yes | Tools both agents have, minus blocked_tools | Multi-agent systems with mixed trust levels (recommended) |
passthrough | No (opt-in) | Target’s own tools minus blocked_tools | Legacy code, or intentional capability delegation |
Configuration Options
HandoffToolPolicy
| Option | Type | Default | Description |
|---|---|---|---|
mode | Literal["intersect", "passthrough"] | "intersect" | How tools are filtered during handoff |
blocked_tools | List[str] | [] | Tool names always stripped regardless of mode |
handoff() shorthand kwargs
| Parameter | Type | Default | Description |
|---|---|---|---|
tool_policy_mode | Optional[Literal["intersect","passthrough"]] | None | Shorthand for config.tool_policy.mode |
blocked_tools | Optional[List[str]] | None | Shorthand for config.tool_policy.blocked_tools |
Common Patterns
Gatekeeper → automation (secure default)
Always block destructive tools
Passthrough with selective block list
Best Practices
Default to intersect for least-privilege
Default to intersect for least-privilege
Leave
tool_policy_mode unset unless you have a specific reason to use passthrough. Intersect mode prevents silent privilege escalation.Always block known dangerous tools
Always block known dangerous tools
Even in intersect mode, add
blocked_tools for tools like execute_code or shell_access if they appear in the shared set.Fix the source toolset, not the policy
Fix the source toolset, not the policy
If intersect mode leaves the target without a needed tool, add that tool to the source agent rather than switching to passthrough.
Test handoff boundaries in security tests
Test handoff boundaries in security tests
Verify that a gatekeeper handoff cannot invoke tools the source agent does not hold.
Migration Note
Related
Agent Handoffs
Core handoff patterns and delegation
Handoff Filters
Filter context passed during handoff
Handoff Configuration
Full HandoffConfig reference

