Skip to main content
Tool policy limits which tools the target agent can use during a handoff — so a low-trust gatekeeper cannot escalate privileges by handing off to a powerful automation agent.
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.
The user asks the triage agent; tool policy limits what the target can run during handoff.

Quick Start

1

Secure by default

No extra configuration needed — handoff(target) already enforces intersect mode.
2

Block dangerous tools

Always strip specific tool names regardless of mode.
3

Opt into legacy passthrough

Passthrough gives the target its full tool set (minus blocked_tools). Only use this when the source agent is intentionally delegating more capability than it holds.
4

Full HandoffConfig

How It Works

Modes

Configuration Options

HandoffToolPolicy

handoff() shorthand kwargs

Common Patterns

Gatekeeper → automation (secure default)

Always block destructive tools

Passthrough with selective block list

Best Practices

Leave tool_policy_mode unset unless you have a specific reason to use passthrough. Intersect mode prevents silent privilege escalation.
Even in intersect mode, add blocked_tools for tools like execute_code or shell_access if they appear in the shared set.
If intersect mode leaves the target without a needed tool, add that tool to the source agent rather than switching to passthrough.
Verify that a gatekeeper handoff cannot invoke tools the source agent does not hold.

Migration Note

Behaviour change (non-breaking API). Before PR #1848, handoffs passed the target agent’s full tool set. After PR #1848, the default is intersection. Existing code runs without changes, but the effective tool set during handoff is narrower. Restore legacy behaviour with one line: tool_policy_mode="passthrough".

Agent Handoffs

Core handoff patterns and delegation

Handoff Filters

Filter context passed during handoff

Handoff Configuration

Full HandoffConfig reference