fix: handle denied web tools in kiro permissions#1534
Merged
dyoshikawa merged 2 commits intomainfrom Apr 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Kiro permissions regeneration so that Rulesync "*": "deny" for webfetch/websearch actively removes web_fetch/web_search from .kiro/agents/default.json, preventing previously-allowed web tools from lingering in allowedTools.
Changes:
- Update
buildKiroPermissionsFromRulesyncto deleteweb_fetch/web_searchfromallowedToolswhen the corresponding Rulesync permission action isdeny. - Add a unit test ensuring existing
default.jsonentries for web tools are removed when Rulesync denies them.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/features/permissions/kiro-permissions.ts | Implements deny semantics by removing web_fetch/web_search from allowedTools when Rulesync denies web permissions. |
| src/features/permissions/kiro-permissions.test.ts | Adds coverage to verify regeneration removes denied web tools while preserving unrelated existing tools. |
Owner
Author
|
@dyoshikawa Thank you! |
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.
Motivation
web_fetch/web_searchwhen Rulesync permissions used"*": "allow", but did not remove those tools when"*": "deny", causing regenerated.kiro/agents/default.jsonto retain denied web tool entries.Description
buildKiroPermissionsFromRulesyncinsrc/features/permissions/kiro-permissions.tsto removeweb_fetch/web_searchfromallowedToolswhen the corresponding Rulesync permission isdenyand keep existingallowbehavior.should remove web tools from allowedTools when deniedtosrc/features/permissions/kiro-permissions.test.tsthat verifies an existingdefault.jsonlosesweb_fetch/web_searchwhen Rulesync permissions deny them.fix: handle denied web tools in kiro permissionsand PR created to close the issue.Testing
pnpm vitest run src/features/permissions/kiro-permissions.test.ts, all tests passed (4 tests).pnpm cicheck, which completed successfully including formatting, linting, typecheck and the full test suite (190test files,5013tests passed).Codex Task