Repository navigation
feat: let one MCP tool be always allowed from its tool list or approval card - #35002
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. It takes nothing away and adds a new list, which the gate matches only against a verified MCP identity. The gate checks it after every deny rule, governance and Notes
[DESIGN-REVIEWED] 5d3dfe7 Description read[DESCRIPTION-READ] 8efe184477c22a41410fd63cecb8a35bed6759316626d07c28fa55f28b7b96fd That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Each item answers the reported harm: a hand-edited Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: let a user stop approval prompts for one MCP tool, and turn them back on, with one click and no file edit. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 5d3dfe7 Description read[DESCRIPTION-READ] 57015bbeb8f01e65d9500f0bfd787861c44b6f09e4c32949a2ab0f9ea297862b That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read both primary controls correctly and would use them: the "Always allow" toggle and the Trust menu's "Always allow this tool". Notes
[UX-REVIEWED] 5d3dfe7 Description read[DESCRIPTION-READ] 65f4376bb774a8c532716c01e42cea47702cbac0d6588a526d6c302819771308 That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
dd787ef to
9375734
Compare
9375734 to
002e3df
Compare
|
span=52875fed6045 Disposition: fixed
|
|
span=81a4563c0b37 Disposition: fixed
|
|
span=81a4563c0b37 Disposition: fixed
|
|
span=81a4563c0b37 Disposition: fixed
|
|
span=e239c2de8747 Disposition: fixed
|
Sensitive Change ReviewSensitive files changed:
|
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: This change mostly adds a grant (a loosening), and it changes none of the shell deny composite's three tiers ( TIGHTENING: ADJUDICATED: 15 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: I wrote candidates for posix, windows and any.
The only platform assumption the diff makes is that UNADJUDICATED:
[SCOPE-REVIEWED] 5d3dfe7 |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. Adds hooks.auto_approve_tool_identities, written only by an owner-only MCP tool-list toggle and a new 'Always allow this tool' card decision. The gate matches entries only against a verified identity_ref, by literal case-insensitive equality, after confirm_tools/unknown, the deny tiers and governance, and leaves auto_approve_tools behaviour as on main. The card grants only the server-stamped ref, and the client pattern is proof only. App tokens, conductor relays, non-native decides and non-owners are refused before any write. Writes go through update_config_locked and wait for the watcher. The key is plumbed through the heartbeat drop (fresh HooksConfig), spec stripping, security-key provenance and the reload audit. No other HooksConfig construction leaks it. Tests cover the gate scenarios (forged shell title, literal matching, confirm_tools precedence), the routes, the card refusals and the plumbing. No blocking defects found; remaining items are a stale-grant edge case, doc drift and pending CI/process checks. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
5cba2c7 to
0cec0dc
Compare
|
span=5c7fc75e7f0d Disposition: fixed
|
0cec0dc to
96b0eac
Compare
|
span=f28364d8feb2 Disposition: fixed
|
96b0eac to
e6ef2cf
Compare
e6ef2cf to
cd19355
Compare
|
@bolichen97 thanks for the approval. One CI red on e6ef2cf5 came from this PR, so I pushed a one-line test fix and your approval was dismissed:
Nothing else changed: |
A user in Normal mode had no dashboard way to stop the prompt for one MCP tool; the only path was a hand-written KAS permissions.yaml that also skips Kiro Crew's gate. Add an "Always allow" toggle beside each tool in Customize -> Connections -> MCP Servers and an "Always allow this tool" row in the approval card's Trust menu. Both write the identity-keyed hooks.auto_approve_tools entry @server/tool through the endorsed config writer and wait for the watcher, so the next call uses it with no restart. The grant is answered by the gate's operator-grants tier after every deny rule and governance check, so all floors still win. No grant for wildcards, kirocrew-* servers, app or Connection servers, a server a confirm_tools pattern covers, or while config.local.json sets the list; the controls show the reason. The card grants only the ref the server stamped on the pending card, and every write is owner-only. Part of #34936
cd19355 to
5d3dfe7
Compare
|
span=95b1d37e64c4 Disposition: fixed
|
|
A maintainer's review on this PR already accepted the design, with the grants kept in their own What this review found on 5d3dfe7: no blocking defects. PR Readiness is green. I read the backend and frontend diff and checked these points:
The Sensitive Change Review check is red on this head. The author needs to post the template again with the current head SHA. Done well: the card grants only the For the security review:
Optional:
|
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed at 5d3dfe7. The change I asked for on 6b8346c is in place, so I'm approving.
_tier_operator_grantsno longer skips@-patterns on the title fallback.hooks.auto_approve_toolsmatches exactly as on main, andtest/test_hooks.pyis no longer changed, so main's assertions (an unprovenRunning: @memory-mcp/search_memoryand an identity-less title are still auto-approved by an operator's@memory-mcp/search_memory) stand.- The card and the MCP-tab toggle now write their own list,
hooks.auto_approve_tool_identities(GRANT_KEY), and neverauto_approve_tools. The gate matches it only by case-insensitive literal equality against the verifiedidentity_ref, after_operator_confirmsand every deny tier, so a shell call whose description reads@ops/listgets nothing from it. - The new list goes everywhere the old one does: the config section and baseline (empty default), the config-change audit count, the overlay check (
overlay_pins("hooks", GRANT_KEY)), the heartbeat lockdown (left empty), and the KAS hooks materialization. - Compared with 6b8346c, nothing else in product code changed. There's no new regex in product code.
Sensitive change review
- Head commit: 5d3dfe7
- What rule changed: A new
hooks.auto_approve_tool_identitieslist of exact@server/toolgrants, written only by the owner-gated approval card ("Always allow this tool") and the MCP tool list toggle. Theoperator-grantstier approves a call from it only when the call's verified MCP identity equals an entry.hooks.auto_approve_toolsmatching is unchanged from main. - Before -> after (what was allowed/blocked, now): Before, an owner who wanted one MCP tool to stop asking had to hand-edit config. After, one click writes that exact grant. Every call main approved or refused is decided the same way, and the new grants only add approvals for verified identities.
- Worst case if wrong (breaks commands / leaks secret / locks user out): The owner's own grant auto-approves a verified call of one MCP tool they chose. It never covers a wildcard, a
kirocrew-*, app or Connection server, aconfirm_toolsmatch, or a title match, and every deny tier and governance still run first. - Evidence checked (which sandbox result proves it): Read the gate tier, store, routes and card path.
test/test_gate_tiers.pypins the forged-title shell call against the new list, andtest/test_always_allow_tool.pypins the owner gate, the refusal codes and the SEL records. All other checks are green on this head. - No regression:
- Tools still work (which tools/commands were run, result): No local run (review only). CI test shards on this head passed.
- Backward compatible (old config / old data / old callers still work, how checked): The new key defaults to
[]. Existingauto_approve_toolsentries match as on main, andtest/test_hooks.pyis unchanged from main. - Existing tests (which suites passed on this head): All required CI suites passed on 5d3dfe7 (108 ok). The only red was this template check.
- How to undo: Revert this PR. Any
hooks.auto_approve_tool_identitiesentries left inconfig.jsonare then ignored, and calls ask again.
Auto-merge is left as you set it.
…35002) A user in Normal mode had no dashboard way to stop the prompt for one MCP tool; the only path was a hand-written KAS permissions.yaml that also skips Kiro Crew's gate. Add an "Always allow" toggle beside each tool in Customize -> Connections -> MCP Servers and an "Always allow this tool" row in the approval card's Trust menu. Both write the identity-keyed hooks.auto_approve_tools entry @server/tool through the endorsed config writer and wait for the watcher, so the next call uses it with no restart. The grant is answered by the gate's operator-grants tier after every deny rule and governance check, so all floors still win. No grant for wildcards, kirocrew-* servers, app or Connection servers, a server a confirm_tools pattern covers, or while config.local.json sets the list; the controls show the reason. The card grants only the ref the server stamped on the pending card, and every write is owner-only. Part of #34936 (cherry picked from commit 515f704)
Problem / Motivation
Goal: A user can stop the approval prompt for one MCP tool with one click, from the tool list or the approval card, and turn it back on the same way, with no file edit or terminal.
In Normal mode a user wanted one MCP server's read tools to stop asking every time. The dashboard offers no way: the approval card has Approve and Deny only, and the MCP tool list has a Disable toggle but no "stop asking". The user hand-edited the KAS
permissions.yaml, and their agent recommended config Crew strips.Why it matters
Every KAS user in Normal mode with a chatty MCP server clicks Approve on the same read tool all day, or turns on session-wide Trust, which approves every tool. The only per-tool path today needs a hand-written file that also skips Kiro Crew's own gate.
Not a goal
What changed (motivation → approach → change)
Both write the same thing: an
@server/toolentry in a new list,hooks.auto_approve_tool_identities, that only these two surfaces write. The gate'soperator-grantstier matches that list only against the call's verified MCP identity (mcp_identity_trusted), never a title, so a shell call whose model-written description reads@server/toolstill asks. Hand-writtenhooks.auto_approve_toolsentries are untouched and keep main's title fallback. The grant goes through the endorsed, locked config writer and the watcher applies it before the response, so the next call uses it with no restart. It is answered inside Kiro Crew's gate after every deny rule, governance andconfirm_tools, so the floors still win; KAS's own allow-always andpermissions.yamlare never written, because those skip the gate.No grant is offered for a wildcard name, a
kirocrew-*server, a server a shipped app declares, a Connection-bridged server, a server ahooks.confirm_toolspattern covers ("asks every time"), or whileconfig.local.jsonsets the list. The card grants only the@server/toolthe server stamped on that pending card from a verified identity; the client's pattern only proves it is the same card. Every write route is owner-only.Harnesses: any harness whose card carries a verified MCP identity (
mcp_identity_trusted). Verified on KAS in a pod; kiro-cli and claude (Crew-placed servers) reach the same gate tier but were not run.Docs:
security.md(grant paths and their floors) andconfig.md(which writes wait for the watcher).The new key is plumbed through
hook_runtime/gate_tiers.pyandhook_runtime/hook_types.py(HooksConfig),hooks.py(reload audit),config/loosening_provenance.py(security keys),config/loader_config.py(confirm_toolshelp),agent_materialization/kiro_hooks.py(stripped from specs) andslack/gateway_runtime/tool_policy.py(heartbeat). The grant query refreshes on config change and reconnect throughwebsite/src/hooks/websocket/serverState.ts, pinned inwebsite/src/test/useWebSocket.frameTrace.test.tsandwebsite/src/test/ApiClient.refactor.surface.test.ts.Where: backend
dashboard/always_allow_tool.py(eligibility, write, audit),dashboard/handlers/tool_grants.py(routes),chat_api/slot_approval.py(the new decision),chat_turn/permission_prompt.pyandchat_turn/tool_approval.py(card fields),connections/crew_oauth_proxy.py(serves_connection); frontendMcpToolAlwaysAllow.tsxinwebsite/src/pages/overview/McpTab.tsx,TrustDropdown.tsx,chat-input/approval.ts,ChatInput.tsx,api/client/mcp.ts,utils/toolGrantRefusal.ts; strings inwebsite/src/i18n/locales/en.manual.jsonand every shipped locale (en-XA.jsonregenerated).Backwards compatibility
Compatible:
hooks.auto_approve_tool_identitiesis a new key that only the card and the toggle write, and the gate reads it only for a verified identity.hooks.auto_approve_tools, its title fallback and every existing grant behave exactly as on main (test/test_hooks.pyis unchanged from main). The heartbeat path drops the new list as it dropsauto_approve_tools, and generated agent specs strip it like the other Kiro Crew hook keys.Removes nothing: no key, behaviour or record is taken away.
Tests
test/test_always_allow_tool.py: the card grants exactly its own ref and approves; a forged client pattern, a card without the server's proof, a non-native decide and a click-timeconfirm_toolsmatch grant nothing; the card offers nothing for an untrusted, shell, unreadable, Connection, low-fidelity,kirocrew-*or wildcard identity and names theconfirm_toolsandconfig.local.jsonrefusals; the tool-list routes add, list and remove one grant, refuse wildcards andkirocrew-*, and refuse non-owner callers.test/test_gate_tiers.py: anauto_approve_tool_identitiesentry@ops/listauto-approves only a verified@ops/listcall (any case); the forged-title shell_FORGED_IDENTITY_SHELL(@ops/listorRunning: @ops/list) and an unproven identity ask;confirm_toolsand an unknown confirm list outrank it; a hand-writtenauto_approve_tools@ops/listkeeps main's title fallback.test/test_hooks.pyis unchanged from main.hook_typesround-trip, heartbeat drop, reload audit andSecurityPanel.configPending.test.tsxcover the new key's plumbing.website/src/pages/overview/McpToolAlwaysAllow.test.tsx(the toggle lives inwebsite/src/pages/overview/McpToolAlwaysAllow.tsx): the toggle turns the exact ref on and off, is disabled with the readable reason on a refusal, and the card's Trust row firesalways_allow_toolwith the server-derived ref or stays disabled with its reason.Proof: not provable -- other: new feature, no prior behaviour to revert to
Manual verification
KAS pod, Normal mode, a local stdio test MCP server under a governance ceiling (so its tools ask): without a grant the call shows a card with identity
notes/lookup_note; with@notes/lookup_notein force the next real turn runs it with no card (SELauto_approved). The pod check of clicking the card's new decision end to end is still pending.Screenshots / video
All six are Component render, not the live page (mocked data,
website/capture/always-allow-tool.tsx).Tool list, off:
Tool list, on (the undo hint shows):
Refused server, toggles disabled with the reason:
Approval card Trust menu, "Always allow this tool" enabled:
Same menu, disabled with its reason:
Failed toggle, inline error:
Related Issues
Part of #34936
builder-security checked: no new listener, bind or port; the three new routes (
GET/POST /api/security/tool-grants,POST /api/security/tool-grants/remove) sit on the existing dashboard listener; both writes and the card decision callrequire_owner_dashboard_request, and the card decision also refuses app tokens, the Crew Mode conductor relay and non-native decides. The grant is checked against server-derived facts only, and it never removes Kiro Crew's own gate.Checklist