Skip to content

feat(permissions): add kiro-scoped override for shell auto-trust flags, aws services, and web_fetch domain trust - #2195

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2132-kiro-override
Jul 9, 2026
Merged

feat(permissions): add kiro-scoped override for shell auto-trust flags, aws services, and web_fetch domain trust#2195
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2132-kiro-override

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Implements item 2 of #2132: a tool-scoped kiro permissions override namespace (per #2127) for Kiro's agent-config toolsSettings knobs that have no canonical allow/ask/deny category. (Item 1 — mapping the canonical grep/glob categories — already shipped in #2170.)

Scope

The override authors the Kiro-specific surfaces that live in the agent config (.kiro/agents/<name>.json) this permissions translator already writes:

  • Shell auto-trust flagstoolsSettings.shell.autoAllowReadonly / denyByDefault
  • aws built-in tooltoolsSettings.aws.allowedServices / deniedServices (+ autoAllowReadonly)
  • web_fetch domain trusttoolsSettings.web_fetch.trusted / blocked (regex host patterns; Kiro documents these for web_fetch only — web_search has no domain-trust surface)

Example:

{
  "permission": { "bash": { "git *": "allow" } },
  "kiro": {
    "toolsSettings": {
      "shell": { "autoAllowReadonly": true },
      "aws": { "allowedServices": ["s3"], "deniedServices": ["eks"] },
      "web_fetch": { "trusted": [".*github\\.com.*"] }
    }
  }
}

Behavior

  • Generate — the override is deep-merged per toolsSettings key (override wins at the leaf), so authoring shell.autoAllowReadonly keeps the canonical-generated shell.allowedCommands. Non-canonical shell flags already present in the file are preserved across regenerate even without an override (previously a regenerate clobbered the whole shell object). Prototype-pollution keys are guarded before being used as object keys.
  • Import — the Kiro-specific surfaces are lifted verbatim into the kiro override so they round-trip and become authorable; the canonical shell.{allowed,denied}Commands, read/write/grep/glob paths, and web_fetch/web_search allowedTools toggles are unchanged.
  • looseObject at every level, so future Kiro toolsSettings fields pass through verbatim.

Primary-source verification

All shapes were verified against Kiro's official docs (rendered via a browser since kiro.dev is a SPA):

Notable corrections vs. the issue's inferred shapes: the web domain arrays are regex patterns, not plain domains, and exist for web_fetch only.

Design decision (out of scope, deferred)

Kiro's MCP autoApprove / disabledTools lists — listed among the issue's proposed override keys — are not modeled here. They live in a separate file (.kiro/settings/mcp.json, under mcpServers.<name>), not the agent config this translator writes, and reconciling them with the canonical mcp__* allow/ask/deny model is a distinct design question (also flagged by the maintainer on the issue). Bundling a second-file write into the permissions override would be scope creep; it can be re-filed as its own focused issue.

Tests & docs

New tests cover authoring from the override, extraction on import, omission when absent, shell-flag preservation across regenerate, and a full round-trip. docs/reference/file-formats.md (+ synced skills/rulesync/) gains a "Kiro-only override" note including the MCP out-of-scope rationale.

Closes #2132

🤖 Generated with Claude Code

cm-dyoshikawa and others added 2 commits July 9, 2026 01:26
…s, aws services, and web_fetch domain trust

Kiro's agent config (.kiro/agents/<name>.json) exposes per-tool toolsSettings
knobs with no canonical allow/ask/deny category. Add a tool-scoped kiro override
(per #2127) authoring the ones that live in the agent config this permissions
translator already writes:
- shell auto-trust flags: toolsSettings.shell.autoAllowReadonly / denyByDefault
- aws built-in tool: toolsSettings.aws.allowedServices / deniedServices (+ autoAllowReadonly)
- web_fetch domain trust: toolsSettings.web_fetch.trusted / blocked (regex host
  patterns; documented for web_fetch only, so web_search is not modeled)

Wiring:
- Generate: deep-merge the override per toolsSettings key (override wins at the
  leaf) so authoring shell.autoAllowReadonly keeps the canonical-generated
  shell.allowedCommands. Non-canonical shell flags already in the file are also
  preserved across regenerate even without an override. Prototype-pollution keys
  are guarded before being used as object keys.
- Import: lift the kiro-specific surfaces into the kiro override so they
  round-trip and become authorable; canonical shell command lists / read / write
  / grep / glob / web allowedTools toggles are unchanged.

All shapes were verified against Kiro's primary docs (built-in-tools and
configuration-reference, rendered via a browser since kiro.dev is a SPA).

Out of scope (deferred): Kiro's MCP autoApprove / disabledTools live in a
separate file (.kiro/settings/mcp.json, under mcpServers.<name>), not the agent
config this translator writes, and reconciling them with the canonical mcp__*
model is a distinct design question. Item 1 of the issue (grep/glob mapping)
already shipped in #2170.

Closes #2132

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lists

Review finding (low, footgun): applyKiroOverride merged EVERY override
toolsSettings key after the canonical generation, so a user could author
kiro.toolsSettings.read.deniedPaths: [] (or shell.deniedCommands: []) and
silently weaken a canonical-generated deny — contradicting the override's
documented 'non-canonical keys only' contract.

- Reject fully-canonical toolsSettings keys (read/write/grep/glob) in the
  override with a warning (their paths are owned by the canonical permission
  block).
- For shell (partly canonical), strip the canonical command-list leaves
  (allowed/deniedCommands) from the override value so only the auto-trust flags
  merge.
- Add the same prototype-pollution guard to the import-side extractKiroOverride
  for symmetry with the generate side.
- Add a regression test asserting the override cannot clobber shell.deniedCommands
  or read.deniedPaths while a legitimate non-canonical flag still applies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit fd74014 into main Jul 9, 2026
8 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-issue-2132-kiro-override branch July 9, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kiro permissions: map grep/glob and cover aws tool, shell auto-trust flags, and domain-scoped web permissions

2 participants