Skip to content

Delegate to subagents

A subagent is an agent the main agent can call like a tool. Delegating a self-contained subtask keeps its intermediate work out of the main conversation: only the subagent’s final answer comes back. Strands harness gives you two ways to add one, your own specialist agents and a built-in general-purpose delegate.

Pass tools your own Agent instances wrapped with as_tool() / asTool(). Each is a tool named after the agent’s name, so give each a clear name and description that tells the model when to reach for it:

from strands import Agent
from strands_harness import create_harness
researcher = Agent(
name="researcher",
description="Researches a topic and returns a concise, sourced summary.",
system_prompt="Research the given topic and return a concise, sourced summary.",
)
agent = create_harness(tools=[researcher.as_tool()])

Each call runs from the subagent’s construction-time baseline, a fresh conversation, so a specialist does not accumulate state between calls. The subagent’s name must be unique across the tool set, the same rule as any tool.

Strands harness enables one built-in subagent, generalist, exposed to the agent as a tool. It is a full Strands harness agent that inherits the parent’s configuration (model, thinking, caching, context management, built-in tools, plugins, subagents, interventions, and sandbox) but runs with a generic role prompt instead of your instructions. It starts from a blank conversation, so the model must put everything the subtask needs into the call, and it returns a single self-contained answer.

Reach for it when a subtask would otherwise flood the main context: searching many files, a multi-step change, or open-ended exploration where you only need the conclusion. Because the generalist inherits interventions and the sandbox, a delegate cannot become an approval or isolation bypass.

The subagent tool is on by default. Set it to False / false in builtin_tools to turn it off:

from strands_harness import create_harness
agent = create_harness(builtin_tools={"subagent": False}) # no generalist delegate

For the full option list, see the configuration reference.