Repository navigation
feat(kas): run Settings MCP sign-in through KAS into the owner's grant vault - #27974
bolichen97 wants to merge 2 commits into
Conversation
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS cannot evaluate: the KAS sign-in path was never run against a live engine, and the feature only works if the description's two open questions come out right. BlockersNo live-engine check for a branch only a real KAS engine runs Notes
[DESIGN-REVIEWED] 893b107 Description read[DESCRIPTION-READ] 50a335ed87a6274783b2d941db204d003c23bf9929cc5dcf4fefcf623eac78f1 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader understood the new kept-sign-in line ("a confirmation message", rated sure), and screenshots 1–3 show the before and after states. Notes
[UX-REVIEWED] 893b107 Description read[DESCRIPTION-READ] 3b375db9ff4d037766c338f5655e4d28021aeda097313591f7e62c7b0ba8518f That sha256 names everything this verdict read: the PR description, plus the 6 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 The new path runs only when the owner has turned on Notes
What this change shipsInventory (10 items) — 7 justifiedIntent: On KAS, an owner signs in to a remote OAuth MCP server from Settings and later KAS chats use that sign-in. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 893b107 Description read[DESCRIPTION-READ] 1357ce9956bc9507b491f5c1c38c096b5f854218bb4f2b127a2ce8ab9a370542 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/acp/runtime_spawn_launch.py:1242 -- Warm-pool chats cannot reuse the persisted KAS sign-in
[BLOCK-MERGE] 893b107 Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (fenced): the conditions are ordinary, not rare. A KAS host ( [ADJUDICATION] 893b107 total=0 uphold=0 downgrade=0 [ADJUDICATION-FENCED] 893b107 fenced=1 flagged=0 False positive or not applicable? A repository writer can comment: |
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: |
1bf2269 to
bcb61a9
Compare
The KAS grant vault was gateway-wide and keyed only by MCP server config, so on a gateway with more than one dashboard user a second user's session could reuse the first user's OAuth sign-in. Each engine process is now bound to the one authenticated dashboard user whose request bound the session key it was spawned for, and persisted grants live in a vault per user under kas/mcp-grants/principals/. A process with no single provable user declares no secretStorage and keeps grants in memory. A key driven by a second user, an app, a crew member or a cron is conflicted and never persists again in that gateway process, and a live process re-checks its binding on every persisted request. The old gateway-wide vault is never read. agent.kas_persist_mcp_sign_in stays off by default. Closes #24643
bcb61a9 to
ef348d3
Compare
ef348d3 to
e9e7921
Compare
e9e7921 to
78f2908
Compare
|
[operator: bolichen97] Disposition for the GPT 6.1 Review finding at needs-a-decision
|
|
[operator: bolichen97] Disposition for the Opus 5.5 Review finding at needs-a-decision
|
|
[operator: bolichen97] Disposition for the Design Review blocker "KAS-only path shipped without a live-engine check". needs-a-decision
|
|
[operator: bolichen97] Disposition for the UX Review blocker "The success line contradicts the row's own status". needs-a-decision
|
…t vault On the KAS backend, Settings > MCP > Sign in spawned a kiro-cli mint whose grant landed in kiro-cli's OAuth cache, which no KAS chat reads. The sign-in now runs through a KAS engine spawned for a reserved key bound to the owner, so the tokens the engine stores land in the owner's per-user grant vault and later owner KAS chats connect without asking again. No token passes through Crew and nothing is copied between stores. The path runs only with agent.kas_persist_mcp_sign_in on; with it off the button refuses with kas_sign_in_not_kept and spawns nothing. The row is granted only while the process's vault binding still holds. The consent URL takes the same credential gate as the kiro-cli mint. The mint feed carries store: "kas", and the MCP table says the sign-in was kept because its grant probe reads only kiro-cli's cache. Design note: docs/request-for-change/rfc-kas-settings-mcp-sign-in.md (draft). Refs #24693
78f2908 to
893b107
Compare
|
[operator: bolichen97] Disposition for the GPT 6.1 Review finding at needs-a-decision
|
|
[operator: bolichen97] Closing this draft as superseded: #33737 shipped the same change (a KAS MCP sign-in is saved where KAS chats read it). |
Problem / Motivation
Goal: On the KAS backend, Settings > MCP > Sign in completes a sign-in that later KAS chats use, kept in the owner's per-user grant vault.
On KAS, the Settings Sign in button runs a kiro-cli mint. Its grant lands in kiro-cli's OAuth cache, which a KAS chat never reads. An install moved to KAS by the 0.11 default loses every remote OAuth server's tools, and signing in again from Settings cannot bring them back.
Why it matters
Every owner on KAS with a remote OAuth MCP server is hit. The only fix today is to switch the whole gateway back to the Kiro CLI harness.
Not a goal
agent.kas_persist_mcp_sign_in. This path runs only when the owner has turned it on.What changed (motivation → approach → change)
The grant has to land where a KAS chat reads it, so the sign-in now runs through a KAS engine instead of kiro-cli. Design note:
docs/request-for-change/rfc-kas-settings-mcp-sign-in.md(draft; token flow, which store holds what, per-backend behavior, the relay case, failure modes).src/kiro_crew/dashboard/handlers/connections.py) hands the sign-in to a newsrc/kiro_crew/connections/mint_kas.py, which spawns one KAS engine for a reserved key bound to the owner. That covers an owner-added server and a registry provider whose request says it came from the Settings table (surface: "settings"). It reuses the row table, spec, TTL and cancel paths insrc/kiro_crew/connections/mint.py. The engine process itself lives behind the agent SDK boundary insrc/kiro_crew/agent_sdk/mcp_sign_in.py. The engine stores the tokens in the owner's vault from fix(kas): keep persisted MCP sign-ins per authenticated user #24677. Crew never touches a token.website/src/pages/overview/McpRowSignIn.tsx) says "Signed in. New Kiro Agent chats use this sign-in.", and the table (website/src/pages/overview/McpTab.tsx) shows that row's status badge as Signed in for the rest of the page's life, because the probe behind the badge cannot see the vault. The mint state type (website/src/api/client/connections.ts) gainsstore, and the new line is in all 13 catalogs underwebsite/src/i18n/locales/.Backwards compatibility
Compatible: nothing changes unless the owner is on KAS with
agent.kas_persist_mcp_sign_inon. Every other install, the default included, keeps today's kiro-cli mint. The mint feed gains one optional field,store.Removes nothing: no route, key, field or reader is removed; existing mint suites pin the kiro-cli path explicitly because a data home with no backend choice now resolves to KAS.
Tests
test/test_connections_mint_kas.py: a Settings sign-in on KAS is readable by a new owner session's vault server and not by another user's; only KAS with persistence on takes the KAS path; persistence turned off mid-flight spawns nothing; no declared storage fails closed; a binding lost before completion is not reported granted; a credential-bearing consent link is never published; an unreported server releases the process; Cancel releases the process and its spec; a dead engine is expired and released without a poll; the route picks KAS only for the Settings table, never for a card; the state poll names the KAS store; an unreadable config keeps the kiro-cli path. The engine is a scripted stand-in, but the storage decision and the vault are the real code.website/src/test/McpRowSignIn.test.tsx: a granted KAS row the probe cannot see says the sign-in was kept; one the probe can see falls back to the row badge.website/src/test/McpTab.kasKept.test.tsx: after a kept sign-in the row shows one status (badge Signed in, no Sign-in required); a sign-in that did not go to the vault leaves the probe's badge.-n0, 10/10 at-n 4 --dist loadgroupwith two mint suites as co-tenants, shuffled order (seed 32552) green; row component file 20/20 and shuffled (seed 32552) green.Manual verification
Not run against a live KAS engine: this host has no KAS sign-in and no OAuth MCP server to drive. Two items in the design note's open questions need that run before this leaves draft: that the engine's OAuth redirect is a loopback listener in its own process (the remote-gateway paste relay depends on it), and that an owner chat's projected server entry hashes to the same vault key as the mint's single-server spec.
Screenshots / video
The real
McpTabfromsrc/, mounted in a local capture page with a stubbed network: the mint feed answersgrantedwithstore: "kas"and the probe still sees no kiro-cli grant, which is what a KAS sign-in looks like to this table. The row shows one status: the badge reads Signed in and the line beside it says the sign-in was kept. After a reload the badge goes back to the probe's reading.After a KAS sign-in, dark:
After a KAS sign-in, light:
Before the click (unchanged)
Related Issues
Refs #24693
Depends on #24677
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)