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. In CLI V3 and the IDE, the parent session's permissions also apply to the sub-agent's tool calls. See Sub-agent permissions.
In CLI 2.x, 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 start without a permission prompt. |
CLI V3 ignores toolsSettings. To limit which agents an agent can spawn in CLI V3, list subagent/<name> entries in its tools instead of subagent. Don't add @builtin or * to that agent's tools, since both include invoke_sub_agent, which can start any agent. To start a sub-agent without a prompt, add a subagent rule to its permissions:
{ "tools": ["read", "write", "shell", "web", "subagent/reviewer", "subagent/tester"], "permissions": { "rules": [ { "capability": "subagent", "match": ["reviewer", "tester"], "effect": "allow" } ] } }
To restrict the tools a sub-agent can use, configure tools in the sub-agent's own config file rather than in the parent.
How Kiro approves a sub-agent's tool calls depends on the CLI version.
| CLI 2.x | CLI V3 | |
|---|---|---|
| Agent fields read | allowedTools and toolsSettings | permissions (allowedTools and toolsSettings are ignored) |
| Starting a sub-agent without a prompt | Add the agent to toolsSettings.subagent.trustedAgents | Add a subagent capability allow rule |
| Sub-agent's own pre-approved tools | Run without a prompt, even if the parent doesn't allow them | Run without a prompt only when the parent session also allows them |
In CLI V3 and the IDE, Kiro checks every sub-agent tool call against two policies:
permissions.yaml, the parent agent's permissions, and the approvals you gave earlier in the session.permissions.The stricter result wins:
deny from either policy denies the call.ask rule in either policy prompts you.A sub-agent's allow rules take effect only when that agent runs as the top-level agent, for example with kiro-cli chat --agent <name>. A call that the sub-agent's rules don't mention follows the parent session's policy. A sub-agent with no permissions block runs under the parent session's policy.
To let a sub-agent's tool calls run without prompts in CLI V3, add the sub-agent's allow rules to one of these:
permissions.rules. The parent agent doesn't need the MCP server or tool itself.~/.kiro/settings/permissions.yaml. These rules apply to every agent.permissions.yaml. These rules apply to every agent in that workspace.For example, a sub-agent named data-analyst that allows every tool from the analytics MCP server needs the same rule in the parent agent:
{ "tools": ["read", "write", "shell", "subagent/data-analyst"], "permissions": { "rules": [ { "capability": "subagent", "match": ["data-analyst"], "effect": "allow" }, { "capability": "mcp", "match": ["analytics/*"], "effect": "allow" } ] } }
In a session where you trust every tool, --trust-all-tools approves sub-agent tool calls that would otherwise prompt. deny rules still apply.
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.
| 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 | In CLI 2.x, add the agent to trustedAgents to skip the start prompt, and pre-approve its tools in its own allowedTools. In CLI V3, add a subagent allow rule to skip the start prompt, and add the sub-agent's allow rules to the parent session's policy. See Sub-agent permissions |
| 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