Home › Rules › Kiro custom agents

Kiro custom agents and subagents: the config file, examples and permissions

From Kiro's own docs (Custom agents, Built-in agents, Creating custom agents, Agent configuration reference, Invoking as sub-agents, Agent examples, Troubleshooting, IDE 1.0 agent config and CLI V3 upgrade pages), checked Nov 11, 2026. Sources below.

Short answer: a Kiro custom agent is one file in .kiro/agents/ (one project) or ~/.kiro/agents/ (every project). It can be JSON, or Markdown with the settings in a YAML header and the system prompt in the body. The file decides which tools the agent can see (tools), what those tools may do without asking (permissions), what it reads at the start (resources), and which model it uses. Switch to it with the agent picker in the IDE, /agent swap in the CLI, or kiro-cli --agent name. Any custom agent can also run as a subagent: the main agent hands it a task, it works in its own context window, and it reports back. In CLI V3 and the IDE, a subagent never gets more permission than the session that started it.

What a custom agent is for

Out of the box, Kiro's default agent can use every tool but asks before most actions. Kiro's docs say custom agents let you pre-approve the operations you trust, take away tools a job doesn't need, load the right files automatically, and share the same setup with your team through git. So a custom agent is mostly about access. If you only want to change how Kiro writes code, Kiro's own tip is to use steering files instead, or both together.

Feature (Kiro's tables)IDECLIWebMobile
Project agents (.kiro/agents/)YesYesYesNo
Global agents (~/.kiro/agents/)YesYesNoNo
Switch agents in the UIYesYesNoNo
Custom agents as subagentsYesYesYesNo

On Kiro Web you can't pick a custom agent as the main agent, but the main agent can hand work to the ones committed in .kiro/agents/. Personal agents for cloud sessions are uploaded under Agent Config > Cloud Config in Kiro Web. Mobile only uses Kiro's built-in agents. Kiro Crew has its own agent setup plus long-running bots: see Kiro Crew.

The agents Kiro already has

Before you write one, check the built-ins. Kiro ships Default (the general agent every session starts with), Spec, Quick Spec and Bug Fix (they write requirements, design and task files in .kiro/specs/; see Kiro specs), and Plan, which is read-only: it can read files and search the web but can't write files, run commands or use MCP tools. The CLI adds Guide (/guide, answers from Kiro's docs for your installed version). Inside, Kiro also uses two subagents of its own, one that gathers context and a general-purpose one. In the IDE they show up in the / menu as /context-gatherer and /general-task-execution. More on planning first in our plan mode guide.

Where agent files go

Where Kiro looks for agents
my-project/
└── .kiro/
    └── agents/
        ├── backend-dev.md        # Markdown: settings in the header, prompt in the body
        ├── code-reviewer.json    # JSON: prompt goes in the "prompt" field
        └── team/
            └── planner.md        # nested folder: the agent is called team/planner

~/.kiro/agents/                   # global agents, available in every project

The file format, JSON or Markdown

Both formats take the same fields. Kiro's advice: Markdown when the system prompt is long and you want to read it as prose, JSON when a script writes the file. This is Kiro's quick-start agent:

Kiro's example: a Markdown agent
---
name: backend-dev
description: Backend development specialist
model: claude-sonnet-4.6
tools: ["read", "write", "shell"]
permissions:
  rules:
    - capability: shell
      match: ["npm *", "git *"]
      effect: allow
---

You are a backend engineer focused on Node.js and TypeScript.
Always use async/await. All database queries must be parameterized.

In JSON the prompt goes in a "prompt" field instead, either as text or as "file://./prompts/my-prompt.md". A relative file:// path in prompt is read from the folder the agent file is in.

FieldWhat it does
nameThe agent's name. Optional; Kiro uses the filename if it's missing.
descriptionWhat it's for. The main agent reads this to decide when to use it as a subagent, so be specific.
promptThe system prompt (JSON only; in Markdown it's the body).
modelA model ID from /model, like claude-sonnet-4.6. If that model isn't available, the first prompt can fail instead of falling back.
toolsWhich tools the agent can see: read, write, shell, web, subagent, @mcp, @builtin, @server, @server/tool, or * for everything.
excludedToolsTools to take away even if tools would allow them.
permissionsRules for what tools may do without asking (next section).
resourcesWhat it loads: file:// files at startup, skill:// skills (name and description first, the rest when needed), or a knowledgeBase to search.
mcpServersMCP servers just for this agent (command + args, or url + headers). Use ${VAR} for secrets.
includeMcpJsontrue adds the servers from your .kiro/settings/mcp.json files too.
includePowersAdds powers you installed in the IDE.
hooksHooks that only run with this agent, CLI V3 only. See the warning below.
welcomeMessageShown when you switch to the agent.

Watch out with hooks: Kiro's IDE 1.0 field table says the IDE "ignores agents containing this field". If an agent shows up in the CLI but not the IDE, that's the first thing to check. For hooks that work in both, use standalone files in .kiro/hooks/ (Kiro hooks).

File limits: in Kiro CLI 3.1.0+ and IDE 1.4.86+, an agent loads at most 32 file:// files and 100,000 characters in total. A file over 50,000 characters is cut, and a file over 1 MiB is skipped. Once a limit is hit, the rest of the files aren't loaded, so list the important ones first.

Tools vs permissions (the part people mix up)

tools decides what the agent can see. permissions decides what those tools may do without asking you. They use different names: tools takes tags like read and write, while permission rules take capabilities like fs_read, fs_write, shell, web_fetch, mcp and subagent.

Each rule has a capability, a match list of patterns (file paths, command prefixes, or MCP server/tool names), an effect (allow runs silently, ask prompts you, deny blocks), and an optional exclude. A deny anywhere beats an allow anywhere. Most actions no rule covers will ask you first. This is Kiro's code-review agent from its examples page:

Kiro's example: a code-review agent (CLI V3 format)
{
  "name": "code-review-agent",
  "description": "Specialized agent for code review and quality analysis",
  "prompt": "You are a code review specialist focused on quality, security, and best practices",
  "tools": ["read", "shell"],
  "permissions": {
    "rules": [
      { "capability": "shell", "match": ["grep *", "find *", "git diff *", "git log *", "eslint *", "pylint *"], "effect": "allow" },
      { "capability": "shell", "match": ["rm *", "sudo *"], "effect": "deny" }
    ]
  },
  "resources": [
    "file://CONTRIBUTING.md",
    "file://docs/coding-standards.md",
    "file://.eslintrc.json",
    "file://pyproject.toml"
  ],
  "hooks": [
    {
      "name": "changed-files",
      "trigger": "SessionStart",
      "action": { "type": "command", "command": "git diff --name-only HEAD~1" }
    }
  ]
}

Kiro's reference also warns that with write or shell on, an agent can change anything your user account can, including everything under ~/.kiro: other agents, skills, steering and mcp.json. Keep match patterns narrow, and give an agent write without shell when that's enough.

How to create a custom agent

Kiro custom agent examples you can copy

Kiro's examples page has an AWS specialist, a development workflow agent, the code reviewer above, a Docker and database project agent, and remote MCP agents. The ones below are ours, written against the current format. They're built to work together, and the third one hands work to the first two. Try them on a spare branch first.

Our example (VibeKits): a docs writer that can't touch your code

Our example (VibeKits): writes only in docs/, README and CHANGELOG
---
name: docs-writer
description: Writes and updates README and docs/ pages. Use for documentation changes only, never for source code.
tools: ["read", "write"]
permissions:
  rules:
    - capability: fs_write
      match: ["docs/**", "README.md", "CHANGELOG.md"]
      effect: allow
    - capability: fs_write
      match: ["src/**", ".env*", "package.json"]
      effect: deny
resources:
  - file://README.md
  - file://.kiro/steering/**/*.md
welcomeMessage: "Docs only. Which page should I update?"
---

You write plain, short documentation for this project.

- Explain what a thing does before how it works.
- Every command you show must be one you found in package.json or the existing docs.
- Never change files outside docs/, README.md or CHANGELOG.md. If code looks wrong, say so in your reply instead of fixing it.

It has no shell tool at all, so it can't run commands. The two fs_write rules let it write docs without asking and block src/, .env files and package.json outright. Anything else it tries to write still asks you.

Our example (VibeKits): a test runner that only runs tests

Our example (VibeKits): read + shell, pre-approved for test commands only
{
  "name": "test-runner",
  "description": "Runs the test suite and reports which tests fail and why. Use after code changes, before saying a task is done. Does not edit files.",
  "prompt": "You run tests and report results. Run the tests, read the failures, and reply with a short list: test name, file, the error, and your best guess at the cause. Do not edit any file.",
  "tools": ["read", "shell"],
  "permissions": {
    "rules": [
      { "capability": "shell", "match": ["npm test", "npm test *", "npx vitest run *", "git diff *", "git status"], "effect": "allow" },
      { "capability": "shell", "match": ["git push *", "git reset *", "rm *", "sudo *"], "effect": "deny" }
    ]
  },
  "resources": ["file://package.json"]
}

Swap npm test for your own test command. It has read and shell but no write, so the prompt's "do not edit any file" is backed up by the config, not just a request.

Our example (VibeKits): a lead agent that uses the other two as subagents

Our example (VibeKits): an orchestrator that can only start test-runner and docs-writer
{
  "name": "ship-it",
  "description": "Builds a small change, then has test-runner check it and docs-writer update the docs.",
  "prompt": "file://./prompts/ship-it.md",
  "tools": ["read", "write", "shell", "subagent/test-runner", "subagent/docs-writer"],
  "permissions": {
    "rules": [
      { "capability": "subagent", "match": ["test-runner", "docs-writer"], "effect": "allow" },
      { "capability": "shell", "match": ["npm test", "npm test *", "npx vitest run *", "git diff *", "git status"], "effect": "allow" },
      { "capability": "fs_write", "match": ["src/**", "tests/**", "docs/**", "README.md", "CHANGELOG.md"], "effect": "allow" },
      { "capability": "shell", "match": ["git push *", "rm -rf *", "sudo *"], "effect": "deny" },
      { "capability": "fs_write", "match": [".env*"], "effect": "deny" }
    ]
  },
  "resources": ["file://README.md", "file://.kiro/steering/**/*.md"]
}
Our example (VibeKits): the lead agent's prompt
You make one small change at a time.

1. Make the change the user asked for in src/ and tests/.
2. Ask the test-runner agent to run the tests. If it reports failures, fix them and ask it again. Stop after 3 tries and tell the user what is still failing.
3. When the tests pass, ask the docs-writer agent to update the docs for the change.
4. Finish with a short summary: files changed, test result, docs updated.

Three things make this work, all from Kiro's subagents page. subagent/test-runner and subagent/docs-writer in tools mean it can start only those two. There's no @builtin or *, because either one would let it start any agent. The subagent rule lets it start them without asking. And the test commands and docs paths are repeated in the lead agent's own rules, because in CLI V3 a subagent's allow only works when the parent session allows the same thing (more below). The 3-try limit is in the prompt because Kiro's docs don't describe a built-in retry cap for this kind of loop.

Our example (VibeKits): a global "explain this" agent for beginners

Our example (VibeKits): read-only, works in every project
---
name: explain
description: Explains code in plain English for a beginner. Read-only. Use when I ask what a file, function or error means.
tools: ["read"]
---

Explain like I'm new to coding. Start with one sentence on what the code is for,
then walk through it in short steps. Define any jargon the first time you use it.
Don't suggest changes unless I ask.

Kiro subagents: how delegation works

A subagent is a custom agent (or one of Kiro's built-ins) that the main agent starts for one piece of work. It gets its own context window, its own tools and permissions, and it hands its findings back when it's done. Kiro picks one based on each agent's description, or you can name it: "Use the code-reviewer agent to check src/auth/ for security issues."

Subagent permissions in CLI V3 and the IDE

This is the part that causes "why is it still asking me?" Kiro checks every subagent tool call against two policies, the parent session's (your permissions.yaml files, the parent agent's rules, and approvals you've already given) and the subagent's own. The stricter one wins:

SituationWhat happens
Either side says denyBlocked
Either side says askYou get a prompt
Subagent allows it, the parent has no rule for itYou get a prompt anyway
Both allow itRuns without asking
Headless run (no one to answer)Prompts are denied

A subagent's own allow rules only count on their own when you run it as the main agent (kiro-cli chat --agent name). To make its calls quiet as a subagent, put the same allow rules in the parent agent's permissions, or in ~/.kiro/settings/permissions.yaml (every agent) or your workspace permissions.yaml. --trust-all-tools approves everything in that session except deny rules. To limit which subagents can be started, and start them without a prompt, Kiro's example is:

Kiro's example: only reviewer and tester, started without a prompt
{
  "tools": ["read", "write", "shell", "web", "subagent/reviewer", "subagent/tester"],
  "permissions": {
    "rules": [
      { "capability": "subagent", "match": ["reviewer", "tester"], "effect": "allow" }
    ]
  }
}

CLI 2.x did this with toolsSettings.subagent (availableAgents and trustedAgents). CLI V3 ignores toolsSettings, and /upgrade-agent converts it. A converted trustedAgents entry only skips the "start this subagent?" prompt; it doesn't approve the subagent's tool calls.

CLI 2.x only: the old way, for reference
{
  "toolsSettings": {
    "subagent": {
      "availableAgents": ["reviewer", "tester", "docs-*"],
      "trustedAgents": ["reviewer", "tester"]
    }
  }
}

Kiro custom agents vs steering, skills, and other tools' subagents

Upgrading old agents (IDE 0.x and CLI 2.x)

IDE 0.x JSON agents keep working in IDE 1.0. CLI 2.x agents that still use allowedTools or toolsSettings without a permissions block are skipped by CLI V3 until you convert them. Run /upgrade-agent: it scans .kiro/agents/ and ~/.kiro/agents/, lists only the agents that need it, saves the original as <filename>.json.bak, and converts in place. It turns allowed and denied commands and write paths into permissions.rules, old tool names like fs_read and execute_bash into read and shell, and object-style hooks into a hooks array. /upgrade-agent diagnostics shows warnings afterwards. toolAliases and keyboardShortcut aren't part of the V3 format.

Kiro custom agent not working? 9 things to check

  1. Not in /agent list. Check the folder (.kiro/agents/ or ~/.kiro/agents/) and that the file is readable. Project agents only load in a trusted workspace.
  2. Broken JSON or YAML. A trailing comma or a missing quote stops it loading. Run it through a checker and compare with /agent schema.
  3. Shows in the CLI, not the IDE. Remove the hooks field; the IDE ignores agents that have one. Use .kiro/hooks/ files instead.
  4. An old CLI 2.x file. If it has allowedTools or toolsSettings and no permissions, CLI V3 skips it. Run /upgrade-agent.
  5. The wrong copy loads. A project agent with the same name beats your global one.
  6. It still asks for permission. tools doesn't pre-approve anything. Add an allow rule with the right capability name (fs_write, not write). As a subagent, the parent needs the same rule.
  7. /tools is empty or short. Check spelling in tools and the @server/tool form for MCP tools, and that the MCP server actually starts.
  8. The first message fails. The model ID isn't available to you. Pick one from /model.
  9. It can't hand off work. Add subagent or subagent/name to the lead agent's tools. An unknown subagent name fails instead of falling back to the default agent; check names with kiro-cli agent list.

Where Kiro's own docs disagree

Related setups

Custom agents are one part of a Kiro setup. The others: steering files for your rules, skills for step-by-step jobs, hooks for automation, and AGENTS.md, which Kiro reads too. In other tools: Claude Code subagents and Antigravity subagents. Not sure what rules to give the agent? The free rules generator writes a starting AGENTS.md.

Best value

All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)

Agents decide who does the work and what they're allowed to touch. The kits tell them what to build, step by step: a small game, a Discord bot, an email-triage agent, an MVP, or a cleanup of messy code.

Get all 6 kits for $29 → See what's in each kit

$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.

Related

Sources

Every field, folder, command and permission rule here was checked Nov 11, 2026 on Kiro's own docs. Kiro changes often, so the Custom agents pages in Kiro's docs win over this page. If something here no longer matches, tell us at [email protected].

Free rules starter pack for Cursor, Claude Code, Codex and Antigravity

One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.

After that, an occasional email when I publish a new guide or rules file.

Free. No spam. Unsubscribe anytime. See our privacy note.