Skip to content

strands.vended_tools.subagent.subagent

Subagent tool for delegating a task to a child agent at runtime.

Provides :func:make_subagent (a factory that lets the developer pin safety limits and authority modes). Each call resolves the model’s arguments through the authority-mode system (see :mod:~strands.multiagent.spec), builds a child agent via an :data:AgentBuilder, runs it, and streams the result back.

def make_subagent(
*,
builder: AgentBuilder | None = None,
presets: Mapping[str, Preset] | None = None,
default_preset: str | None = None,
instructions: Open | Choice | Fixed | None = None,
tools: Choice | Fixed | Inherit | None = None,
model: Inherit | Choice | Fixed | None = None,
context: Fixed | Choice | None = None,
max_depth: int = DEFAULT_SUBAGENT_MAX_DEPTH,
name: str = "subagent",
description: str = DEFAULT_SUBAGENT_DESCRIPTION) -> AgentTool

Defined in: src/strands/vended_tools/subagent/subagent.py:340

Build a subagent tool whose schema is derived from the axis modes and presets.

Each axis accepts a policy from :mod:~strands.multiagent.spec that controls what the model sees and can supply. Omitted axes use sensible defaults.

Raises:

  • ValueError - If max_depth < 1, name or description is empty, or a Choice axis violates its constraints (empty options, multiple=False for tools).

Pre-built subagent tool with default settings (generalist preset, all axes using defaults).