Repository navigation
feat(slack): opt-in Slack MCP switch in the generated app manifest - #38169
kyleseaman wants to merge 2 commits into
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The switch is opt-in, and with it off the manifest is byte-identical to main's. It stays out of the bot-scope registry on purpose, and the code that loops over every switch skips it. Notes
[DESIGN-REVIEWED] a017fab Description read[DESCRIPTION-READ] 940f43971838675716b0f9d37c315712ec492e2d16025558c7d80512b25218bb 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 The new switch is off by default, its job is stated, and every item has a consumer. One registry tuple has only one entry and one reader. Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: let one Slack app serve both the Kiro Crew bot and Slack's MCP server by turning on a single manifest switch. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] a017fab Description read[DESCRIPTION-READ] 36529fc9cf710868b530335675de3c50d517162c1ed5cc79be173fc2350dacca That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK The blind reader would not turn on "Slack tools for your agents", the main control this PR adds. Its off-state note never says that turning it on reads nothing. BlockersFirst-time user won't turn on the main switch Notes
[UX-REVIEWED] a017fab Description read[DESCRIPTION-READ] ca0b435a509a832468a74bf9cfa604a0d60d4f667334304226e1dc5164d18813 That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
ed62df9 to
a017aa5
Compare
a017aa5 to
ee5286d
Compare
Code change approver recommendation: A person should decideWhy: the decider raised 2 possible problems and estimates a 60% chance that this change introduces a defect; a person should check them. The switch is opt-in, off by default, and leaves the manifest unchanged when off; the code and tests are solid. But the feature's purpose, one Slack app with bot scopes plus PKCE and a localhost redirect, rests on an untested assumption. The merged oauth-app-registration guide says Slack rejects that setup, and the author says the switch must not ship until a sandbox Slack workspace confirms it works. Saving the manifest in Slack turns PKCE on for the user's production bot app, and only Slack support can turn it off, so a wrong assumption can't be undone. Run the verification first, then either fix the guide or rework the switch around a separate app. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
Tier: 2, held for a person: security-sensitive path. 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 |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for this. The code works as written, and turning the switch off leaves the manifest byte-identical to main. One thing has to happen before it can merge.
src/kiro_crew/slack-manifest.yaml:48-53. The sandbox check your PR body requires has not run. Say an operator turns onslack.slack_mcpand saves the rendered manifest on their existing bot app. That turns onpkce_enabled: trueand adds thehttp://localhost:48106/callbackredirect, and every bot scope stays on the same app. PKCE cannot be turned off again without Slack support. No one has confirmed that Install to Workspace still issues the bot token, or that Connect on the Slack card is accepted on this app. The mergeddocs/guides/oauth-app-registration/slack.mdis the guide the card links to. It says this setup is rejected (line 73), and its troubleshooting row (line 105) tells the operator to remove all Bot Token Scopes. On a one-app setup, following that row breaks the bot. Smallest fix:- Run the three sandbox steps from your Manual verification section and post the results on this PR.
- If they pass, change lines 10, 73, 105 and 118 of that guide so it stops telling a one-app operator to remove bot scopes. Do it here or in a stacked PR.
- If step 2 or 3 fails, the one-app switch should not ship as written, as your body already says.
Optional:
- The in-app warning box in
website/src/pages/settings/SlackCodePanel.tsxleaves out the "not yet tested against Slack" caveat and the separate-app fallback. Both docs carry them. The two surfaces should say the same thing. - The update panel lists only added user scopes, so it never shows that
search:readleaves the manifest when the switch is on. A "removed user scopes" line would show it.
ee5286d to
db50861
Compare
|
Thanks for the quick fixes. Every item from my earlier change requests is resolved on this head. A maintainer now has to approve before this can merge. Status of my earlier items:
My earlier change request is still on record until a maintainer approves. No item in it is still open. What this review checked on this head:
Why a maintainer decides:
To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/). Optional:
|
Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.
c712bf5 to
0faf86d
Compare
0faf86d to
ca5ded6
Compare
ca5ded6 to
508add8
Compare
508add8 to
9b05621
Compare
A sandbox Slack workspace confirmed one app serves both: created from the slack_mcp-on manifest, Install to Workspace issued an xoxb- token and the bot answered a DM, and Connect on the Slack card succeeded with Slack MCP reading DMs and channels. So the Connections guide no longer tells a one-app operator to remove Bot Token Scopes (a separate MCP-only app may still leave them empty), and the docs drop the not-yet-tested caveat. Off, the note under Slack tools for your agent uses the Agent sessions row's words: turning it on changes nothing in Slack yet, and turning it off later leaves the Slack tools setting, sign-in address and extra sign-in permissions on the app until it is edited in Slack. The one-way PKCE step stays at the save step in the update panel. On, the warning box has one heading with the no-card line as its first point. The pill says what is left for Slack tools, and a dropped scope reads "Removed: <scope>". MANIFEST_ONLY_FEATURES names the switches with no bot scope, so a loop over FEATURES skips them by name instead of relying on one REQUIRED_SCOPE guard.
9b05621 to
a017fab
Compare
Problem / Motivation
Goal: One Slack app can serve both Kiro Crew's Slack bot (chat and code channels) and Slack's official MCP server, by turning on one opt-in switch, "Slack tools for your agents", in the manifest Kiro Crew hands out.
Today the generated manifest has no way to turn on Slack's MCP server (
settings.is_mcp_enabled), PKCE or thelocalhostsign-in address the Slack Connections card uses. So a person who wants their agents to read Slack throughhttps://mcp.slack.com/mcphas to edit the app by hand or make a second app. The manifest's user scopes are also an older list (with the legacysearch:read) that does not match what the Slack card signs in with.Why it matters
Slack MCP is the read path for agents to search and read Slack as the signed-in person. Without the switch, every user hand-edits a one-way setting (PKCE) and a scope list that has to match the Connections card exactly, and a mistake fails only at sign-in time.
Not a goal
registry.jsonorcrew_oauth.py. It only correctsdocs/guides/oauth-app-registration/slack.mdfor an app that also runs the bot (see Manual verification).What changed (motivation → approach → change)
Builds on #34811, which added the Slack card under Settings → Connections. The manifest can now carry what that card signs in with.
Off by default, and off changes nothing. With the switch off, every rendered manifest and deep link is byte-identical to main's, user scopes included. With it on, the manifest gains three settings and its user scopes are replaced:
settings.is_mcp_enabledtrueoauth_config.pkce_enabledtrueoauth_config.redirect_urlshttp://localhost:48106/callback, the Slack card's redirectoauth_config.scopes.userrecommended_scopes: 18 read-only scopes, no write scopeTurning it on replaces the legacy user-scope list. Nine of the old ten scopes are in the new list;
search:readleaves the manifest, and nine come in (the granularsearch:read.*,files:read,canvases:read,lists:read). Scopes an installed app was already granted stay on it until the app is reinstalled. A template line can now be gated on a switch being off (#@!slack_mcp), which is howsearch:readrenders only without the switch. It adds no bot scope, event or feature block.Design.
FEATURE_SCOPESmaps each switch to the bot scope it runs on, and the capability probe, latches and runtime gate read it. This switch runs nothing in the gateway, so it stays out of that mapping: it is listed inMANIFEST_ONLY_FEATURES, andFEATURESisFEATURE_SCOPESplusMANIFEST_ONLY_FEATURES. The named set answers the Design Review note: with one entry it is small, but it puts the split in one place, so a loop overFEATURESthat needs a bot scope skips those switches by name instead of relying on a singlein REQUIRED_SCOPEguard, andtest_every_switch_has_a_bot_scope_or_is_manifest_onlyfails if a switch is in neither. Code that loopsFEATURESand needs a bot scope skips the manifest-only switches by name. Everything that renders or diffs the manifest iteratesFEATURES, so the CLI,GET /api/slack/manifest,feature_sets()and the exfil exemption need no change.Scope diff and drift. The manifest diff (
slack_manifest.py) gains added and removed user scopes and added app settings. The Update your Slack app panel lists them as plain lines, never marked held or missing;search:read, which the switch drops, reads "No longer requested: search:read". While such a switch is saved, the pill says what was checked and names the next step, "Slack bot permissions OK · save the manifest in Slack if you haven't", in a neutral tone instead of "Up to date"; the badge wraps instead of clipping on a narrow screen. The note under it starts "Not checked: whether the manifest with Slack tools is saved in Slack", because Slack does not report an app's user scopes or settings. Only while the Slack card is offered does the note add the save as a step to do once. That step and the disclosure say the PKCE point once, in the same words: "Saving it turns on PKCE, which stays on but doesn't affect the bot." The panel's rows read "Permissions people grant (user scopes)" and "Sign-in settings (app settings)", and its copy button reads "Copy manifest", like the first-time setup card.Settings copy. The switch is "Slack tools for your agents". Its description leads with the consent fact ("Nothing is read until someone connects their own Slack account"), then says agents read Slack as that person, private messages and DMs included, and cannot post or change anything. Manifest detail sits in a closed disclosure, which leads with plain words and puts the terms in brackets ("permissions that each person grants when they connect (user scopes)", "a Slack sign-in safeguard ... (PKCE)"). Off, one short muted note that says where the change happens: "This only changes the manifest below. Slack changes when you save it there." Nothing one-way is said on the switch. The disclosure also says that what was already saved in Slack (the Slack tools setting, the sign-in address, the extra sign-in permissions and the security setting) stays on the app until it is edited there. On, a warning box headed "Before you save this manifest in Slack" lists the internal-app, Connect and 30-day points. With no Slack card, its first point leads with what to do and why ("Turn this switch off until the Slack card is on"), and that point links the Connections guide (
src/kiro_crew/docs/connections.md) itself; the disclosure only says why there is no card, with noconfig.jsonhand edit.Shown only when it can be used. The settings GET reports
slack_mcp_card: the Connections gallery is on (connections_ui) and the registry shows theslackentry. The page and settings search (commandPalette/) both read it. A switch already on without the card stays visible with a note. The Slack card shows with the Crew-owned sign-in preview off (the default), so the switch does too.Connections guide.
docs/guides/oauth-app-registration/slack.md(lines 10, 73, 105, 118) no longer tells an operator whose app also runs the bot to remove its Bot Token Scopes. Slack's rule that a PKCElocalhostsign-in cannot request bot scopes limits what the sign-in asks for, and the Slack card asks for user scopes only. A separate MCP-only app may still leave Bot Token Scopes empty.slack-setup.mdandslack-integration.mdsay the same and no longer carry the not-yet-tested caveat.The 17 new strings are in all 12 catalogs (
website/src/i18n/locales/);en-XAis regenerated. The gated lines are insrc/kiro_crew/slack-manifest.yaml, the toggle inpages/settings/SlackCodePanel.tsxandslackCodeSwitches.ts, the panel inSlackManifestUpdate.tsx, the wire types inapi/client/messaging.ts. Config fieldslack.slack_mcp(config/sections_slack.py,section_builders.py),slack-integration.md,slack-setup.md, the slack-gateway spec and the feature map are updated, withsettingsRegistry.gen.ts,ui-indexandconfig-baseline.jsonregenerated.Backwards compatibility
Compatible: with the switch off, the rendered manifest and the app-create deep link are byte-identical to main's for every existing switch combination, so nothing that works today changes. The switch is off by default and a config without the key reads as off.
Reader: src/kiro_crew/security/exfil.py:_slack_manifest_payload_re -- chat -- rebuilds the pattern from
stripped_template()for everyfeature_sets()combo, so the on-state list withoutsearch:readis exempt and a mixed list is not;TestExfilExemption::test_every_combination_link_is_exempt,test_a_payload_mixing_both_user_scope_lists_is_redactedReader: src/kiro_crew/dashboard/slack_code_settings.py:manifest_status -- crew page -- compares bot scopes only, which the switch does not change;
test_slack_code_settings.pystatus tests run every comboReader: src/kiro_crew/cli_setup.py:_manifest -- release -- renders through
slack_manifest.render;test_cli_setup.pyis unchanged from main andTestSlackMcpSwitch::test_cli_and_endpoint_render_the_same_bytescovers the on-stateReader: src/kiro_crew/slack/features.py:REQUIRED_SCOPE -- chat -- still
FEATURE_SCOPES, so latches and availability ignore the new switch;test_slack_features.pyReader: src/kiro_crew/slack-manifest.yaml:oauth_config.scopes.user -- release -- only with the switch on, the manifest stops asking for the legacy
search:read. A search integration configured separately on the same app's user token keeps the scope it was already granted but loses it at its next consent, and the granularsearch:read.*scopes take its place; with the switch off nothing changes;test_user_token_scopes_are_exactly_the_reviewed_set,test_it_changes_no_bot_scope_event_or_featureTests
test_switches_off_keeps_the_pre_toggle_payloadkeeps main's digest (bca5f538…),test_cli_setup.pyis untouched, andtest_user_token_scopes_are_exactly_the_reviewed_setpins the legacy ten for every combination without the switch. A one-off script also compared this branch withorigin/mainfor all 4 existing combinations, with and without comments, 3 aliases and the deep links: 24 renders, 0 different.TestSlackMcpSwitch: for all 8 combinations, with and without comments, off means the legacy user scopes and nois_mcp_enabled, PKCE or redirect; on means exactly the 18 scopes and the 3 settings, with no duplicate. It also checks the on-state drops onlysearch:read, adds no bot scope, event or feature, has no write scope, and that only a realtrueturns it on ("true",1, other-switch combinations). CLI and API render the same bytes. Deep links are exempt for every alias variant (someone,kirocrew,A_b-9,x, a 32-character alias). A partial MCP payload, a widened one (chat:writeadded) and one mixing both scope lists are redacted.test_an_off_gate_renders_only_while_its_switch_is_off: the#@!gate, for all 8 combinations.test_the_manifest_matches_the_slack_connections_card: user scopes, redirect URL and PKCE equal the realslackregistry entry's. It fails if the entry is missing.slack_mcp_cardfollows the registry entry andis_visible, is true on a default config, and is false whenconnections_uiis anything but a realtrue(False,None,"true",1).test_features_are_the_registry:SLACK_MCPis inFEATURESand not inFEATURE_SCOPES.test_every_switch_has_a_bot_scope_or_is_manifest_only:FEATURE_SCOPESandMANIFEST_ONLY_FEATURESare disjoint, together makeFEATURES, and every other switch has aREQUIRED_SCOPEentry.test_a_switch_without_a_bot_scope_passes_every_scope_keyed_readerregisters a second scope-less switch and checks every scope-keyed reader treats both as "cannot run" without raising.test_it_changes_no_bot_scope_event_or_feature: the on-state reportssearch:readas its one removed user scope, and the reverse diff removes exactly what the on-state adds.test_slack_code_settings.py: PUT/GET round trip forslack_mcp. Every catalog'sslack_mcp_detailsstates the live on-state user-scope count (18) andslack_mcp_descstates no number.SettingsSlackCodePanel.test.tsx: hidden with no card while off; shown while on with the no-card line as the warning box's first point, no Slack-card line, noconnections_uiin the box, the Connections guide link (new tab,noopener noreferrer) inside the no-card point, and the disclosure saying why there is no card with no link and noconfig.jsoninstruction. The consent-first description and closed<details>, which carries what stays on the Slack app after turning the switch off. Off: the muted note is exactly "This only changes the manifest below. Slack changes when you save it there.", names nothing one-way ("Slack support", "remove"), and nothing is at warning weight. On: the off note goes and the box has its heading and exactly its points. The "Slack bot permissions OK · save the manifest in Slack if you haven't" pill (no to-do, wrapping classes) with its "Not checked:" note directly under it (and no "every permission" line), the save step worded as a once-only step that says the PKCE point in the same words as the disclosure, no "for good" anywhere, the plain row labels and the "Copy manifest" button, and only while the card is offered, no other "only Slack support" line on the page, the events footnote only when a saved switch subscribes events, the bot-only switch keeping "Up to date", user-scope chips not borrowing a bot-scope "missing", "No longer requested: search:read" without a strike-through, and Copy and Open staying on offer when a feature is workspace-disabled but Slack tools is saved.settingsSearchGovernance.test.ts: search readsslack_mcp_cardandslack_mcpfrom the cached Slack config, withholds the switch only when that read says neither, and issues no request.Manual verification
Run by the owner at about 17:00 UTC on 2026-11-19 in a test Slack workspace, on the owner's own gateway. All three steps passed:
slack.slack_mcpon. Slack accepted the manifest.xoxb-bot token. With thexoxb-andxapp-tokens saved, the bot answered a DM in 6 s.So one Slack app with bot scopes, PKCE and the
localhostredirect serves both the bot and the Slack card's sign-in. The Connections guide is corrected to match (see What changed).Real-machine verification
Machine: the author's own dev host (no EC2 machine was launched), Amazon Linux 2 x86_64, kernel 5.10, 16 vCPU / 61 GiB
Before (main 3688176):
PYTHONPATH=<main worktree>/src python rmv.py->off-state renders: 36, sha256 bfb93ceb6b11e802andslack_mcp switch: absentAfter (head c712bf5):
python rmv.py->off-state renders: 36, sha256 bfb93ceb6b11e802(the same bytes for every combination of the existing switches, three aliases, with and without comments, plus each deep link), and with the switch on the render carriesis_mcp_enabled: true,pkce_enabled: true,http://localhost:48106/callbackand the sixsearch:read.*scopes, with no baresearch:readSlack sandbox (steps 1-3 above): passed, run by the owner in a test Slack workspace on 2026-11-19. From the commit message: "created from the slack_mcp-on manifest, Install to Workspace issued an xoxb- token and the bot answered a DM, and Connect on the Slack card succeeded with Slack MCP reading DMs and channels."
Cleanup: own computer; the detached main worktree used for the Before run is removed
rmv.pyimportskiro_crew.slack_manifest, renders every combination of the switches main already has and hashes the bytes, then prints the MCP lines of the on-state render.Screenshots / video
Frontend-only harness (the real built SPA with stubbed
apianswers, headless Playwright), re-shot on this head.Slack card offered, switch off. "Slack tools for your agents" leads with "Nothing is read until someone connects their own Slack account"; the detail is in a closed disclosure. Under it, one short muted note that says where the change happens: "This only changes the manifest below. Slack changes when you save it there." Nothing at warning weight shows while the switch is off:
The same row with "What this adds to your Slack app" opened: plain words first, with user scopes and PKCE in brackets, and what stays on the Slack app after the switch is turned off:
Switch saved on. The warning box is headed "Before you save this manifest in Slack" and lists the internal-app, Connect and 30-day points. The pill reads "Slack bot permissions OK · save the manifest in Slack if you haven't"; the note under it starts "Not checked:", then gives the save as a once-only step that says what is permanent and what it costs. The update panel lists the added user scopes, "No longer requested: search:read" and the sign-in settings:
Switch on while Connections offers no Slack card (the gallery is turned off), disclosure opened: the box's first point leads with "Turn this switch off until the Slack card is on", and that point links the Connections guide; the disclosure says why there is no card. With the switch off and no card, the row is hidden.
Light theme, switch off
Related Issues
N/A: no tracking issue for this change, at the owner's request. Builds on #34811 (merged), which added the Slack Connections entry this switch's manifest lines match.
Checklist