Repository navigation
fix(mcp-gateway): never pool a credential vendor - #24672
Conversation
creds-agent and local-creds-agent-mcp join UNPOOLABLE_SERVERS, so the rewriter leaves them unwrapped and the dashboard reports them as can_stub: false. A single toggle, a bulk "Enable all" and the batch stub endpoint therefore all refuse them. Each chat's own copy of a credential vendor runs inside that chat's sandbox, which hides the credential directories and the ~/.aws profile files (sandbox_tiers). A shared backend is spawned by gatewayd outside every sandbox. Sharing one would hand every chat a vendor that can read what its own sandbox withholds. Comments that described the set as empty now say it lists only the credential vendors.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this only narrows what gets pooled. Every reader checks the same Notes
[DESIGN-REVIEWED] ec24bf6 Description read[DESCRIPTION-READ] 4e8a2110282ee6c86c90e648f488c04eaef0b4a9b745996cb192dcd93686efa2 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. The PR fixes a real sandbox-bypass defect, and tests that fail on base back it up. The one gap is the claim that every reader goes through one predicate: the diff adds a second spelling, and five sites still test the set directly. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: stop anyone from sharing a credential-vending MCP server across chats, so it always runs inside each chat's own sandbox. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] ec24bf6 Description read[DESCRIPTION-READ] e9da9cce5b400ccb5a2dcd09efd927d6ddde03a85d30207d8ef532acf82df495 That sha256 names the PR description this verdict read. 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: |
|
Re GPT 6.1 BLOCK on 1e7273d (kept overlay keeps a pooled vendor): real, fixed in bbf08e1.
|
|
Re GPT 6.1 BLOCK on bbf08e1 (a failed regeneration keeps an overlay that still holds a vendor stub; its verdict was withheld from this thread, read from the run artifact): real, fixed in e2a7802. The rewriter was the only place the denylist was applied. Every reader now asks the same
Other spawn paths checked: |
e2a7802 to
482bc11
Compare
The rewriter applies UNPOOLABLE_SERVERS while it writes an overlay, but an overlay, env sidecar or approval written before the vendors were listed (or kept by a failed regeneration) could still pool one. - _FINGERPRINT_SCHEMA 10 -> 11. The denylist is not a fingerprint input, so a kept overlay from before it (same version, unchanged inputs) would keep the vendor's stub; the bump rebuilds every kept overlay. - Every reader asks the same rewriter_spec.is_unpoolable (name or alias): pooled_session_servers and injection_server_names skip a vendor's stub, so a session resolves it from its agent spec, inside its own sandbox; filter_target_env drops a vendor's KIROCREW_MCP_TARGET_* entry before it becomes gatewayd's env, without recording a refusal; and LaunchApprovals.admits_launch, the check gatewayd runs before it spawns a backend, refuses a vendor whatever its recorded approval. Tests: a schema 10 overlay that pooled creds-agent is rebuilt unwrapped; a stale overlay that still holds a vendor stub injects nothing for it; a recorded approval admits an ordinary server but not a vendor, in the target filter or admits_launch. Each fails without its fix.
482bc11 to
ec24bf6
Compare
|
Holding ec24bf6 for human review because it changes how credential vendors run and what gatewayd may launch outside the chat sandbox. I found no defect. The change only narrows pooling: For the human reviewer:
— crew-pr-reviewer (r128) |
Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593)
Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593)
Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593)
Parts 2 and 3 of the 0.11.0 list, combined after part 3 (#25666) was merged into part 2's branch. Cherry-picks these main commits onto release/0.11.0, in merge order: - fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922) (cherry picked from commit 99c2474) - fix(crew): list a crewmate's own script and command schedules (#24023) (cherry picked from commit d2d8d14) - fix(mcp-gateway): show a refused share outside Developer Mode (#23917) (cherry picked from commit c612613) - fix(apps): negative-cache failed app.json fetches in the store listing (#23925) (cherry picked from commit 455e8ec) - fix(power): say that Windows Modern Standby can still sleep on lock (#18259) (cherry picked from commit 0480058) - fix(chat): show nothing in the transcript when the context cap trims (#24492) (cherry picked from commit 1411fcc) - fix(frontend): seed settings rows from the served config during render (#24625) (cherry picked from commit e198b63) - fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632) (cherry picked from commit 9f51b91) - feat(website): swipe to dismiss the notification banner on mobile (#24674) (cherry picked from commit e4fad39) - fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645) (cherry picked from commit 1f28708) - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593)
Backports parts 2-4 of the 0.11.0 insider list (#25665, #25666, #25667) onto release/0.11.0. Parts 0-1 landed in e379f74 (#25663, #25664). - fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922) (cherry picked from commit 99c2474) - fix(crew): list a crewmate's own script and command schedules (#24023) (cherry picked from commit d2d8d14) - fix(mcp-gateway): show a refused share outside Developer Mode (#23917) (cherry picked from commit c612613) - fix(apps): negative-cache failed app.json fetches in the store listing (#23925) (cherry picked from commit 455e8ec) - fix(power): say that Windows Modern Standby can still sleep on lock (#18259) (cherry picked from commit 0480058) - fix(chat): show nothing in the transcript when the context cap trims (#24492) (cherry picked from commit 1411fcc) - fix(frontend): seed settings rows from the served config during render (#24625) (cherry picked from commit e198b63) - fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632) (cherry picked from commit 9f51b91) - feat(website): swipe to dismiss the notification banner on mobile (#24674) (cherry picked from commit e4fad39) - fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645) (cherry picked from commit 1f28708) - fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069) (cherry picked from commit f9d8e19) - fix(mcp-gateway): never pool a credential vendor (#24672) (cherry picked from commit 2464225) - fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297) (cherry picked from commit ddc1fea) - fix(crew): move a working icon avatar as one still image so it cannot tear (#24678) (cherry picked from commit e062153) - fix(crew-mode): keep a crewmate's own chat on the conductor (#24894) (cherry picked from commit 7582829) - fix(memory): name a damaged memory.db instead of restore advice (#24567) (cherry picked from commit efe7624) - fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563) (cherry picked from commit 686d39a) - fix(discord): re-admit bot-opened threads after a gateway restart (#21776) (cherry picked from commit 072a37b) - fix(web): keep a hidden model hidden after a harness switch respells its id (#24564) (cherry picked from commit 501f455) - fix(gateway): say the gateway is running once boot finishes (#25029) (cherry picked from commit 02627ec) - fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572) (cherry picked from commit ed75593) - fix(mcp-gateway): render a refused share through ErrorNotice (#25660) (cherry picked from commit d895a90) - fix(crew): write a crewmate's hidden welcome and check-ins in the user's language (#24966) (cherry picked from commit d5a76e6) - feat(crew-mode): move every used crewmate to its conductor on upgrade (#24954) (cherry picked from commit 76e89ae) - fix(hooks): Reads mode auto-approves Kiro Crew's own read-only MCP tools (#24910) (cherry picked from commit d8f2038) - fix(members): list crewmates the person created, even with an empty chat (#24987) (cherry picked from commit 163652b) - feat(cron): let a script cron feed its crewmate's Dashboard page (#24692) (cherry picked from commit 959b35a) - fix(kas): honour a server's autoApprove through the derived permissions (#25106) (cherry picked from commit 073c83a) - fix(chat): keep a scrolled-up reader still when a reprice clamps them (#24591) (cherry picked from commit 9a73292) - fix(security): restore every allowed link on a host, not only identical ones (#20487) (cherry picked from commit b161144) - fix(website): swipe the mobile notification banner up to dismiss it (#25151) (cherry picked from commit e68a716) - test: carry the _card_outcomes helper #24910's tests read (cherry picked from commit 9df4d01) The #24987 decision entry is new on this branch, so its Evidence lines now link the owner restatement and the maintainer approval on #24987 instead of describing them. Main keeps its shipped (immutable) copy.
Problem / Motivation
Goal: A credential-vending MCP server is never shared across chats, by any path.
On
main, nothing stops it.UNPOOLABLE_SERVERSinsrc/kiro_crew/mcp_gateway/rewriter_spec.pyis empty, so every stdio server reportscan_stub: true(mcp_gateway_routes.py:can_stub = is_stdio and not denylisted). No other check knows what a credential vendor is: the shareability assessment only withholds a share for declared env names with theAWS_SECRET,AWS_SESSIONorOAUTHprefixes, and the page's bulk "share all" picks everycan_stub && !stubrow. So a single toggle or a bulk press can putcreds-agentbehind one shared backend.Why it matters
It bypasses the chat sandbox:
~/.awsprofile files (sandbox_tiers.py).gatewaydoutside every sandbox, as the user (docs/architecture/mcp.md: "The sandbox is not applied to a pooled backend at all").This is a gap on
maintoday, not something a pending PR introduces. #19661 makes sharing one click, which is why it should close first.Not a goal
What changed (motivation → approach → change)
UNPOOLABLE_SERVERS={"creds-agent", "local-creds-agent-mcp"}, with the reason next to it. The rewriter leaves them unwrapped, the servers endpoint reportsdenylisted: true, can_stub: false, and the batch stub endpoint skips them ascannot_stub. The existing denylist plumbing does the rest; no new path._FINGERPRINT_SCHEMA10 → 11, so kept overlays regenerate with the denylist applied.rewriter_spec.is_unpoolable:pooled_session_serversandinjection_server_namesskip a vendor stub,filter_target_envdrops its target, andLaunchApprovals.admits_launch(the check gatewayd runs before a spawn) refuses it whatever its recorded approval. So an overlay, sidecar or approval written before this change, or kept by a failed regeneration, cannot pool a vendor.Security
Narrows only. A listed server keeps running once per chat, inside that chat's sandbox, exactly as it does when it is not in
mcp_gateway.stub_servers.Backwards compatibility
An install that listed either name in
mcp_gateway.stub_serverskeeps the entry, but the rewriter no longer wraps it: from the next overlay regeneration each chat runs its own copy again, and the dashboard row shows it as not shareable. No config migration is needed.Tests
test/test_handlers_mcp_coverage_gateway_servers.py: for both names, against the live set (not patched), the servers endpoint reportsdenylistedandcan_stub: falseeven when the operator lists the server, and_stub_eligibilityskips it ascannot_stubeven when the assessment says share.test/test_mcp_gateway_rewriter_fingerprint.py: a schema 10 overlay that pooledcreds-agentis rebuilt on the next pass with unchanged inputs and leaves it unwrapped (_FINGERPRINT_SCHEMAis now 11, because the denylist is not a fingerprint input).test/test_mcp_gateway_session_inject.py,test/test_mcp_launch_approval_store_records.py: a stale overlay with a vendor stub injects nothing for it; a recorded approval admits an ordinary server but not a vendor, in the target filter oradmits_launch.rewriter_spec.pyrestored, all 4 denylist cases fail; with the schema left at 10, the overlay test fails.Manual verification
Not run on a live gateway. What was not measured: whether a per-chat
creds-agentcan vend inside a sandboxed chat on this host (that needs a signed-in chat in a pod with a working OS sandbox).Related Issues
Found while reviewing #19661 (one-click MCP sharing).
Pattern harvest
Rule candidate: a server whose job is to hand out what the chat sandbox withholds (a credential vendor) is never pooled, because a shared backend runs outside every sandbox; exclude it by name until there is a capability-based refusal.
Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.