CLI V3 agent profiles use tag-based tools and unified permissions. If you have agents created before this format was introduced, the /upgrade-agent command converts them in place. It adds the new permission fields alongside your existing configuration and backs up originals before writing.
Run /upgrade-agent whenever you spot older fields like toolsSettings or allowedTools, or after you change V2 trust settings in an upgraded agent. Kiro records the generated V3 state in a kiroUpgrade marker in each upgraded file, so a later run can tell which agents need a first upgrade, a refresh, or your review.
In Kiro CLI 2.37 or later, a V3 session upgrades pending V2-format agents when it starts, so you rarely need to run /upgrade-agent yourself. Before 2.37, launch migration did not run on its own while the chat.enableAutoAgentUpgrade setting was unset; it now runs whenever the setting is unset, and an explicit false still keeps it off. The automatic upgrade applies the same conversion this page describes.
The launch scan covers the same directories as /upgrade-agent run: by default, .kiro/agents/ in your workspace and ~/.kiro/agents/ globally. When KIRO_AGENT_CONFIG_DIR is set, Kiro scans that directory instead of the global directory and skips the workspace scan. The scan does not search other directories. A scanned .json symlink can still point outside the scanned directory; see Security and trust. Use kiro-cli agent upgrade <directory> to upgrade a separate directory directly.
The chat.enableAutoAgentUpgrade setting has two states:
- Enabled (unset or
true): Every V3 launch upgrades pending V2-format agents in the scanned directories without asking. Each rewritten file first gets a.json.bakbackup. - Disabled (
false): Launches leave agent files unchanged. An interactive V3 launch shows a notice naming how many agents are still in the V2 format, and you upgrade them with/upgrade-agentorkiro-cli agent upgrade <directory>when you choose.
Prefer Enabled when you want V2 custom agents to keep working on V3 without a manual step; prefer Disabled when agent files are shared or version-controlled and you want to review each conversion before it lands.
To turn the automatic upgrade off:
kiro-cli settings chat.enableAutoAgentUpgrade false
The setting is global; a workspace's .kiro/settings/cli.json cannot override it.
To confirm which agents were upgraded, run /upgrade-agent diagnostics and check that they appear as Universal agents.
The automatic upgrade rewrites V2-format agent files in place, without a prompt, in the directories it scans: .kiro/agents/ in your workspace and ~/.kiro/agents/ globally, or only the KIRO_AGENT_CONFIG_DIR directory when that variable is set. Before writing, it copies each original to <filename>.json.bak, so you can revert an upgrade. It skips agents that are already in the V3 or universal format. If a scanned .json file is a symlink, Kiro follows the link and rewrites the linked target in place, even when that target is outside the scanned directory. To stop it, run kiro-cli settings chat.enableAutoAgentUpgrade false; Kiro then only reports pending agents and leaves every file as it is.
# Scan agents and open the selection menu /upgrade-agent # Same as above (explicit subcommand) /upgrade-agent run # Review previously upgraded agents and any conversion warnings /upgrade-agent diagnostics
Use the CLI command when agent files live in a central directory or you want a non-interactive preview:
# Preview changes and warnings without writing files kiro-cli agent upgrade <directory> --dry-run # Upgrade the files and keep backups kiro-cli agent upgrade <directory>
The command checks top-level *.json files in the directory. It does not search subdirectories. By default, each changed file gets a .bak backup. Add --no-backup only when another recovery copy already exists.
A dry run reports what would change and includes conversion warnings. In Kiro CLI 2.36 or later, the command also warns when the upgraded rules deny, hide, or ask for something V2 allowed, and the result table notes (N warnings) beside each upgraded file. On macOS and Linux, it also reports files the real run could not write. It leaves every file unchanged. The command skips non-agent JSON, externally managed agents, non-regular files, out-of-sync universal configs, duplicate paths to the same file, and symlinks whose target is outside the selected directory.
Exit code 0 means every file was upgraded, unchanged, or skipped. Exit code 1 means at least one file failed. Exit code 2 means the path is missing, unreadable, or not a directory.
In Kiro CLI 2.37 or later, a V3 --no-interactive run that stops because its named agent is in the V2 format exits with code 4 and names this command with the agent's directory, so a script can convert the agent and retry. See Exit codes.
By default, the run subcommand scans .kiro/agents/ in your workspace and ~/.kiro/agents/ globally. If those directories don't exist, Kiro checks .amazonq/cli-agents/ in the workspace and ~/.aws/amazonq/cli-agents/ globally. When KIRO_AGENT_CONFIG_DIR is set, Kiro uses that directory for the global scan and skips the workspace scan. The selection menu groups results by scope, and only agents that need upgrading appear.
When you select a group of agents to upgrade:
- Each original file is copied to
<filename>.json.bakas a backup - New-format permission fields are added alongside your existing configuration
- Your original settings (tool names, allowed commands, path restrictions) are preserved with equivalent rules in the new format
- A confirmation alert shows how many agents were upgraded
If a backup file already exists, numbered suffixes are used (.bak.1, .bak.2, etc.). When an agent config is a symlink, Kiro writes the upgraded content to the linked file and leaves the symlink in place.
Kiro refreshes the generated V3 permissions, tools, and Hooks when they no longer match the V2 trust settings in the same file, or when the migration itself has been revised. If you haven't edited those generated fields, the agent appears in the selection menu again and the upgrade replaces them with freshly generated values.
If you edit generated V3 fields by hand, Kiro stops refreshing them automatically. The agent appears under Universal · Out of Sync in the selection menu. Selecting that group rebuilds V3 from the V2 settings and overwrites your manual V3 edits. Kiro saves the previous file as a .bak backup.
If you want to undo the upgrade, rename the .json.bak file back to .json:
mv .kiro/agents/my-agent.json.bak .kiro/agents/my-agent.json
The upgrade translates your existing permission settings into the v3 format:
- Tool names: Old names (like
fs_read,execute_bash) are mapped to v3 capability tags (likeread,shell). Both are preserved for compatibility. toolsSettings: Per-tool allow/deny rules becomepermissions.rulesentries with capability, match pattern, and effect.allowedTools: Trusted-tool entries become capability-level allow rules.toolsSettings.subagent.trustedAgents: Becomes a{ "capability": "subagent", "match": [...], "effect": "allow" }rule. The rule only skips the prompt for starting those sub-agents. It doesn't approve their tool calls. See Sub-agent permissions.toolsSettings.subagent.availableAgents: Iftoolscontainssubagent, the migration replaces it with onesubagent/<name>entry per listed agent. Iftoolsalso contains@builtinor*, the agent can still start any agent throughinvoke_sub_agent, so replace those entries with category tags likereadandshellto keep the limit.- Regex patterns: V3 matches commands and URLs with globs, not regexes. A regex in
allowedCommandsorweb_fetch.trustedbecomes a glob when one matches it exactly; in an allow, a lone.reads as a literal dot, socat package.jsonstays an exact allow. In Kiro CLI 3.3.0 or later, an allow regex that no glob matches exactly is dropped with anunconvertible-patternwarning, so V3 asks before running what it allowed instead of auto-approving a wider glob; a deny regex that can be approximated becomes a broader glob, while a deny regex with no V3 form blocks every use of the tool. Agents an earlier upgrade wrote and nobody edited are re-derived on the next launch. autoAllowReadonly: Converts to a read-only-shell policy.- Object-form hooks: Converted to the array format the v3 schema requires.
- Workspace reads: Migrated configs allow
fs_readfor./**, so the agent can read workspace files without asking. Deny rules still take precedence. - Skill trust: If the V2 config trusts all built-in tools, or both includes a read tool and trusts
fs_read, the migration also trusts skill loading. When V2 read restrictions (deniedPaths) could reach skill files, skills ask for approval in V3 instead, and diagnostics reportsskill-read-restrictions.
All other fields (name, description, model, prompt, resources, mcpServers, welcomeMessage) pass through unchanged.
Here's a typical first run. You have 3 workspace agents and 1 global agent in older formats:
/upgrade-agent
Selection menu:
V2 or earlier upgrade [3 agents] Workspace Upgrade or refresh the universal (V2 + V3) config V2 or earlier upgrade [1 agent] Global Upgrade or refresh the universal (V2 + V3) config
Select "V2 or earlier upgrade [3 agents] - Workspace" to upgrade all 3 workspace-level agents. A universal (V2 + V3) config keeps your original fields for backward compatibility while adding newer permission rules.
Post-upgrade alert:
Upgraded 3 agents (backed up to .json.bak)
Run diagnostics to check for conversion warnings, patterns that couldn't be perfectly translated:
/upgrade-agent diagnostics
2 Universal agents my-agent Workspace ⚠ unconvertible-pattern: sleep [0-9]+ strict-dev Global ⚠ deny-by-default-readonly
| Warning | Meaning | What to do |
|---|---|---|
regex-shell-pattern | A shell regex was approximated as a glob | Review the converted pattern in permissions.rules |
regex-web-pattern | A URL regex was approximated as a glob | Review the converted URL pattern |
unconvertible-pattern | A regex has no exact V3 glob. In Kiro CLI 3.3.0 or later, an allow pattern with this warning is dropped, so V3 asks before running what it allowed; an unconvertible deny pattern blocks every use of the tool | For an allow pattern, rewrite it with only .* and literal text: a lone . reads as a dot, escape other regex characters such as + as \+, and leave out *. For a deny pattern, rewrite it as a narrower glob in permissions.rules or remove it |
unmapped-allowed-tool | A tool entry couldn't be mapped to a capability | Check if the tool has a new name or was removed |
deprecated-aws-tool | aws / use_aws tool is deprecated | Remove the deprecated tool reference |
deny-by-default-readonly | Conflicting deny-by-default and auto-allow-readonly settings | Review your permission intent and adjust manually |
file-prompt | Absolute or ~/ file prompt paths may not resolve in all environments | Use relative paths instead |
unconvertible-hook | A hook couldn't be converted to the new format | Recreate the hook using the supported trigger format |
skill-read-restrictions | V2 read restrictions could reach skill files, so skills ask for approval in V3 | Review the generated skill permission before using the agent |
deny-by-default-trusted-shell | allowedTools trusts the shell, so V2 ran every command; V3 denies any command not in allowedCommands | Remove denyByDefault, or drop shell from allowedTools and list the commands to allow |
hidden-tool | A deny covers everything the tool can do, so V3 removes the tool from the agent | Narrow the deny, or add the commands or paths to allow |
allow-read-only-dropped | allowReadOnly let V2 read any file without asking; V3 has no rule for it, so reads outside the workspace ask | Trust the read tool in allowedTools, or add the paths to allowedPaths |
Kiro CLI 2.36 or later reports the last three warnings, which mark a permission conflict: the upgraded V3 rules deny, hide, or ask for something V2 allowed.
In Kiro CLI 2.36 or later, a V3 session shows a notice once per session for each active agent whose V3 permission rules block something its V2 settings allowed. The notice appears at session start, when you switch agents with /agent, or when you load a saved session. It names the agent, lists up to three findings, and ends with the way back to V2: kiro-cli settings chat.agentEngine v2 for every session, or kiro-cli --v2 for one session. V2 sessions show no notice.
To clear the notice, edit the agent's permission rules, or ask its owner to. An externally managed agent has to be updated by its owner. To verify, start a new V3 session with that agent; the notice no longer appears once its rules allow what V2 allowed.
The following are excluded from the scan:
- Backup files (
.bak) are excluded from the scan - Files that aren't valid agent configs (JSON files without
prompt,tools,hooks, or permission fields) are ignored
All your agents are already in the latest format. Run /upgrade-agent diagnostics to review their current state.
Some patterns can't be perfectly translated from regex to glob format. Run /upgrade-agent diagnostics, review the flagged agents, and manually edit the permissions.rules in the upgraded config if needed. In Kiro CLI 3.3.0 or later, an allow pattern flagged unconvertible-pattern is left out of the upgraded config, so the commands or URLs it allowed ask for approval until you rewrite it.
Verify the file is valid JSON and contains at least a prompt, tools, or hooks field. Files that don't look like agent configurations are ignored.
- Agent configuration reference for the current agent config format, including the Markdown format
- Permissions for the capability-based permission rules
- Custom agents for creating and managing agents
Upgrading agent configs