feat(permissions): map Kiro grep/glob categories to toolsSettings - #2170
Merged
Conversation
rulesync already carries canonical grep/glob categories, but the Kiro
translator dropped them with an "unsupported category" warning even
though Kiro documents toolsSettings.grep/glob.{allowedPaths,deniedPaths}.
Map grep -> toolsSettings.grep and glob -> toolsSettings.glob (mirroring
the read mapping), emitting each table only when a rule is present so
existing configs do not gain empty tables, and round-trip both on import.
Refactored the path-category handling into shared helpers to keep the
translator under the complexity limit.
This is item 1 of #2132 (the straightforward, override-independent fix).
The kiro-scoped override namespace for aws/shell-auto-trust/web-domain/
MCP keys (item 2) is left as a follow-up: it carries several open design
questions and touches the shared .kiro/agents/default.json round-trip.
Source: https://kiro.dev/docs/cli/custom-agents/configuration-reference/
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
@dyoshikawa Thank you! |
hirossyi73
pushed a commit
to hirossyi73/rulesync
that referenced
this pull request
Jul 10, 2026
…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 dyoshikawa#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 dyoshikawa#2170. Closes dyoshikawa#2132 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
rulesync already carries canonical
grep/globpermission categories, but the Kiro translator dropped them with an "unsupported category" warning — even though Kiro documentstoolsSettings.grep/toolsSettings.globwithallowedPaths/deniedPaths.Fix
grep→toolsSettings.grep.{allowedPaths,deniedPaths}andglob→toolsSettings.glob.{allowedPaths,deniedPaths}, mirroring the existingreadmapping.grep/globtables.rulesFromArrays,pathTable,applyKiroWebPermission) to keep the translator under the complexity limit.Scope
This is item 1 of #2132 — the straightforward, override-independent fix. The kiro-scoped override namespace for the Kiro-specific keys (item 2:
awstool, shell auto-trust flags, domain-scoped webtrusted/blocked, MCPautoApprove/disabledTools) is intentionally left as a follow-up: it carries several unresolved design questions (what counts as a permission vs. config in the shared.kiro/agents/default.json, how MCPautoApprove/disabledToolsreconcile with the canonicalmcp__*allow/ask/deny model, whetheraws/subagent/introspectbelong under a permissions override) that warrant a maintainer design call before implementing. The issue is left open for that part.Source: https://kiro.dev/docs/cli/custom-agents/configuration-reference/
Refs #2132
🤖 Generated with Claude Code