Skip to content

feat: let one MCP tool be always allowed from its tool list or approval card - #35002

Merged
buluoray merged 1 commit into
mainfrom
crew/slack/kas-always-allow-tool
Nov 14, 2026
Merged

buluoray merged 1 commit into
mainfrom
crew/slack/kas-always-allow-tool

Conversation

@buluoray

@buluoray buluoray commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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)

Surface What the user sees
Customize -> Connections -> MCP Servers, a server's tool list An Always allow toggle beside each tool. On: that tool stops asking. Off: it asks again. When the grant cannot be given, the toggles are disabled and one line above the list says why.
Approval card, Trust menu Always allow this tool: approves this call and stops asking for that tool. Disabled with the same reason when it cannot be given.

Both write the same thing: an @server/tool entry in a new list, hooks.auto_approve_tool_identities, that only these two surfaces write. The gate's operator-grants tier 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/tool still asks. Hand-written hooks.auto_approve_tools entries 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 and confirm_tools, so the floors still win; KAS's own allow-always and permissions.yaml are 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 a hooks.confirm_tools pattern covers ("asks every time"), or while config.local.json sets the list. The card grants only the @server/tool the 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) and config.md (which writes wait for the watcher).

The new key is plumbed through hook_runtime/gate_tiers.py and hook_runtime/hook_types.py (HooksConfig), hooks.py (reload audit), config/loosening_provenance.py (security keys), config/loader_config.py (confirm_tools help), agent_materialization/kiro_hooks.py (stripped from specs) and slack/gateway_runtime/tool_policy.py (heartbeat). The grant query refreshes on config change and reconnect through website/src/hooks/websocket/serverState.ts, pinned in website/src/test/useWebSocket.frameTrace.test.ts and website/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.py and chat_turn/tool_approval.py (card fields), connections/crew_oauth_proxy.py (serves_connection); frontend McpToolAlwaysAllow.tsx in website/src/pages/overview/McpTab.tsx, TrustDropdown.tsx, chat-input/approval.ts, ChatInput.tsx, api/client/mcp.ts, utils/toolGrantRefusal.ts; strings in website/src/i18n/locales/en.manual.json and every shipped locale (en-XA.json regenerated).

Backwards compatibility

Compatible: hooks.auto_approve_tool_identities is 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.py is unchanged from main). The heartbeat path drops the new list as it drops auto_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-time confirm_tools match grant nothing; the card offers nothing for an untrusted, shell, unreadable, Connection, low-fidelity, kirocrew-* or wildcard identity and names the confirm_tools and config.local.json refusals; the tool-list routes add, list and remove one grant, refuse wildcards and kirocrew-*, and refuse non-owner callers.
  • test/test_gate_tiers.py: an auto_approve_tool_identities entry @ops/list auto-approves only a verified @ops/list call (any case); the forged-title shell _FORGED_IDENTITY_SHELL (@ops/list or Running: @ops/list) and an unproven identity ask; confirm_tools and an unknown confirm list outrank it; a hand-written auto_approve_tools @ops/list keeps main's title fallback. test/test_hooks.py is unchanged from main.
  • hook_types round-trip, heartbeat drop, reload audit and SecurityPanel.configPending.test.tsx cover the new key's plumbing.
  • website/src/pages/overview/McpToolAlwaysAllow.test.tsx (the toggle lives in website/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 fires always_allow_tool with 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_note in force the next real turn runs it with no card (SEL auto_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:

toggle off

Tool list, on (the undo hint shows):

toggle on

Refused server, toggles disabled with the reason:

refused

Approval card Trust menu, "Always allow this tool" enabled:

card menu

Same menu, disabled with its reason:

card menu refused

Failed toggle, inline error:

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 call require_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

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 11, 2026 02:22
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 5d3dfe72a9930d5915037659ff8e0b71c52ca35d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 confirm_tools, and rendered evidence of this revision is attached.

Notes

  • server_is_crew_owned says a Connection is known only while a session holds its bridge, so the MCP tab can write a grant for a Connection's server. The card refuses that grant on every call and the Connection's gateway proxy still asks, so this is reversible. Track the "upgrade when Connections are known without a live bridge" follow-up as an issue.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 5d3dfe72a9930d5915037659ff8e0b71c52ca35d — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Each item answers the reported harm: a hand-edited permissions.yaml that skips the gate, or a session-wide Trust that approves every tool. Every new route and key has a counted consumer.

Notes

  • Item 3 — inherited: a second grant list, hooks.auto_approve_tool_identities, sits beside auto_approve_tools. The existing _tier_operator_grants already matches @server/tool against a verified identity (grant_targets = (f"Running: {identity_ref}", identity_ref)). The new list differs only by ignoring the title fallback and globs. Subtraction: make @-prefixed auto_approve_tools entries identity-only and write the card's grant there, which deletes the new key from hook_types, loosening_provenance, kiro_hooks, tool_policy and SecurityPanelConfigPending. This is kept as a note because the docstring records the title fallback as deliberate ("falls back to the title, exactly as before").

What this change ships

Inventory (7 items) — 6 justified

Intent: let a user stop approval prompts for one MCP tool, and turn them back on, with one click and no file edit. ADDITION.

  1. An Always allow toggle beside each tool in the MCP Servers tool list — justified
  2. A new "Always allow this tool" entry in the approval card's Trust menu, which approves the call and grants the tool — justified
  3. A new config key, hooks.auto_approve_tool_identities, matched only against a verified identity — inherited: it overlaps auto_approve_tools's identity matching
  4. Three owner-only routes under /api/security/tool-grants, each used by api/client/mcp.ts — justified
  5. The control is disabled with a reason for kirocrew-*, app-declared and Connection servers, servers confirm_tools covers, and when config.local.json sets the list — justified
  6. The grant list refreshes after a config change or a reconnect (serverState.ts) — justified
  7. Config Pending lists the new key as a security widening — justified

[FIRST-PRINCIPLES-REVIEWED] 5d3dfe7

Description read

[DESCRIPTION-READ] 57015bbeb8f01e65d9500f0bfd787861c44b6f09e4c32949a2ab0f9ea297862b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 5d3dfe72a9930d5915037659ff8e0b71c52ca35d — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • always_allow_refused_asks_every_time: the blind reader said "'Your settings' doesn't say which settings or where to find them". The string should name the setting and where to change it, so the user can act on the refusal.
  • McpToolAlwaysAllow: when the toggle is refused, only the switch dims and the "Always allow" text stays at full strength. The blind reader said "the label stays bright… so it still looks usable". Dim the label as well, e.g. opacity-60 when refused.
  • All six shots are mock components with a description line that McpTab never renders. Add one shot of the real MCP tool row so the placement can be judged: the toggle sits right after the tool-name button, which itself disables the tool when clicked.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 5d3dfe72a9930d5915037659ff8e0b71c52ca35d — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5d3dfe7

Verdict parsed from the review's SHA-scoped output markers for commit 5d3dfe72a9930d5915037659ff8e0b71c52ca35d.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5d3dfe72a9930d5915037659ff8e0b71c52ca35d false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 5d3dfe72a9930d5915037659ff8e0b71c52ca35d and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5d3dfe7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5d3dfe72a9930d5915037659ff8e0b71c52ca35d false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
@buluoray
buluoray enabled auto-merge (squash) November 11, 2026 18:47
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from dd787ef to 9375734 Compare November 14, 2026 02:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 14, 2026
@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from 9375734 to 002e3df Compare November 14, 2026 03:11
@buluoray

Copy link
Copy Markdown
Contributor Author

span=52875fed6045

Disposition: fixed

fixed in 002e3df: _tier_operator_grants now matches a pattern starting with @ (after a Running: prefix) only against a verified identity, never call.title / facts.normalized. A shell call whose description reads @server/tool now asks.
Regression: test_gate_tiers.py scenarios fall-through-32..34 fail with the check reverted. test_hooks.py asserts that encoded the old title match now expect TOOL_ALLOW.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=81a4563c0b37

Disposition: fixed

fixed in 002e3df: the card's always_allow_tool success, config-change refresh and WebSocket reconnect each invalidate the mcp-tool-grants prefix, so the toggle never shows OFF for a grant in force.
Regression: McpToolAlwaysAllow.test.tsx covers card, config refresh and reconnect.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=81a4563c0b37

Disposition: fixed

fixed in 002e3df: while config.local.json sets the list the toggle offers no revoke, and api_tool_grant_remove returns 409 set_elsewhere before any write, so a removal can no longer report success while the overlay keeps the grant.
Regression: test_always_allow_tool.py asserts the 409 and an unchanged config file; a base grant stays removable.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=81a4563c0b37

Disposition: fixed

fixed in 002e3df: the grant-list query error and the mutation error render through ErrorNotice with the MCP tab's existing hand-off, keeping staged MCP edits when any are pending.
Regression: McpToolAlwaysAllow.test.tsx covers both errors with and without staged edits.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=e239c2de8747

Disposition: fixed

fixed in 002e3df: the MCP Servers row of docs/feature-map/README.md now names the Always allow toggle, McpToolAlwaysAllow.tsx, handlers/security_tool_grants.py and the /api/security/tool-grants routes.
scripts/check_feature_map.py passes.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/hook_runtime/gate_tiers.py

  • src/kiro_crew/hook_runtime/hook_types.py

  • src/kiro_crew/hooks.py

  • @bolichen97 approved 5d3dfe7 with a complete reasoning template.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does 5d3dfe72a9930d5915037659ff8e0b71c52ca35d newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 11 classified, 0 newly refused, 11 still allowed.
  • ubuntu-latest (platform posix): 11 classified, 0 newly refused, 11 still allowed.
  • windows-latest (platform windows): 9 classified, 0 newly refused, 9 still allowed.

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 (sensitive-bash, exfil, deny-rules). So no candidate is expected to flip from allowed to refused, and no regression has been confirmed. Its stricter parts are refusals on a new dashboard grant surface, the heartbeat hooks dropping the new list, and the gate never matching a grant against a title. None of those are shell-classifiable, so they are named under UNADJUDICATED below.

TIGHTENING: operator-grants tier matching for the new hooks.auto_approve_tool_identities list. It refuses one threat: a shell call whose model-written description reads @server/tool winning a per-tool grant. The hunk in src/kiro_crew/hook_runtime/gate_tiers.py: if identity_ref and any(grant.lower() == identity_ref.lower() for grant in facts.config.auto_approve_tool_identities): return ToolHookResult.auto_approve(identity_grant=True). The matching docstring says "never the title: a shell call's title can be the model's own description, so one reading @ops/list must not win that grant."

ADJUDICATED: 15 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: I wrote candidates for posix, windows and any.

  • posix: .venv/bin/python test runs, jq reads of ~/.kirocrew/config.json, curl against the new local /api/security/tool-grants route, and the capture script.
  • windows: .venv\Scripts\python.exe with \ test paths, %USERPROFILE%\…\config.json under cmd, PowerShell $env:USERPROFILE with Get-Content | ConvertFrom-Json, and curl.exe.
  • any: git diff/git grep, kirocrew config get, npx vitest, npx tsc.

The only platform assumption the diff makes is that / and \ stay distinct in a grant ref; the patch's test checks this under ntpath.normcase. That is a gate-side comparison, not shell text, so no shell row can probe it. Every shell spelling near the touched area is covered on both hosts.

UNADJUDICATED:

  • always_allow_tool.tool_ref / is_tool_grant / server_is_crew_owned / server_refusal. Call path: POST /api/security/tool-grants → handlers/tool_grants.api_tool_grant_add → _ref_from_body → refusal_for, and the card's action: always_allow_tool → slot_approval.api_chat_slot_approve → grant_from_card. These refuse:

    • a server or tool name holding /, *, ?, [, leading or trailing whitespace, or control characters;
    • any kirocrew-* server, compared case-insensitively;
    • a server a shipped app declares;
    • any server a live Connection bridge serves for any session (serves_connection).

    Legitimate inputs I would have submitted:

    • a third-party MCP server legitimately named kirocrew-community-tools, which would be refused as crew_owned;
    • a tool named search[beta] or list* that a server really exposes;
    • a user's own MCP server that shares its name with a Connection bridge another session holds.

    This surface is new, so nothing that used to work is lost. These are refusals of the new grant, not regressions.

  • slack/gateway_runtime/tool_policy._build_heartbeat_hooks. Path: heartbeat on_tool_call. It drops auto_approve_tool_identities, so a heartbeat call to @notes/lookup that the user granted with Always allow still asks. That matches how auto_approve_tools is already dropped there. It is not a shell command, so no verdict is possible.

  • gate_tiers._tier_operator_grants identity-only matching. Path: any tool call → gate → operator-grants. An entry in the new list never matches a title or an unverified identity, so an MCP call whose identity is present but unproven still asks even when its @server/tool is granted. This is the intended threat refusal, with nothing legitimate lost compared with base: the list is new, and existing auto_approve_tools entries keep the title fallback, as the patch's _FORGED_IDENTITY_SHELL scenario shows.

  • agent_materialization/kiro_hooks._INTERNAL_HOOK_KEYS. Path: hook-spec generation. A hooks key named auto_approve_tool_identities is no longer emitted as a kiro-cli hook event. No real kiro-cli event has that name.

[SCOPE-REVIEWED] 5d3dfe7

@KiroCrewCaptain

KiroCrewCaptain commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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 5d3dfe72a9 · 1963 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 14, 2026
@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from 5cba2c7 to 0cec0dc Compare November 14, 2026 08:55
@buluoray

Copy link
Copy Markdown
Contributor Author

span=5c7fc75e7f0d

Disposition: fixed

fixed in 0cec0dc: hooks.auto_approve_tool_identities is now matched by case-insensitive literal equality against the verified identity_ref (grant.lower() == identity_ref.lower()), never fnmatch, so no glob or /-vs-\ normalization applies; auto_approve_tools and _tool_matches are unchanged.
Regression: test_gate_tiers.py::test_identity_grants_match_only_literal_refs (@ops/*, @ops/lis?, @ops/[l]ist do not approve list; @OPS/List does) and a Windows-normalization case (@notes/read\item does not approve verified @notes/read/item); 5 red before, green after.

@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from 0cec0dc to 96b0eac Compare November 14, 2026 09:54
@buluoray

Copy link
Copy Markdown
Contributor Author

span=f28364d8feb2

Disposition: fixed

fixed in 96b0eac: security.md now says that when the identity is unproven every auto_approve_tools pattern, identity spellings included, falls back to the title match as on main (the maintainer asked to keep that), and only a hooks.auto_approve_tool_identities entry never matches a title. The spec now matches _tier_operator_grants and test_gate_tiers.py.
Swept the other docs and docstrings this PR touches (memory-skills-hooks.md, config.md, gate_tiers.py, always_allow_tool.py, loader_config.py): no other copy of the stale claim. No code change.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 14, 2026
@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from 96b0eac to e6ef2cf Compare November 14, 2026 11:15
bolichen97
bolichen97 previously approved these changes Nov 14, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

@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: git diff e6ef2cf5444173d7e2b3f584409f89d0bdb7e4db cd19355c9c61ab375ca90abac0f5084eb4c2fdb4 is that one line. Could you re-approve cd19355?

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
@buluoray
buluoray force-pushed the crew/slack/kas-always-allow-tool branch from cd19355 to 5d3dfe7 Compare November 14, 2026 12:43
@buluoray

Copy link
Copy Markdown
Contributor Author

span=95b1d37e64c4

Disposition: fixed

fixed in 5d3dfe7: the auto_approve_changed record's size= is now len(_grants(after)), the same tool-plus-identity set that added / removed count, still counts only; config.md says so.
Regression: test_services_config_hot_reload.py::test_a_new_tool_identity_grant_is_sel_audited_by_count asserts added=1 removed=0 size=2 (one tool grant plus one identity grant); red before (size=1), green after.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 14, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

A maintainer's review on this PR already accepted the design, with the grants kept in their own hooks.auto_approve_tool_identities list. The approval on an earlier head was dismissed when new commits were pushed, so the PR now waits for a maintainer approval on this head. This change widens what the approval gate allows without a prompt. That decision stays with the maintainer and the security reviewer.

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 new grant list is matched only by literal, case-insensitive equality against a verified MCP identity.
  • That match runs after every deny tier, after governance and after confirm_tools.
  • auto_approve_tools behaves as it does on main.

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 @server/tool ref the server stamped on the pending approval. The client's pattern is used only to prove it is the same card, so a client cannot choose what gets granted.

For the security review:

  • All three write routes are owner-only and write through update_config_locked. The new key is in _CONFIG_SECURITY_KEYS, so an agent's direct edit to it is held the same way as an edit to auto_approve_tools.
  • The card decision refuses app tokens, Crew Mode relays and non-strict decides before any write.
  • No test fails if the app-declared server and Connection-bridge refusals in server_is_crew_owned are deleted. The same is true for the card route's from_app / delegated refusal and the owner check on the remove route.
  • A grant for a tool that is later disabled, unprobed or uninstalled stays in config, but no control shows it. If a server with the same name is installed again, the grant applies again with no new consent.

Optional:

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 5d3dfe7. The change I asked for on 6b8346c is in place, so I'm approving.

  • _tier_operator_grants no longer skips @-patterns on the title fallback. hooks.auto_approve_tools matches exactly as on main, and test/test_hooks.py is no longer changed, so main's assertions (an unproven Running: @memory-mcp/search_memory and 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 never auto_approve_tools. The gate matches it only by case-insensitive literal equality against the verified identity_ref, after _operator_confirms and every deny tier, so a shell call whose description reads @ops/list gets 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_identities list of exact @server/tool grants, written only by the owner-gated approval card ("Always allow this tool") and the MCP tool list toggle. The operator-grants tier approves a call from it only when the call's verified MCP identity equals an entry. hooks.auto_approve_tools matching 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, a confirm_tools match, 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.py pins the forged-title shell call against the new list, and test/test_always_allow_tool.py pins 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 []. Existing auto_approve_tools entries match as on main, and test/test_hooks.py is 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_identities entries left in config.json are then ignored, and calls ask again.

Auto-merge is left as you set it.

@buluoray
buluoray merged commit 515f704 into main Nov 14, 2026
112 of 114 checks passed
@buluoray
buluoray deleted the crew/slack/kas-always-allow-tool branch November 14, 2026 23:26
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 14, 2026
buluoray added a commit that referenced this pull request Nov 15, 2026
…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)
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.

3 participants