Skip to content

feat(connections): crew-owned oauth for the slack mcp server - #34811

Merged
buluoray merged 1 commit into
mainfrom
crew/slack/crew-oauth-slack
Nov 16, 2026
Merged

buluoray merged 1 commit into
mainfrom
crew/slack/crew-oauth-slack

Conversation

@buluoray

@buluoray buluoray commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A user can sign in to Slack's hosted MCP server from Kiro Crew on KAS and every other bridged harness, with Kiro Crew holding the Slack token. The Slack app's Client ID and Client Secret are entered once under Settings → OAuth Apps; an existing Slack user adds the client secret there once.

Slack's MCP server (https://mcp.slack.com/mcp) has no dynamic client registration, so the harness must present a pre-registered client. KAS drops a server's oauth block, so a Slack entry with its own oauth.clientId never signs in on KAS (#34747, #27711). Slack's user-token consent page was also missing from the banner allowlist, so even kiro-cli's sign-in failed closed with "URL contained credential or exfiltration pattern" (#11895).

Why it matters

Slack is one of the most asked-for connections, and KAS is the default harness. On main, a KAS user can sign in to Slack only by adding the server by hand through the MCP Servers custom-server form with the crew_oauth preview on, where Kiro Crew's owner-server path signs it in. This PR adds the Slack card for users who set up a Slack app on the card itself; a hand-added Slack server keeps the owner-server path, as the RFC's "Cards first" rule and its Slack exception record.

Not a goal

  • Turning dashboard.feature_previews.crew_oauth on by default.
  • HubSpot, Box or other non-DCR providers.
  • Bot-token Slack scopes (Slack forbids them on a desktop redirect).
  • Changing how kiro-cli signs in when the preview is off.

What changed (motivation → approach → change)

Slack refuses DCR, so it joins the Connections registry as a pre-registered provider, and Crew's own sign-in (RFC Crew-owned OAuth, already shipped for GitHub, Asana and Google) serves it behind the same preview. The client comes from Settings → OAuth Apps, with its secret, and Crew reads it from the vault.

Slack's client is never written into a file. The eight other pre-registered providers have their client projected into the agent spec so that kiro-cli can sign in. Slack is exempt. So the Slack card connects only where Kiro Crew does the sign-in itself: the crew_oauth preview on and chats on a bridged harness. With the preview off (the default) the Slack card does not connect; it shows a link to the setting instead of Connect. main has no Slack card, so no user loses anything. A Kiro CLI session signs in to Slack with the client in its own slack entry, as on main. The card serving Kiro CLI is a later change: #35949.

Part Change
Registry (connections/registry.json) A Slack entry with a secret (confidential: true), redirect http://localhost:48106/callback (the port its runbook already reserves; localhost is the only plain-http host Slack accepts), read-only user scopes
Crew sign-in (connections/crew_oauth.py) Endpoints from Slack's own authorization-server metadata; the token requests post the secret (client_secret_post) and the PKCE verifier; invalid_refresh_token asks for a reconnect; Disconnect calls auth.revoke and reads revoked from the 200 body
Card (pages/connections/registry.ts) A row belongs to a provider's card at the registry URL, a trailing slash or letter case aside, as on main. While no Slack app is saved under Settings → OAuth Apps, the gateway marks a slack row connectionUnconfigured (dashboard/handlers/mcp_probe.py) and the MCP Servers table leaves that row to its own chat guidance, where the client the user wrote signs in on Kiro CLI (and on any backend while the crew_oauth preview is off). The Connections card still owns the row (serverForConnection), so a grant held from before the record was removed still shows Connected with Disconnect; GitHub rows are unchanged
Banner allowlist (security/exfil_oauth.py) The exact pair ("slack.com", "/oauth/v2_user/authorize")
No projection for Slack (connections/oauth_clients.py, default_spec_commit.py, connections/warm.py, dashboard/handlers/connections.py) oauth_clients.keeps_user_client("slack") is true: the operator's Slack Client ID and Client Secret are written into no file. Not into kirocrew.json or any other spec in the Kiro agents folder (the rebuild returns a slack entry untouched), not into a kirocrew-mint-slack-*.json (the mint route answers 409 crew_sign_in_required unless Crew's own sign-in serves Slack, so no kiro-cli Connect starts), not into the warm sign-in helper's specs under <data home>/run/connections-warm/ (the helper leaves Slack out), and not into any mcp.json
User-written Slack entries (mcp_config_entries.py, mcp_config_purge.py) Every client on a slack entry is therefore one the user wrote. The scope copy and the scrub that runs when the OAuth Apps record changes skip Slack (oauth_clients.projected_provider_for_server), so the entry is handled as on main, where slack is not a provider: nothing is stripped, nothing is rewritten. The strip itself and its eight providers are back to main's code
Card state (connections/status.py, ConnectionsPageCard.tsx) While Crew is not doing the sign-in the status row carries needsCrewSignIn and the card shows Needs configuration with Turn on Kiro Crew sign-in, a link to that switch under Settings → Feature previews. Its tip gives the two steps: turn on Kiro Crew sign-in with the button, and in Settings (a link to /settings/agent) set chats to run on Kiro Agent. When the user's own slack entry keeps its own sign-in (crewSignInNotOwned), the card shows a neutral Managed in MCP Servers badge and one line that links to MCP Servers. The text names no config key. The strings are in all 12 languages
MCP Servers row (mcp_probe.py, McpTab.tsx) A marked row whose chat sign-in cannot start carries connectionNeedsApp: the entry names no client of its own, or Crew signs in for it and no Slack app is saved. The row then says Slack needs its OAuth app and links to the Slack card under Settings → Connections (Set up Slack), instead of sending the user to chat. A row whose Slack app is saved while Crew's sign-in is not live carries connectionNeedsCrewSignIn and shows the card's two steps and links instead of Sign in, whose mint would only answer 409. One new string, in all 12 languages
Rebase onto #34353 main moved the OAuth apps onto the Connections cards (Settings → Connections, Set up opens the app in place). This PR's card, row link, strings and docs follow that layout; the screenshots below predate it, except where a caption says otherwise
Copy The Slack card's tip (prerequisite_slack in website/src/i18n/locales/*.json, 12 locales) and the Slack runbook say the Client Secret is required; the tip, like GitHub's, ends at the consent page, and the PKCE and MCP server setup stays in the runbook

The settings index (settingsRegistry.gen.ts, settings-registry.generated.json) and the UI index (ui-index.generated.json) are regenerated for the new Slack OAuth Apps card, and .github/black-baseline.txt drops test_connections_registry.py, which is now black-clean. Docs: docs/system-specs/modules/connections.md, the RFC amendment, docs/feature-map/README.md, src/kiro_crew/docs/connections.md, src/kiro_crew/docs/configuration.md, the Slack runbook and its index.

Backwards compatibility

Breaking: Crew's own Slack sign-in needs the app's Client ID and Client Secret under Settings → OAuth Apps. A slack MCP entry at https://mcp.slack.com/mcp is now Slack's Connections card, and until that record is saved the card reads Needs configuration; each user who wants Crew's sign-in adds the record once. kiro-cli is unaffected: a slack entry, and any client the user wrote in it, stay as written in every file, so kiro-cli signs in from it as before. The card does not serve kiro-cli: with the preview off, or with chats on Kiro CLI, the card shows a link to the setting instead of Connect (#35949 tracks the card serving Kiro CLI). main has no Slack card, so this takes nothing away. Writer sweep on fresh origin/main: nothing in this repository writes a Slack client into an OAuth Apps record; outside it, only the user's own Slack app holds the secret, and this PR reads it from no other source.

Reader: website/src/pages/overview/McpTab.tsx:signInTargetFor -- crew page -- once a Slack app is saved under Settings → OAuth Apps, an existing slack MCP row at https://mcp.slack.com/mcp (a trailing slash or letter case aside) matches the new registry entry, so its Sign in goes to the Slack Connections card instead of the chat guidance. While no Slack app is saved there, the gateway marks the row connectionUnconfigured (typed in website/src/types/index.capabilities.ts; set by mcp_probe._annotate_unconfigured_connection) and the table does not send its sign-in to the card: a row the user wrote by hand in mcp.json with its own client keeps the chat guidance it has on main (a marked row that no chat could sign in for names the missing OAuth app instead, connectionNeedsApp), and the client the user wrote on the entry signs in from chat on Kiro CLI, and on any backend while the crew_oauth preview is off. With the preview on and chats on KAS, a session's slack entry goes to the Slack card whether or not a Slack app is saved (crew_oauth.routed_slug). A slack server the owner added through the custom-server form keeps its in-place Sign in button, as on main, while no Slack app is saved and Crew holds no grant under slack. Once a Slack app is saved, the row belongs to the card. With the preview on and chats on KAS, its Sign in goes to the card; with the preview off or chats on Kiro CLI, the row loses its in-place Sign in and shows the Kiro Crew sign-in steps instead (connections/owner_servers.py). An owner-added server at that URL under any other name, a letter-case variant such as Slack included, keeps its in-place Sign in and its bridge before and after the save, as on main. GitHub rows are unchanged. This follows connections_ui (on by default), not the crew_oauth preview; with connections_ui false the row keeps the chat guidance. Pinned by ConnectionsSlackProvider.test.ts owns a slug-named row at a trailing-slash or letter-case variant of the registry URL and leaves the row alone while no OAuth app is saved, and owns it once one is, McpTab.slackUnconfigured.test.tsx (both states), and test_crew_oauth_slack.py test_a_slack_row_is_left_to_its_own_sign_in_while_no_oauth_app_is_saved and test_the_card_claims_the_slack_row_once_its_oauth_app_is_saved.

Reader: src/kiro_crew/dashboard/handlers/mcp_probe.py:_annotate_unconfigured_connection -- crew page -- with chats on Kiro CLI and a Slack app saved, a slack row the user wrote by hand with its own oauth.clientId shows the Kiro Crew sign-in steps (connectionNeedsCrewSignIn) instead of the chat guidance it has on main. kiro-cli still signs in from that row's own client exactly as before; only the row's text changes.

Card match: an earlier head of this PR made the card own a row only at the exact registry URL, to agree with oauth_clients.provider_for_server, which binds the operator's client at the exact URL only. That broke every card for a row at a trailing-slash or letter-case variant (Connect added a second entry and got 409 "name already in use"), so connectionProviderForServer matches as on main again; this is safe because the card's Connect writes the registry URL onto the row before it starts the sign-in, and provider_for_server and crew_oauth.routed_slug still take the exact URL only (test_no_client_is_bound_and_no_sign_in_is_routed_at_a_variant_url, and the two a row at a variant of the registry URL cases in ConnectionsPage.coverage.connect.test.tsx).

Owner-added servers (#35692): the sample server in test/test_crew_oauth_custom_servers.py was renamed from slack at https://mcp.slack.com/mcp to acme at https://mcp.acme.example/mcp, because slack is now a registry provider and that file needs a server that matches none; no assertion changed. While no Slack app is saved under Settings → OAuth Apps and Crew holds no grant under slack, an owner-added slack server at https://mcp.slack.com/mcp keeps its Sign in button, its routing and its stored sign-in, as on main. Once a Slack app is saved, or Crew holds a grant under slack, the card owns the entry, and a sign-in stored under the owner's key is not read again (that unused grant is tracked in #35816). The rule is one predicate, owner_servers.card_yields, and it is true only for a provider whose entries keep the user's own client, which today is Slack; an unreadable config or vault means the card owns the entry. Only a server in the sealed owner record at its exact URL takes the owner's path, and the card's client is still bound at the exact registry URL only. The spec keeps the client the owner wrote on that entry, with the preview on or off (test_an_owner_added_slack_server_keeps_its_client_its_sign_in_and_its_path). A server the owner added at https://mcp.slack.com/mcp under any other name (say work-slack) keeps its sign-in and its bridge, as on main, before and after a Slack app is saved: the Slack card claims entries by name only, so taking the URL away would leave that server routed by neither path (crew_oauth._card_claims; test_an_owner_server_under_another_name_at_slacks_url_stays_bridged[no-app|app], and test_an_unrecorded_entry_under_another_name_at_slacks_url_is_not_bridged for an entry with no owner record). RFC amendment for the owner: this narrows the "Cards first" ruling for Slack only, in docs/request-for-change/rfc-crew-owned-oauth.md (the "Cards first" paragraph, amended 2026-11-15). Pinned by test_an_owner_added_slack_server_keeps_its_own_path_while_the_card_has_no_app, test_the_card_owns_an_owner_added_slack_server_once_it_has_an_app_or_a_grant, test_only_the_owners_recorded_slack_server_is_left_to_its_own_path and test_a_card_that_never_keeps_a_users_client_never_yields.

Existing behaviour, not changed here: a card's Connect on a row hand-written in the global mcp.json fails with 404, on main too (#35817).

No key, path or config value is taken away. A slack entry the user wrote keeps its oauth.clientId and oauth.clientSecret in every file, in all four cases (preview off or on, Slack app saved or not): the rebuild returns the entry untouched, and saving the Slack OAuth Apps record leaves it untouched.

Known limit: Disconnect revokes the access token. Slack's user tokens expire after 12 hours, so a Disconnect after that usually reports "not revoked"; the user then removes the app in Slack. This PR leaves that as is.

Tests

  • test/test_crew_oauth_slack.py (new): consent URL shape and PKCE; a Slack client without its secret is refused and resolves once the secret is set; the sign-in refuses a resolved client with no secret on its own, apart from the resolver; the code swap and the refresh post the secret and the verifier; Slack's {"ok": false} stores nothing; refresh rotates the token; a dead refresh token keeps the pair; Disconnect revokes the access token and reads revoked; tokens never reach logs or disk outside the vault; the KAS projection carries the bridge, not the client or token; a trailing-slash URL is not Slack's server; the operator's client is written into no file: after a card install with a Slack app saved, the real rebuild_agent_config (preview off and on), the warm helper's spec write and the cold Connect's spec write each leave every file under a scratch data home and Kiro agents folder free of the made-up Client Secret, and every spec and mcp.json free of the Client ID; the same after a scope copy when <data home>/mcp.json was broken by hand, and when its slack entry was removed by hand; a hand-written slack entry keeps its own client through the rebuild in all eight cases (with and without a secret, preview off and on, Slack app saved or not) and the user's file is never edited; an owner-added slack server keeps its client, its Sign in and its path while the card has no app; a scope copy keeps the client on the rendered slack entry, while GitHub's copy still drops the three keys; Disconnect stores nothing on a 200 that says ok: false, revoked: false or is not JSON; the banner gate admits the exact consent path only.
  • test/test_connections_oauth_client_routes.py: saving the Slack OAuth Apps record through the real PUT route leaves the user's own slack entries in both files byte-for-byte, with and without a secret; the mint route answers 409 crew_sign_in_required for Slack with an app saved and the preview off, and starts neither a warm adoption nor a cold mint.
  • test/test_connections_status_client_config.py: with the preview off the Slack row carries needsCrewSignIn and neither needsClientConfig nor backendLacksOauth, with an app saved or not; with the preview on and no app it carries needsClientConfig.
  • Registry, OAuth Apps routes, banner-corpus and docs pins updated for the new entry.
  • website/src/test/ConnectionsSlackProvider.test.ts: the Slack card is a pre-registered provider that needs its secret, owns a slug-named row at a trailing-slash or letter-case variant of the registry URL, leaves a row the gateway marks connectionUnconfigured to the MCP Servers table's chat guidance, and keeps that row as the card's own. ConnectionsPage.coverage.connect.test.tsx adds the card case: a marked row with a held grant shows Connected with Disconnect.
  • website/src/test/McpTab.slackUnconfigured.test.tsx (new): with no OAuth app saved, a slack row with its own client renders the chat guidance, no Sign in button and no "Managed by Connections" badge; a row marked connectionNeedsApp says Slack needs its OAuth app and links to the Slack card under Settings → Connections, with no link to chat; with an app saved the row renders the badge and Sign in.
  • website/src/test/ConnectionsPage.coverage.test.tsx: a Slack status row with needsCrewSignIn renders no Connect and no Set up Slack, its Turn on Kiro Crew sign-in link opens the preview's switch, and the tip names both steps with a link to /settings/agent; a row with crewSignInNotOwned shows Managed in MCP Servers, not Needs configuration; a row marked connectionNeedsCrewSignIn shows the same links and no Sign in (McpTab.slackUnconfigured.test.tsx, test_crew_oauth_slack.py).
  • test/test_crew_oauth_slack.py: the gateway marks only the slack row at Slack's URL while no OAuth Apps record resolves (an unconfigured GitHub row is not marked), and clears a stale mark once the record is saved. Removing the Slack-only check, inverting the configured check, or removing the card's check each turns these tests red.
  • Mutation checks: removing the sign-in's secret check (crew_oauth._client) turns test_the_sign_in_refuses_a_resolved_client_that_has_no_secret red; removing the resolver's (oauth_clients.resolve_oauth_client) turns four test_connections_oauth_clients.py tests red. For the no-projection rule, each of these turns its test red (one mutation at a time, the file restored after each): dropping the rebuild's Slack return (10 tests), letting the warm helper list Slack, dropping the mint route's refusal, making the scope copy strip a Slack client, treating Slack as projected in the copy and the scrub (3 tests), dropping the card's needsCrewSignIn, and dropping the row's routed-by-Crew check. Also: ignoring Slack's revoked: false, and treating a non-JSON revoke answer as revoked.
  • Determinism: the new file passed 20 runs at -n0, 10 at -n 4 beside test_crew_oauth_google_asana.py, and once in reversed order.
  • Local: 1788 related backend tests and 1614 related frontend tests pass; tsc, eslint, mypy, black, flake8, isort, the comment-history, brand and file-line-cap gates, docs-lint.sh and i18n:check pass.

Manual verification

Done on a pod at an earlier head, before #34353 moved the OAuth apps onto the Connections cards (crew_oauth preview on, a slack entry at https://mcp.slack.com/mcp carrying only clientId, no OAuth Apps record): the OAuth Apps record reads confidential: true, client_id: null, configured: false; the Slack card reads Needs configuration with Configure OAuth app; the OAuth Apps card says the secret is required.

Also done on a pod (preview off, chats on KAS, made-up GitHub and Slack apps saved): the warm sign-in helper ran (the audit log shows connections_warm_mint_spawn, outcome ok, for eight providers), its spec listed those eight without Slack and held GitHub's made-up secret, and no file under the pod home held Slack's made-up Client Secret. Connect on the Slack card answered 409 crew_sign_in_required and wrote no kirocrew-mint-slack-*.json.

The switch that turns on Kiro Crew's own sign-in is developer.mcp-sign-in-by-kiro-crew since #36300, and the Slack card's Turn on Kiro Crew sign-in link highlights that id. The tip names the switch by its own label in each language.

Not done: the consent, token swap, tool call and revoke against real Slack need a real Slack app. Human checklist:

  1. At api.slack.com/apps, create an app From scratch in your workspace. Never turn on distribution.
  2. Agents → turn the Slack Model Context Protocol (MCP) Server toggle on.
  3. OAuth & Permissions → turn PKCE on (one-way), then add redirect URL http://localhost:48106/callback and save.
  4. Under User Token Scopes add search:read.public, channels:history, users:read (or the runbook's full read list). Add no bot scopes.
  5. Copy the Client ID and the Client Secret from Basic Information → App Credentials.
  6. In Kiro Crew: Settings → Feature previews → turn on Crew-owned OAuth; keep chats on KAS.
  7. Settings → Connections → Slack card → Set up Slack: paste both and save.
  8. Customize → Connections: the Slack card shows Connect. Click it, approve on Slack's page, and check the card reads Connected.
  9. In a new KAS chat, ask: "search Slack for the last message in #general". Check a Slack tool runs.
  10. Click Disconnect on the card. Check it reports revoked, and the next tool call asks to reconnect.
  11. Optional: repeat on one other bridged harness (codex or claude).

Screenshots / video

The Slack card and row, Component render, not the live page: the real ConnectionsPage and McpTab from this head, mounted by the website/capture harness with stubbed status and server feeds. The OAuth client list is the payload the real /api/connections/oauth-clients route returns on a fresh data home, so the card shows its real OAuth app part.

Preview off (the default), tip open: no Connect, and Turn on Kiro Crew sign-in, which opens /settings/developer/feature-previews?highlight=developer.mcp-sign-in-by-kiro-crew. In the tip, Settings is a link to /settings/agent:

Component render, not the live page: Slack card, preview off, tip open

The MCP Servers row with the Slack app saved but Crew's sign-in not live (connectionNeedsCrewSignIn): the same two steps and both links, and no Sign in:

Component render, not the live page: Slack MCP row, Crew sign-in not live

Connected (a grant Crew holds): Connected and Disconnect:

Component render, not the live page: Slack card, connected

Preview on, but the user's own slack entry sends its own credential header or points at another URL (crewSignInNotOwned): no Connect, no OAuth app form, a neutral Managed in MCP Servers badge, and one line that says why, with a link to MCP Servers:

Component render, not the live page: Slack card, Managed in MCP Servers

An MCP Servers row marked connectionNeedsCrewSignIn keeps its probe error (and, with tools, its tools list); the setup line sits where Sign in would be:

Component render, not the live page: Slack MCP row with a probe error

Preview on, chats on KAS, no Slack app saved (Component render, not the live page): the card shows Set up Slack and the prerequisite_slack tip:

Component render, not the live page: Slack card, preview on, no app, tip open

Set up Slack opens the OAuth app form in place on the card (Component render, not the live page):

Component render, not the live page: Slack card, OAuth app form open

The three stills below are from head d619857 (Component render, not the live page), same harness and mocked feeds.

A slack MCP row at https://mcp.slack.com/mcp/ (trailing slash): the table shows no Sign in and a visible Open the Slack connection card link instead:

Component render, not the live page: Slack MCP row with the card link

The Slack card with a held grant while its mint is refused, crewMintRefused: sign_in_off: no Connect or Reconnect; Turn on Kiro Crew sign-in stands where Reconnect would be:

Component render, not the live page: Slack card, mint refused, sign-in off

The same card with crewMintRefused: not_owned: no Connect or Reconnect; the line saying the user's own Slack entry in MCP Servers signs in by itself stands where Reconnect would be:

Component render, not the live page: Slack card, mint refused, not owned

The three rows below are pod screenshots, every element real, all client values made up, from f1ccccb (the head before the rebase onto the fixed main; same Slack code).

A slack entry with no client of its own and no Slack app saved: the MCP Servers row names the missing OAuth app and links to the Slack card, instead of sending the person to chat:

Slack MCP row that names the missing OAuth app

A hand-written slack entry with its own client, preview on, chats on KAS, no Slack app saved. Crew signs in for this entry and has no app, so the row says the same; the agent spec keeps the client the user wrote:

Hand-written Slack row with the preview on

A slack server the owner added from the dashboard, preview on, no Slack app saved: it keeps its own Sign in:

Owner-added Slack row with Sign in

Related Issues

Closes #11895
Part of #34747

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

Contribution License Agreement

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 10, 2026 21:26
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/exfil_oauth.py

  • @buluoray posted a complete reasoning template for 752ac58.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks: the blind reader got the primary "Turn on Kiro Crew sign-in" link right ("switches on some kind of sign-in") and said "not sure" about pressing it, not that they wouldn't. Every added state shows up in a screenshot.

Notes

  • crew_sign_in_not_owned_help, "…so there is nothing to do here.", shows right under the red "Needs attention" error box (shot-10). The reader called it "Confusing". Drop "so there is nothing to do here" so the line only points to MCP Servers.
  • The "Turn on Kiro Crew sign-in" button only opens Settings; it doesn't turn anything on. Yet needs_crew_sign_in_help says "(1) turn on … sign-in with the button". Change it to "(1) use the button to open the Kiro Crew sign-in switch and turn it on". The reader also confused "Kiro Crew sign-in" with the row's "Sign in" (shot-13).
  • The reader couldn't tell which of "Set up Slack", "Turn on Kiro Crew sign-in" and "Sign in" to press, or in what order. The tip covers two steps but never mentions saving the Slack app, so step order is unclear across the card and the MCP Servers row.

[UX-REVIEWED] 752ac58

Description read

[DESCRIPTION-READ] 2a7051fc417f7994023ccf68bb2bb2f2176acbc155cbc8573428fc72a9c6fdc9

That sha256 names everything this verdict read: the PR description, plus the 16 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 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 752ac58deb83a4ccd6bfc1f77bca0135af4f6d3c — 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: Slack is a new card beside the existing owner-server path, and Crew's sign-in for it stays behind the crew_oauth preview, which is still off by default.

Notes

  • Item 9 — one consumer, generalized: _VAULT_ONLY_CLIENT = frozenset({"slack"}) is a one-member set, and keeps_user_client is threaded through 11 non-test call sites (counted from ^+.*keeps_user_client( in the patch), all of them for Slack only. Subtraction: replace the frozenset with a single _VAULT_ONLY_SLUG = "slack" compared with ==. This keeps the predicate and removes the "registry of vault-only providers" idea until a second provider needs it.

What this change ships

Inventory (10 items) — 9 justified

Intent: let a KAS (or other bridged-harness) user sign in to Slack's hosted MCP server, with Kiro Crew holding the token. ADDITION.

  1. A Slack card on Connections (Client ID and Secret entered under OAuth Apps) — justified
  2. Crew signs in to Slack: token exchange, refresh, invalid_refresh_token asks for a reconnect, Disconnect revokes the token — justified
  3. The banner now accepts Slack's user-token consent URL (Slack MCP OAuth blocked: user-token authorize endpoint (slack.com/oauth/v2_user/authorize) missing from _OAUTH_AUTHORIZATION_ENDPOINTS #11895) — justified
  4. The Slack client is never written into an agent spec, a mint or warm sign-in spec, or mcp.json — justified
  5. Card shows "Needs configuration" with a "Turn on Kiro Crew sign-in" link, or a "Managed in MCP Servers" badge — justified
  6. A Slack row on MCP Servers points to "Set up Slack" or the setup steps instead of sending the user to chat — justified
  7. A hand-added slack server keeps the owner-server sign-in while the card has no app and no grant — justified
  8. A hand-added server whose name is a letter-case variant of slack stays on the owner-server path — justified
  9. keeps_user_client predicate backed by a one-member frozenset — one consumer, generalized
  10. Slack runbook, RFC amendment, spec rows, strings in 12 languages — justified

[FIRST-PRINCIPLES-REVIEWED] 752ac58

Description read

[DESCRIPTION-READ] ce276afca19605ae61689043e972b0cb4624add27cadc1c5279de27f49879439

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 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the Slack card is new, the vault-only client is a deliberate trade-off with a follow-up (#35949), and existing hand-added slack entries keep the owner-server path until an app is saved.

Notes

  • _VAULT_ONLY_CLIENT = frozenset({"slack"}) adds a second kind of pre-registered provider, and code now checks for it by name in six places (spec commit, warm, mint, scope copy, purge, owner_servers). A registry field such as client_projection: false would make the next HubSpot/Box-style provider a data change, not another sweep through the code.
  • Through card_yields, is_signable_name now reads the config and the vault on every call, including once per row in the mcp_probe row loop. If the table gets slow, fetch that state once per probe and pass it in.

[DESIGN-REVIEWED] 752ac58

Description read

[DESCRIPTION-READ] 1c2a805d27710549fad61e2eff5f69959c54e2ae3fb8c9045a55d44dfb3ab5ee

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 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 752ac58deb83a4ccd6bfc1f77bca0135af4f6d3c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 752ac58

Verdict parsed from the review's SHA-scoped output markers for commit 752ac58deb83a4ccd6bfc1f77bca0135af4f6d3c.

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

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 752ac58deb83a4ccd6bfc1f77bca0135af4f6d3c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 752ac58

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

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does 752ac58deb83a4ccd6bfc1f77bca0135af4f6d3c 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): 12 classified, 0 newly refused, 12 still allowed.
  • ubuntu-latest (platform posix): 12 classified, 0 newly refused, 12 still allowed.
  • windows-latest (platform windows): 4 classified, 0 newly refused, 4 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The one change to the shell-path security code makes a rule looser, not stricter. It adds Slack's consent page to an allowlist that only the OAuth banner path reads, and no script-confirmed regression was handed back. The new refusals are all on the dashboard side (the Slack mint 409, the is_signable_name slug fence and the _card_claims routing check), and no shell classifier can judge them. They are named under UNADJUDICATED.

TIGHTENING: dashboard Connections sign-in admission (api_connections_mint, plus is_signable_name and signs_in_custom routing) -- it refuses to start a kiro-cli sign-in for a provider whose OAuth client must never leave the vault (Slack), because kiro-cli would present no client. Hunk: if keeps_user_client(slug) and not crew_owned: return _conflict("this provider connects only through Kiro Crew's own sign-in", "crew_sign_in_required", slug=slug). The exfil tier change is a loosening only: + ("slack.com", "/oauth/v2_user/authorize"), # issuer mcp.slack.com (user token) in _OAUTH_AUTHORIZATION_ENDPOINTS. That set is read only when allow_oauth_entropy is set (exfil.py:372-380, the "dedicated ACP banner-safety path"), not by the shell-command auditor.

ADJUDICATED: 16 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: The diff makes no assumption about host paths, separators or interpreters in any shell-tier code. Its only platform-shaped values are URLs and the localhost:48106 loopback redirect. Posix rows cover: the Slack discovery and consent URLs through curl, xdg-open and open; the auth.revoke and auth.test calls with $VAR tokens; the loopback callback; and the area's pytest, grep and jq runs. Windows rows cover the same operations in that platform's spelling: curl.exe, start "", %VAR% tokens and a test\... backslash pytest path. No any rows were written, because every row names an executable. No platform assumption was left unprobed.

UNADJUDICATED:

  • Guard: api_connections_mint refuses with 409 crew_sign_in_required. Call path: dashboard Connect → POST connections mint → keeps_user_client("slack") and not crew_oauth.owns("slack"). Inputs I would have submitted: a Slack card Connect with the crew_oauth preview off; a Connect on a KAS or kiro-cli chat backend Crew does not bridge; a slack entry with its own Authorization header; a slack entry at https://mcp.slack.com/mcp/ with a trailing slash or a different letter case (status.py treats these as the card's, so check the mint agrees). Slack is a new card, so none of these worked before through the card. What can be argued, but not confirmed here, is the Reconnect loss on a held grant once the preview is turned off.
  • Guard: owner_servers.is_signable_name(name, entry), which now consults the new slack registry slug. Call path: MCP table row → _annotate_owner_sign_in / _configured_remote_server → is_signable_name → get_provider(name.lower()). Inputs I would have submitted: an owner-added server named slack or Slack at a non-registry URL (for example a self-hosted Slack MCP proxy) after an OAuth app is saved on the Slack card. Before this PR, slack was not a registry slug, so that server's dashboard sign-in was offered. Now it is refused once card_yields turns False, and _owners_case_variant only rescues an entry at the card's own URL. This is a legitimate operation the change probably newly refuses, but I could not confirm it.
  • Guard: crew_oauth._card_claims / _left_to_owner, called from signs_in_custom, _custom_slug and routed_slug. Inputs I would have submitted: an owner server under any name at https://mcp.slack.com/mcp while the sealed owner record cannot be read (read_config_for_update raises). In that case _card_claims fails to True, which leaves the entry on neither path.
  • Guard: warm_spec_providers drops every keeps_user_client provider from the shared warm spec. Input I would have submitted: a connected Slack card on a shared-process KAS chat. This is new-provider behaviour and can only be checked by running a flow; a shell row cannot reach it.

[SCOPE-REVIEWED] 752ac58

@KiroCrewCaptain

KiroCrewCaptain commented Nov 10, 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 25% chance that this change introduces a defect, above the 12% limit for approving on its own.

I recommend approving this PR as it stands; I found nothing that blocks it.

What it does. It adds Slack as a pre-registered Connections provider, served only by Crew's own sign-in behind the crew_oauth preview.

What I checked against the code:

  • The Slack client is never written to a file. Every place that writes the operator's client into a spec or mcp.json now skips Slack: the spec rebuild, the warm sign-in helper, the Connect route (it answers 409 unless Crew's sign-in serves Slack), the scope copy and the scrub. The only path that projects a client, warm_runtime/spec_plan.py, is reached only from these guarded callers.
  • No regression on main. On main, slack is not a registry provider. A user's own slack entry is still returned untouched, so kiro-cli keeps signing in from the client the user wrote.
  • Token handling. Slack's error answers (a 200 with {"ok": false, "error": ...}) are refused, and invalid_refresh_token asks for a reconnect. The code swap and the refresh post the secret, and the swap also posts the PKCE verifier. Disconnect reads revoked from the response body.
  • Port. Slack's redirect port, 48106, is not used by any ot

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 752ac58deb · 2913 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@buluoray
buluoray force-pushed the crew/slack/crew-oauth-slack branch 3 times, most recently from 9c0b06a to c37be96 Compare November 10, 2026 22:47
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@buluoray
buluoray force-pushed the crew/slack/crew-oauth-slack branch 2 times, most recently from 37a0b31 to af0bd90 Compare November 11, 2026 02:01
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 11, 2026
@buluoray
buluoray force-pushed the crew/slack/crew-oauth-slack branch from af0bd90 to a0ccff1 Compare November 11, 2026 04:01
@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 11, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

span=13e3b12a73bb

  • "Needs configuration" appears on a card where the user has nothing to configure

fixed in 17ccf7d: when the user's own slack entry keeps its own sign-in (crewSignInNotOwned), the card shows a neutral "Managed in MCP Servers" badge, not "Needs configuration". The line under it says the entry signs in by itself, with a link to MCP Servers. All 12 languages.
The PR body shows this card as a component render from this head. ConnectionsPage.coverage.test.tsx pins the badge and the missing "Needs configuration", and failed on the old code first.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=2b3e4e4faa18

  • Gate Slack Reconnect independently of grant presence

fixed in 04eb24e: the status row now carries crewMintRefused ("sign_in_off" or "not_owned") whenever the mint would answer 409 crew_sign_in_required, whether or not a grant is held (status.py). The existing needsCrewSignIn / crewSignInNotOwned wording is unchanged for the no-grant case.
While crewMintRefused is set, the card renders no Connect and no Reconnect at any of the three buttons in ConnectionsPageCard.tsx that start a mint (Connect, and both Reconnect paths) and shows the matching setup line in their place, so mcpApply is never called. A held grant keeps Connected and Disconnect.
Same class on the MCP Servers row: a slack row that sends headers of its own gets the card link instead of Sign in (McpTab.tsx), because the mint refuses that entry too.
Tests written first and red on 17ccf7d: 6 in test_crew_oauth_slack.py, 3 in ConnectionsPage.coverage.test.tsx, 2 in McpTab.slackUnconfigured.test.tsx. Spec updated in docs/system-specs/modules/connections.md.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=2b3e4e4faa18

  • Gate Slack Reconnect for entries yielded to owner-server sign-in

Rebutted: not a defect at a security or data boundary. Four uncommon conditions must hold together: an owner-recorded slack entry at the exact URL with no credential header, a kept kiro-cli grant, the entry turned off, and Crew sign-in on with no Slack app saved.
The outcome is one visible 409 crew_sign_in_required after Reconnect turns the entry back on, which is what the user pressed Reconnect to do. No credential moves, nothing is deleted, and no privilege boundary is crossed.
The adjudicator agreed on a7f04f5: "the harm isn't really security-class. The only side effect is a visible 409 on Reconnect plus the server getting re-enabled, and the user asked for that by pressing Reconnect."
This is the third round on the Reconnect path; each narrow fix has surfaced the next corner, so the narrow fix (count _left_to_owner entries in _crew_sign_in_not_owned_slugs, tests first) is tracked in #37441 instead of widening this PR.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the updates. This review checked 86d1788 and found one thing that blocks merge.

  1. Saving a Slack app takes Crew's sign-in away from an owner server at Slack's URL that has any name other than slack (connections/crew_oauth.py:273).
    • Trigger: the crew_oauth preview is on and chats run on KAS. The owner added work-slack at https://mcp.slack.com/mcp through the custom-server form and signed in through Crew, so Crew holds its grant under custom_key('work-slack', url). The owner then saves a Slack app on the Slack card.
    • Outcome: card_yields(slack) turns False, so _is_registry_url now returns True for that URL. _custom_slug returns "" and signs_in_custom returns False. The card does not claim the entry either, because routed_slug takes the card path only for the name slack. The KAS session gets the entry with no bridge, which is the same silent failure as #34747. On main, Slack is not in the registry, so this server stays bridged. A probe at this head gives a custom-... routed slug before the app is saved and an empty one after.
    • Coverage: the rename in test/test_crew_oauth_custom_servers.py (from slack at mcp.slack.com to acme) removed the one test that pinned bridging at Slack's URL. Backwards compatibility names only a server called slack. The entry also ends up covered by no path, which breaks the RFC's own rule that no entry is covered by neither.
    • Smallest fix: add cases to test/test_crew_oauth_slack.py that pin the behaviour you choose for a recorded owner server under another name at Slack's URL, both before and after the app is saved. Then either name the loss in a Reader: line under Backwards compatibility, or keep the owner path for a sealed owner record at that exact URL.

Also needed before merge: the UX Review BLOCK on this head (the "nothing to configure here" line on the Slack card) has no disposition, so PR Readiness is red. If that line cannot render in production because the real OAuth clients list includes Slack, say so in a disposition and show the evidence.

Follow-up on my earlier review (e4737e2):

  • Two stills of the preview-on, no-app card: fixed. The body now shows the card with Set up Slack and the tip, and the OAuth app form open in place.
  • Sensitive Change Review template: still stands. The posted template names 948cc7f. Please post it again for 86d1788.
  • Allowlist decision (from my comment on 948cc7f): the PR author, who is a listed maintainer, has posted it.

For the security review: security/exfil_oauth.py:256 adds the exact pair ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist, and a test rejects the neighbouring path. The decision was posted by the PR author. No separate security reviewer has acknowledged it on this PR yet.

Optional:

  • The token swap, refresh and revoke still have not run against real Slack. On main, the runbook said a PKCE app should not send a client secret. This head sends it on every swap and refresh. Running manual checklist steps 1 to 10 against a real Slack app, and posting the result, would settle this.
  • docs/guides/oauth-app-registration/slack.md:6 still says Connect appears once the Client ID is saved. The same file says the card also needs the Client Secret, the preview on and chats on Kiro Agent.
  • connections/owner_servers.py:70: card_yields narrows the recorded "Cards first" ruling (2026-11-12). The ruling's owner has not confirmed that on this PR.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=05304f431f75

  • The default Slack card gives two opposite instructions

Rebutted: the "nothing to configure here" line cannot show on a real Slack card. OAuthAppPanel renders it only when /api/connections/oauth-clients has no row for the slug (OAuthAppPanel.tsx:577), and that route always lists Slack.
Evidence: _oauth_client_views() on a fresh, empty data home returns github, asana, gmail, google-drive, google-calendar, google-sheets, google-docs, google-slides, slack.
The line came from the screenshot harness: its stub answered /api/connections/oauth-clients with an empty list. The PR body's stills are being re-shot with the real client list, so the card shows only the badge, the tip and the button.

@buluoray

Copy link
Copy Markdown
Contributor Author

span=8efb07d8c3f2

  • The main control's label says it toggles, but it navigates

Accepted and deferred to #37235 (deferred-finding, assigned, Due 2026-11-28): the owner kept "Turn on Kiro Crew sign-in" after five copy rounds on this button. It opens Feature previews with the switch highlighted, where the user turns it on and can turn it off.
#37235 names both fixes this verdict offers: a verb that says where the button goes (with step (1) reworded on the card and the MCP Servers row), or a real switch on the card. The UX override for this head points at the same issue.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the updates. This review checked b6d2847 and found one thing that blocks merge.

  1. An owner server named Slack at Slack's URL ends up on no sign-in path once a Slack app is saved. Its name differs from the slug only in case. (connections/owner_servers.py:117)
    • Trigger: the crew_oauth preview is on and chats run on KAS. The owner added Slack at https://mcp.slack.com/mcp through the custom-server form and signed in through Crew, so Crew holds its grant under custom_key('Slack', url). The owner then saves a Slack app on the Slack card.
    • Outcome: is_signable_name('Slack') looks up get_provider(name.lower()) and finds Slack. It returns False because card_yields is now False. _card_claims also claims the entry, because get_provider(name.lower()) is not None (connections/crew_oauth.py:302). The card does not take the entry either. routed_slug matches only the exact name (name in SUPPORTED_SLUGS), and providerOwningRow needs server.name === provider.slug. So the KAS session gets the entry with no bridge, which is the same silent failure as #34747, and the row loses its in-place Sign in. On main this server stays bridged. This is the case my last review's work-slack item did not cover: the fix at this head handles only names whose lowercase form is not a slug. The Reader: line says "A slack (or Slack) server ... Once a Slack app is saved, the row belongs to the card". That is not true for Slack.
    • Smallest fix, pick one:
      • (a) For a card that keeps the user's client, match the exact name in _card_claims, and let a case variant from the owner's saved record through is_signable_name. Then add Slack to the parametrization of test_an_owner_server_under_another_name_at_slacks_url_stays_bridged.
      • (b) Keep the refusal, correct the Reader: line, name the loss under Backwards compatibility, and add a test that pins routed_slug == '' after the save.

Also needed before merge:

  • The UX Review BLOCK on this head (the "Turn on Kiro Crew sign-in" label on a link) has a deferral disposition to #37235 but no recorded override, so PR Readiness is red. A maintainer records or rejects that override.
  • Sensitive Change Review: please post the template again for b6d2847.

Follow-up on my earlier review (86d1788):

  • work-slack at Slack's URL lost Crew's bridge: fixed. test_an_owner_server_under_another_name_at_slacks_url_stays_bridged pins it before and after the save. The Slack case above is what remains of the same class.
  • UX "nothing to configure here" line: rebutted with evidence. The OAuth clients route always lists Slack, so the line cannot render on a real card.
  • Sensitive Change Review template: still stands. It names an earlier head.

For the security review: security/exfil_oauth.py adds the exact pair ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist. The PR author posted the decision. No separate security reviewer has acknowledged it on this PR yet.

Optional:

  • When the 12 hour access token has expired, Disconnect sends that expired token to auth.revoke. The card copy's promise that Disconnect revokes the token likely does not hold in that case (connections/crew_oauth.py:1068). Refresh once before revoking, or reword the copy.
  • The three route call sites of _annotate_unconfigured_connection in dashboard/handlers/mcp_probe.py (lines 615, 794, 949) have no test. Removing all three turns no test red. One route-level test would pin them.
  • With chats on the Kiro CLI, take a user's own slack row that carries its own clientId. Once a Slack app is saved, it shows the Crew sign-in steps instead of the chat guidance (mcp_probe.py:1113), but the body says the Kiro CLI is unaffected. Skip the mark for that row, or name the change in a Reader: line.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thanks for the updates. This review checked f91ca73 and found no defect that blocks merge.

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

What changes for existing users:

  • Once a Slack app is saved, a slack MCP row at mcp.slack.com sends its Sign in to the card.
  • A hand-written Kiro CLI slack row now shows the Crew sign-in steps.
  • The RFC narrows the "Cards first" owner ruling.

The PR author posted the decision comment of 2026-11-14 on the allowlist. That is not agreement from a second person. The design and the allowlist widening stay with a maintainer other than the author and with a security reviewer.

Follow-up on my earlier review (b6d2847):

  • A Slack case variant ended up on no sign-in path: fixed. _owners_case_variant routes it, and test_an_owner_server_under_another_name_at_slacks_url_stays_bridged now covers Slack before and after the save.
  • The UX Review BLOCK on the "Turn on Kiro Crew sign-in" label still stands. The lane blocks again on f91ca73. The deferral to Slack card: clearer copy for the sign-in button, tip and not-owned line #37235 has no recorded override for this head, so PR Readiness stays red.
  • The Sensitive Change Review template still stands. The check reports that no author comment names f91ca73.

The red Backend Tests (3.12, 7) and Coverage Gate come from test_the_scan_is_linear_not_quadratic, a timing test this diff does not touch. Rerun that job once the run completes.

For the security review:

  • security/exfil_oauth.py adds the exact pair ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist. It matches host and path exactly. It sits next to the existing bot-token pair ("slack.com", "/oauth/v2/authorize").
  • Tests pin both sides: the exact path is admitted and a neighbouring path is rejected.
  • The Slack Client Secret stays in the vault. Tests scan the data home and agents folder and find it in no spec, warm spec or mcp.json.
  • The token swap, refresh and revoke have not run against real Slack yet. The manual checklist in the PR body is still open.

Optional:

  • website/src/pages/overview/McpTab.tsx:1293: a slack row with no clientId that is marked connectionNeedsApp still shows owner Sign in. That sign-in cannot succeed, because Slack offers no dynamic client registration. Check connectionNeedsApp before signInTarget, and add one test with both flags set.
  • src/kiro_crew/dashboard/handlers/connections.py:586: no test covers the happy path of the new mint guard. Call _mint_slack on the owned plain entry and assert a 200 and started == ['crew:slack'].
  • src/kiro_crew/connections/crew_oauth.py:1069: once the 12 hour access token has expired, Disconnect sends that expired token to auth.revoke. Refresh once before you revoke, or reword the card copy.

@buluoray

Copy link
Copy Markdown
Contributor Author

Edited one sentence in ## Why it matters, at the maintainer's request. The old text said a KAS user who set up a Slack app could not use it at all. That was wrong: on main, a Slack server added by hand through the MCP Servers custom-server form signs in on KAS through Kiro Crew's owner-server path (with the crew_oauth preview on), as the First Principles review on f7089f3 pointed out. The sentence now says that, and that this PR adds the Slack card for users who set up a Slack app on the card. The Goal line and ## Not a goal are unchanged.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thanks for the updates. This review checked 77c176a and found no defect that blocks merge.

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

The PR also widens the OAuth consent allowlist and narrows the recorded "Cards first" owner ruling in the RFC. The PR author posted the allowlist decision. No second maintainer, no security reviewer and no owner of that ruling has agreed on this PR yet. Those decisions stay with them.

Follow-up on my earlier review (b6d2847):

  • A Slack case variant ended up on no sign-in path: fixed. _owners_case_variant (connections/owner_servers.py:124) routes it, and the test at test/test_crew_oauth_slack.py:495 covers work-slack and Slack.
  • The UX Review BLOCK still stands. The lane blocks again on 77c176a on the "Turn on Kiro Crew sign-in" button. The deferral to Slack card: clearer copy for the sign-in button, tip and not-owned line #37235 was posted for b6d2847, and this head has no recorded override, so PR Readiness stays red.
  • The Sensitive Change Review template still stands. The latest template names 948cc7f. Please post it again for 77c176a.

For the security review:

  • security/exfil_oauth.py:256 adds the exact pair ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist. It matches host and path exactly, next to the existing pair ("slack.com", "/oauth/v2/authorize").
  • Tests pin both sides: the exact path is admitted, and a neighbouring path is still rejected. Other query parameters still get the full scan.
  • The Slack Client Secret is never written into a spec. Tests run the real rebuild, the warm spec write and the cold Connect write on a scratch data home, then scan every file for the made-up secret.
  • The token swap, refresh and revoke have not run against real Slack. The manual checklist in the body is still open.

Optional:

  • No test covers the main path: Connect on the Slack card starting Crew's sign-in. If and not crew_owned is dropped at dashboard/handlers/connections.py:586, every Slack Connect answers 409, and the related tests stay green. One test that calls _mint_slack with preview on, KAS and an app saved, and asserts 200 with crew:slack started, would pin it.
  • website/src/pages/overview/McpTab.tsx:1293 checks signInTarget before connectionNeedsApp. An owner-added slack row with no clientId and no saved app shows a Sign in that cannot succeed, and the new "needs its OAuth app" mark never shows. Check connectionNeedsApp first, and add one test with both flags set.
  • connections/crew_oauth.py:1069 sends the stored access token to auth.revoke without a refresh. After 12 hours, Disconnect usually reports a partial revoke. Refresh once before revoking, or reword the card copy.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the updates. This review checked d619857 and found one thing that blocks merge.

  1. Two new surfaces on this head have no rendered evidence (website/src/pages/overview/McpTab.tsx:959, website/src/pages/connections/ConnectionsPageCard.tsx:761).
    • Trigger: the UX Review on this head says "cannot evaluate: missing" for two things. First, the visible "Open the {{provider}} connection card" link. It renders when connectionsUi && managedProvider && !signInTarget holds, for example a slack row at a URL other than the registry URL. On main this string was only an aria-label. Second, the Slack card while its mint is refused (crewMintRefused is sign_in_off or not_owned). There mintRefusedHelp takes the place of Connect and Reconnect (lines 865, 1051, 1172).
    • Outcome: none of the 10 stills in the body shows either surface. Still 03 shows only the plain Connected card with Disconnect. The lane's verdict reads PASS only because it had no Trigger and Outcome lines. The evidence gap itself is still open, so these controls would merge without anyone having seen them rendered. Unit tests cover the behaviour, so this is about evidence only.
    • Smallest fix: add captures of this head from the same capture harness the other stills use: (a) a slack MCP row at https://mcp.slack.com/mcp/ showing the visible link; (b) the Slack card in the needs-attention state with sign_in_off and with not_owned, showing the setup line where Reconnect would be. Then let the UX lane run again on that head.

Also needed before merge:

  • Sensitive Change Review: please post the template again for d619857. The check reports that no author comment names this head.
  • The allowlist decision on #11895 was posted by the PR author. That decision stays with a maintainer other than the author and with a security reviewer.

Follow-up on my earlier review (b6d2847):

  • A Slack case variant ended up on no sign-in path: fixed. _owners_case_variant (connections/owner_servers.py:124) routes it, and test/test_crew_oauth_slack.py:495 and :525 cover work-slack and Slack.
  • The UX Review BLOCK on the "Turn on Kiro Crew sign-in" label: resolved on this head. The lane now lists it as a note, not a block.
  • The Sensitive Change Review template: still stands (see above).

For the security review:

  • security/exfil_oauth.py:256 adds the exact pair ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist. It matches host and path exactly, next to the existing pair ("slack.com", "/oauth/v2/authorize").
  • Tests pin both sides: the exact path is admitted, and a neighbouring path is still rejected.
  • The Slack Client Secret stays in the vault. Tests run the real rebuild, the warm spec write and the cold Connect write on a scratch data home, then scan every file for the made-up secret.
  • The token swap, refresh and revoke have not run against real Slack. The manual checklist in the body is still open.

Optional:

  • dashboard/handlers/connections.py:586: no test covers the healthy side of the new Slack mint refusal. If and not crew_owned is dropped, every Slack Connect answers 409 and no test turns red. One test that calls _mint_slack with the preview on, KAS and an app saved, and asserts 200 with crew:slack started, would pin it.
  • website/src/pages/overview/McpTab.tsx:1293 checks signInTarget before connectionNeedsApp. An owner-added slack row with no clientId and no saved app shows a Sign in that cannot succeed, and the new "needs its OAuth app" line never shows.
  • connections/owner_servers.py:100: once a Slack app is saved, an owner-added slack row loses its row Sign in when the preview is off or chats run on the Kiro CLI. The Reader line says its Sign in goes to the card, which holds only with the preview on and a bridged backend. A body edit that names this reader would close it.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thanks for the updates. This review checked 752ac58 and found no code defect that blocks merge. It still cannot approve, because this PR widens a security allowlist and that decision belongs to people other than the author.

The decision: security/exfil_oauth.py:256 adds ("slack.com", "/oauth/v2_user/authorize") to the consent endpoint allowlist. Issue #11895 is parked for a maintainer decision on exactly this relaxation. So far the only approval recorded for it was posted by the PR author. A maintainer other than the author and a security reviewer need to record the decision here.

Follow-up on my earlier review (d619857):

For the security review:

  • The added pair matches host and path exactly. It sits next to the existing ("slack.com", "/oauth/v2/authorize") pair. Tests admit the exact path and still reject a neighbouring one.
  • The Slack Client Secret stays in the vault. Tests run the real rebuild, the warm spec write, the cold Connect spec write and the scope copy on a scratch data home, then scan every file for the made-up secret.
  • The Connect route refuses the Kiro CLI sign-in for Slack with 409 crew_sign_in_required, so no client is ever projected to it.
  • Disconnect posts only the access token and reads revoked from the 200 body. Tests cover ok:false, revoked:false and a non-JSON reply.
  • The token swap, refresh and revoke have not run against real Slack. The manual checklist in the body is still open.

Optional:

  • src/kiro_crew/connections/crew_oauth.py:414 and connections/owner_servers.py:121: suppose the owner adds a server named slack at a URL other than https://mcp.slack.com/mcp and signs in through Kiro Crew. After a Slack app is saved, routed_slug returns "" and the row loses its Sign in. The card says the entry signs in by itself. On main that server stays bridged. The Security Scope lane lists this as unadjudicated. You could keep the owner path when the recorded URL is not the registry URL, or name the loss in a Reader: line and pin it with a test.
  • dashboard/handlers/connections.py:586: no test covers the allowed side of the Slack mint refusal. One test with the preview on, chats on KAS and an app saved, asserting 200 with crew:slack started, would catch a dropped and not crew_owned.
  • The RFC narrows the 2026-11-12 "Cards first" owner ruling. It would help if the author of that ruling agreed to the exception on this PR.

@bolichen97

Copy link
Copy Markdown
Contributor

Maintainer sign-off from @bolichen97 (not the PR author) on the two decisions this PR leaves to a human, on head 752ac58:

  1. Consent allowlist (Slack MCP OAuth blocked: user-token authorize endpoint (slack.com/oauth/v2_user/authorize) missing from _OAUTH_AUTHORIZATION_ENDPOINTS #11895): agreed. security/exfil_oauth.py admits only the exact pair ("slack.com", "/oauth/v2_user/authorize"), matching host and path exactly like the other provider entries, and the tests pin that nothing else on slack.com passes. Slack has no dynamic client registration, so without this entry its user-token consent page fails closed for every harness.
  2. RFC amendment, "Cards first" exception for Slack only (docs/request-for-change/rfc-crew-owned-oauth.md, amended 2026-11-15): agreed. A user's own or owner-added slack entry keeps its client and its sign-in path, the operator's Slack client is written into no file, and the exception is one predicate (owner_servers.card_yields) that is true only for a provider that keeps the user's client, which today is only Slack.

This covers the decisions only. The open items from the KiroCrewCaptain review on d619857 are still for the author: the rendered evidence for the two new surfaces, and re-posting the Sensitive Change Review template for the current head.

AI-assisted, sent by Bolin Review bot on behalf of @bolichen97

@buluoray

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 752ac58
  • What rule changed: src/kiro_crew/security/exfil_oauth.py adds one exact pair, ("slack.com", "/oauth/v2_user/authorize"), to the code-owned _OAUTH_AUTHORIZATION_ENDPOINTS set. It is the authorization_endpoint Slack itself advertises at https://mcp.slack.com/.well-known/oauth-authorization-server (Slack MCP OAuth blocked: user-token authorize endpoint (slack.com/oauth/v2_user/authorize) missing from _OAUTH_AUTHORIZATION_ENDPOINTS #11895). Maintainer sign-off from @bolichen97: feat(connections): crew-owned oauth for the slack mcp server #34811 (comment)
  • Before -> after (what was allowed/blocked, now): Before, a Slack MCP consent URL at slack.com/oauth/v2_user/authorize had its PKCE code_challenge and state read as a credential, so the sign-in failed closed. After, only that exact host and path get the OAuth front-channel exemption; a neighbouring path such as /oauth/v2_user/authorize/x, another host and every non-OAuth query parameter are still scanned as before.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): A URL at exactly slack.com/oauth/v2_user/authorize could carry a high-entropy value in a standard OAuth parameter without being redacted from the consent banner. It breaks no command and locks no one out; it is a first-party Slack host already trusted for /oauth/v2/authorize.
  • Evidence checked (which sandbox result proves it): No sandbox or command-floor change: the diff touches no sandbox, hook or deny-list file. test_crew_oauth_slack.py pins the exact pair (admitted) and the neighbouring path (still rejected); test_connections_registry.py checks every registry issuer maps to an allowlisted consent host; removing the pair turns those tests red (mutation run).
  • No regression:
    • Tools still work (which tools/commands were run, result): on this head, 1022 passed across test_crew_oauth_slack.py, test_connections_registry.py, test_crew_oauth_mvp.py, test_connections_oauth_client_routes.py, test_connections_mint_flow.py, test_connections_warm_activation.py, test_display_time_redaction.py, test_mcp_oauth_banner.py and test_security_oauth_urls.py. Earlier pod checks at f1ccccb (same Slack code, before later rebases): with a made-up Slack app saved and the preview off, the rebuild, the warm sign-in helper and Connect (409 crew_sign_in_required) left the made-up Client Secret in no file under the pod home; a hand-written slack entry kept its own client with the preview on; an owner-added slack server kept its client and its Sign in.
    • Backward compatible (old config / old data / old callers still work, how checked): Additive only. Every existing pair is unchanged, and the operator oauth_endpoints.json keystone still adds endpoints as before; the old workaround entry for this path is now redundant but harmless.
    • Existing tests (which suites passed on this head): all CI checks on 752ac58 passed except this review (90 success, 9 skipped), including every Backend Tests shard, Frontend tests, Coverage Gate, GPT, Opus, UX and First Principles.
  • How to undo: Revert the one added tuple in src/kiro_crew/security/exfil_oauth.py (and its two Slack banner tests and the row file test/security_line_budget/slack-oauth-consent-endpoint.txt); Slack MCP sign-in then fails closed again unless oauth_endpoints.json lists the path.

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.

Slack MCP OAuth blocked: user-token authorize endpoint (slack.com/oauth/v2_user/authorize) missing from _OAUTH_AUTHORIZATION_ENDPOINTS

3 participants