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 and Mobile, the agent delegates to Kiro's built-in sub-agents only; custom agents defined in .kiro/agents/ can be invoked as sub-agents from the IDE and CLI.
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.
Sub-agents run in parallel and the main agent waits until all complete before proceeding. Each sub-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 |
| 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