# `Codex.Handoff`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/handoff.ex#L1)

Represents a handoff from one agent to another, wrapping the downstream agent as a tool with
optional input filtering and history nesting controls.

# `is_enabled`

```elixir
@type is_enabled() :: boolean() | (map(), Codex.Agent.t() -&gt; boolean() | term())
```

# `t`

```elixir
@type t() :: %Codex.Handoff{
  agent: Codex.Agent.t() | nil,
  agent_name: String.t(),
  input_filter:
    (Codex.Handoff.InputData.t() -&gt; Codex.Handoff.InputData.t()) | nil,
  input_schema: map(),
  is_enabled: is_enabled(),
  nest_handoff_history: boolean() | nil,
  on_invoke_handoff: (map(), term() -&gt; Codex.Agent.t()),
  strict_json_schema: boolean(),
  tool_description: String.t(),
  tool_name: String.t()
}
```

# `default_tool_description`

```elixir
@spec default_tool_description(Codex.Agent.t()) :: String.t()
```

Default tool description referencing the downstream agent.

# `default_tool_name`

```elixir
@spec default_tool_name(Codex.Agent.t()) :: String.t()
```

Default tool name derived from the downstream agent name.

# `enabled?`

```elixir
@spec enabled?(t(), map(), Codex.Agent.t()) :: boolean()
```

Evaluates whether a handoff is enabled for the given context/agent.

# `wrap`

```elixir
@spec wrap(
  Codex.Agent.t(),
  keyword()
) :: t()
```

Wraps an agent as a handoff with optional overrides.

Options:
  * `:tool_name` - override the default tool name
  * `:tool_description` - override the default tool description
  * `:input_filter` - function invoked to filter history passed to the downstream agent
  * `:nest_handoff_history` - override history nesting behaviour
  * `:input_schema` - optional JSON schema map describing expected input
  * `:strict_json_schema` - whether the schema should be treated as strict (default: true)
  * `:is_enabled` - boolean or function to dynamically enable the handoff

---

*Consult [api-reference.md](api-reference.md) for complete listing*
