Skip to main content

Upgrading agent configs

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.

Automatic upgrade when V3 starts

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.bak backup.
  • 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-agent or kiro-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:

bash
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.

Security and trust

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.

Usage

bash
# 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

Upgrade one directory from the shell

Use the CLI command when agent files live in a central directory or you want a non-interactive preview:

bash
# 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.

What happens during upgrade

When you select a group of agents to upgrade:

  1. Each original file is copied to <filename>.json.bak as a backup
  2. New-format permission fields are added alongside your existing configuration
  3. Your original settings (tool names, allowed commands, path restrictions) are preserved with equivalent rules in the new format
  4. 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.

Refreshing upgraded agents

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.

Reverting an upgrade

If you want to undo the upgrade, rename the .json.bak file back to .json:

bash
mv .kiro/agents/my-agent.json.bak .kiro/agents/my-agent.json

What gets converted

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 (like read, shell). Both are preserved for compatibility.
  • toolsSettings: Per-tool allow/deny rules become permissions.rules entries 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: If tools contains subagent, the migration replaces it with one subagent/<name> entry per listed agent. If tools also contains @builtin or *, the agent can still start any agent through invoke_sub_agent, so replace those entries with category tags like read and shell to keep the limit.
  • Regex patterns: V3 matches commands and URLs with globs, not regexes. A regex in allowedCommands or web_fetch.trusted becomes a glob when one matches it exactly; in an allow, a lone . reads as a literal dot, so cat package.json stays an exact allow. In Kiro CLI 3.3.0 or later, an allow regex that no glob matches exactly is dropped with an unconvertible-pattern warning, 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_read for ./**, 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 reports skill-read-restrictions.

All other fields (name, description, model, prompt, resources, mcpServers, welcomeMessage) pass through unchanged.

Example

Here's a typical first run. You have 3 workspace agents and 1 global agent in older formats:

bash
/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)

Reviewing diagnostics

Run diagnostics to check for conversion warnings, patterns that couldn't be perfectly translated:

bash
/upgrade-agent diagnostics
2 Universal agents my-agent Workspace ⚠ unconvertible-pattern: sleep [0-9]+ strict-dev Global ⚠ deny-by-default-readonly

Warning types

WarningMeaningWhat to do
regex-shell-patternA shell regex was approximated as a globReview the converted pattern in permissions.rules
regex-web-patternA URL regex was approximated as a globReview the converted URL pattern
unconvertible-patternA 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 toolFor 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-toolA tool entry couldn't be mapped to a capabilityCheck if the tool has a new name or was removed
deprecated-aws-toolaws / use_aws tool is deprecatedRemove the deprecated tool reference
deny-by-default-readonlyConflicting deny-by-default and auto-allow-readonly settingsReview your permission intent and adjust manually
file-promptAbsolute or ~/ file prompt paths may not resolve in all environmentsUse relative paths instead
unconvertible-hookA hook couldn't be converted to the new formatRecreate the hook using the supported trigger format
skill-read-restrictionsV2 read restrictions could reach skill files, so skills ask for approval in V3Review the generated skill permission before using the agent
deny-by-default-trusted-shellallowedTools trusts the shell, so V2 ran every command; V3 denies any command not in allowedCommandsRemove denyByDefault, or drop shell from allowedTools and list the commands to allow
hidden-toolA deny covers everything the tool can do, so V3 removes the tool from the agentNarrow the deny, or add the commands or paths to allow
allow-read-only-droppedallowReadOnly let V2 read any file without asking; V3 has no rule for it, so reads outside the workspace askTrust 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.

Conflict notices in V3 sessions

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.

Agents that are skipped

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

Troubleshooting

No agents appear in the selection menu

All your agents are already in the latest format. Run /upgrade-agent diagnostics to review their current state.

Warnings after upgrade

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.

Agent missing from the scan

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.

Page updated: November 12, 2026