Sub-agents let you hand off focused tasks to agents that run in their own isolated context. The main agent spawns sub-agents when a task benefits from parallelism, specialized tools, or context isolation - then aggregates the results when they finish.
| Capability | IDE | CLI | Web | Mobile |
|---|---|---|---|---|
| Automatic sub-agent invocation | ✓ | ✓ | ✓ | ✓ |
| Explicit sub-agent invocation | ✓ | ✓ | ✓ | ✓ |
| Custom agents as sub-agents | ✓ | ✓ | ✓ | — |
| Parallel execution | ✓ | ✓ | ✓ | ✓ |
On Web, custom agents committed to .kiro/agents/ can be invoked as sub-agents, along with Kiro's built-in sub-agents. Mobile uses built-in sub-agents only.
Any custom agent can be invoked as a sub-agent. The main agent automatically selects agents based on their description field, or you can request one explicitly:
Use the code-reviewer agent to analyze src/auth/ for security issues
Sub-agents share the workspace environment but run with isolated conversation context:
| Shared with main agent | Isolated per sub-agent |
|---|---|
| Steering files | Conversation history |
| MCP servers | Context window |
| Workspace file access | Spec state |
| Permissions configuration | Hook triggers |
Kiro includes two internal sub-agents used automatically when appropriate:
You don't need to configure these - the main agent uses them as needed.
Sub-agents run in parallel, each working independently. This is useful for:
Refactor these three services to use the new auth middleware - do them in parallel
Sub-agents support directed acyclic graphs (DAGs) where tasks depend on each other. The main agent plans the full task graph upfront, then executes in the right order - running independent tasks in parallel and waiting for dependencies before starting dependent ones.
┌─────────────┐ │ 1. Analyze │ │ dependencies │ └──────┬───────┘ │ ┌──────▼───────┐ │ 2. Refactor │ │ modules │ └──────┬───────┘ │ ┌──────▼───────┐ │ 3. Run and │ │ fix tests │ └──────────────┘
A stage can loop back to an earlier stage when its output signals that more work is needed - for example, a reviewer sends work back to an implementer for revisions.
Implement the feature, then have a reviewer check it and send it back for fixes until it passes
The agent builds a looping pipeline with:
NEEDS_CHANGES)Constraints:
The default sub-agent has the same built-in tools as the main agent - read, write, shell, web_search, web_fetch, and any configured MCP tools.
When you delegate to a custom agent, the sub-agent uses that agent's tools and permissions configuration. Tools not listed in the custom agent's config won't be available to the sub-agent.
Control which agents can be spawned and which run without approval prompts using toolsSettings.subagent in your agent configuration:
{ "toolsSettings": { "subagent": { "availableAgents": ["reviewer", "tester", "docs-*"], "trustedAgents": ["reviewer", "tester"] } } }
| Field | Description |
|---|---|
availableAgents | Glob patterns for agents this agent can spawn. Omit to allow all. |
trustedAgents | Agents that run without permission prompts. |
To restrict the tools a sub-agent can use, configure tools in the sub-agent's own config file rather than in the parent.
When workflows are disabled, sub-agents run in parallel and the main agent waits until all complete before proceeding. When workflows are enabled, the main agent instead launches custom-agent delegation as a background workflow run, so you can continue the parent conversation and monitor the run under Workflows. Each delegated agent has its own context window.
You can speed up development by leveraging sub-agents to perform multiple tasks simultaneously - for example, fetching and analyzing several tickets in parallel.
availableAgents and trustedAgents for orchestrator agents that spawn many sub-agents| Issue | Solution |
|---|---|
| Sub-agent not starting | Verify the task description is clear and actionable |
| Unknown agent | Check the agent name with kiro-cli agent list; a request naming an unknown agent fails instead of falling back to the default agent |
| Missing tool access | Check the agent configuration's tools field |
| Approval prompts blocking | Add the agent to trustedAgents, or trust the subagent tool |
| Main agent can't spawn sub-agents | Add subagent to the orchestrator agent's tools array |
| Incomplete results | Provide more specific instructions or break into smaller tasks |
Invoking as sub-agents