Skip to content

feat(slack): let the owner share Slack access with named people, off by default - #30760

Merged
kyleseaman merged 2 commits into
mainfrom
feat/slack-shared-access
Nov 18, 2026
Merged

kyleseaman merged 2 commits into
mainfrom
feat/slack-shared-access

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let the owner share the Crew's Slack bot with named Slack users, who then act as the owner. The feature is off by default.

Today the Slack bot answers only the owner (KIROCREW_OWNER_ID). slack.allowed_users, !allowlist and /kirocrew @user exist but do nothing, on purpose: anyone the bot answered would act under the owner's identity and credentials. A team that wants a teammate to ask the Crew something in Slack has no way to allow it, even when the owner accepts that trade.

Why it matters

An owner who trusts a teammate can let them use the Crew from Slack (DMs, mentions, threads) without handing over a dashboard login. The grant is explicit and named. The settings page states plainly what it gives away, and nothing changes for anyone who leaves it off.

Not a goal

  • Per-person execution or narrowing what the agent can reach in a shared user's turn. A shared user's turn runs as the owner. Refusing owner-data tools by requester is follow-up Slack shared access: refuse owner-scoped Crew tools in a shared user's turn #30678.
  • Shared Crew collaborators. The first design routed Slack through Shared Crew. It was dropped because Shared Crew containment is resource limits only (every runtime runs as the gateway's OS account, see rfc-per-person-execution).
  • Reviving slack.allowed_users, !allowlist or /kirocrew @user. They stay inert, and turning the new switch on never admits a stale allowed_users entry.
  • Code channels for shared users. They stay owner-only in v1.
  • Reusing feat(shared-crew): attribute Slack senders as attribution-only principals #22800's Slack principal shape. It is not on main.

Backwards compatibility

Compatible: slack.shared_access is off with an empty list by default, and off is pinned by tests to today's owner-only behaviour. slack.allowed_users, !allowlist and /kirocrew @user keep their current inert behaviour.

The change only adds a config section, routes, a settings section and an allow path behind a default-off switch. Every existing gate keeps its owner-only result when the switch is off.

One definition moves to keep code_channels/routing.py under the line cap: options_answer_permitted now lives in code_channels/shared_refusal.py, with the shared-user refusal this PR adds, and routing.py re-exports it, so every caller keeps importing it from routing. Its readers on main:

Reader: src/kiro_crew/slack/interactions_options.py:_handle_options_several_submission -- chat -- imports options_answer_permitted from routing at call time; the re-export serves it (test_slack_code_channels_options_permit.py)
Reader: src/kiro_crew/slack/interactions_options.py:_handle_options -- chat -- imports options_answer_permitted from routing at call time; the re-export serves it (test_slack_code_channels_options_permit.py)

What changed (motivation → approach → change)

Approach. A plain owner opt-in, decided by Kyle on 2026-11-05 and recorded in the new docs/request-for-change/rfc-slack-shared-access.md (in-progress). It is a deliberate exception to R10 of the accepted rfc-per-person-execution, which says work for an unlinked channel user runs as a guest account or not at all, never as the owner: only people the owner lists and Slack confirms, with the switch on (a turn already running finishes as the owner after a removal). Everyone else stays under R10. The RFC's "Relation to rfc-per-person-execution R10" section records this.

Config. SlackSharedAccessConfig in config/sections_slack.py, built by _build_shared_access in config/section_builders.py and wired in config/sections.py: slack.shared_access.enabled (default false) and slack.shared_access.user_ids (default []); config-baseline.json is regenerated.

The gate. is_allowed_user stays owner-only, as on main. The sites that admit a shared user on purpose ask is_allowed_user(x) or is_shared_user(x) (slack/handler_runtime/access.py); a test pins that list, so every other reader refuses shared users by default.

  • An ID counts only after users.info confirms it against auth.test (same workspace, a person, active, not the owner); slack/shared_access.py caches a pass 10 minutes, a refusal 1.
  • The switch and the list are read on every event, so a removal or switch-off stops the person's next message.
  • Refusals inside an admitted turn (/ commands, run, cron, code channels) test is_shared_listed (listed, or admitted as shared earlier in this process), so neither an aged confirmation nor a mid-message removal gets past them. Code-channel refusals hold with Slack Code on or off, revoked bindings included, and cover the workers a code channel's own session dispatches (feat(slack): let a code channel's own session dispatch its workers #22001, bindings.worker_conductor).
  • The code-channel inbound refusal lives in slack/code_channels/shared_refusal.py (shared_sender_dropped, re-exported from routing.py), which keeps routing.py under the 2,000-line cap.

What a shared user can do. They drive work in DMs, mentions and threads: !stop and the Stop button (not in a code channel), !title, !compact, question cards, the review-mode draft of their own turn, and the tool prompts their own turns post.

  • Each prompt carries its requester (_PendingApproval.requester, SlackApprovalDecider.requester_for()). A shared user can't answer someone else's prompt and never grants Trust.
  • Prompts on linked dashboard slots stay owner-only.

What stays the owner's is the table under "Owner-only line" below.

Queue and modals. A queued entry records whether its sender is listed; the drain asks Slack again and drops it if access ended. Every modal submission refreshes the confirmation in handle_view_submission first.

Dashboard. dashboard/slack_shared_access.py adds GET/PUT /api/slack/shared-access, POST /api/slack/shared-access/users and DELETE /api/slack/shared-access/users/{user_id}.

  • All four routes are owner-gated (require_owner_dashboard_request). Writes also need a direct local request.
  • Turning the switch on needs confirm: true; otherwise the route returns 400 confirm_required.
  • A write the live config didn't apply returns 409 not_applied, and GET reads the live config, so the page shows who still has access. Every refusal carries a code.
  • Settings → Slack gets a Share Slack access section (SlackSharedAccess.tsx, client calls in api/client/messaging.ts and api/client.ts). It loads as its own chunk through lazyRetry (SlackPanel.tsx), which keeps the Settings page chunk under its size budget; if that chunk fails to load, a one-line notice with Try Again takes its place (the raw load error is read out to assistive tech, never printed) and the rest of the Slack form stays as typed. The warning shows before the switch can be turned on and stays while it's on. Turning on needs everyone listed (apart from the owner's own ID) to be confirmed by Slack; the switch says who isn't and why, and the confirm counts and names the people who get access. After the confirm, the page reads the list from the server again and turns sharing on only if it is the list the owner just confirmed. Strings are under pages.settings.slackSharedAccess.* in website/src/i18n/locales/*.json (12 locales plus en-XA); the confirm's two plural keys are registered in pluralKeys.json.

Audit. Every admission and refusal is a security event log row with the Slack user ID and no message text; list and switch writes log slack.shared_access.switch|add|remove.

Docs. The Access control section of slack-integration.md gains "Sharing Slack access". The change also adds rows to configuration.md, the feature map and the RFC index, and updates the Slack trust row in security-deep-dive.md and the access notes in the slack-gateway.md and messaging.md specs.

Owner-only line

This split is a judgment call, and Kyle can widen it:

Control Why
The switch and the list (dashboard only, loopback only, never an app token or internal caller) Only the owner grants access
Trust, YOLO and approval-mode changes; answering another person's prompt Each widens what runs without the owner
!dashboard and other dashboard links A link is full dashboard access
Every other ! command (!channel, !agent, !ta, ...) and /kirocrew Channel activation, agent overrides, settings
A message starting with /, including a question-card answer whose label starts with /; !temporary / !incognito Harness commands (/agent, /model, /tools trust-all): the harness reads a leading / as a command whatever the Crew's interpret_commands says, so the / refusal does not depend on it. Privacy modifiers keep a turn out of the owner's record; they are judged only where interpret_commands reads them, so never on a card answer
The Home tab, the sessions list, and the spawn list and status keywords They list every session or subagent, or count the host's
run and natural-language cron keywords Scheduling and task runs
Code channels, including answering a card in one Owner-only for v1
Every other button Settings, sessions, resume, links, the allowlist

Security

A shared user acts as the owner, and the agent is not narrowed in their turn (decided 2026-11-05, option A). Tools run under the same approvals as the owner's turns, and the shared user answers their own turn's prompts. So the Crew tools the default agent runs without asking reach the owner's data for them:

  • list_sessions, search_chat_history, get_chat_session (with all_workspaces): read the owner's other conversations.
  • memory_recall, learn_add / learn_remove, memory writes: read saved memory and change what Kiro remembers. A lesson they add reaches the owner's later sessions.
  • artifact_*, workflow_run, spawn_run, cron tools: read and change artifacts, run work, manage schedules.
  • Shell and file tools with the sandbox off: edit config.json, this list included. With the sandbox on, config.json is sealed read-only.

The settings warning says this in five plain bullets: they can drive work as you with your files, Git and cloud credentials and connected tools; they can see and act in any thread they're part of; they can read your other conversations and this Crew's saved memory and change what this Crew remembers; they can't start runs or schedules by typing a command, but while the agent works on their messages it can still create schedules and start tasks as you, and a schedule it creates keeps running as you after you remove that person, and it names the Schedule page, where it can be deleted; only add people you trust. Refusing these tools when a turn's requester is a shared user is follow-up #30678. It needs the requester carried into the tool gate (SCR-watched hook code), so it is left out of this PR.

Also left as is on purpose:

  • A shared user can Stop any turn in a thread they're in.
  • Messages queued on a linked dashboard slot still run.
  • OPTIONS answers pinned to the asker still reach the owner's dashboard session in linked threads.
  • After a restart, inbound spool replay sends a shared user still on the list the restart notice for their own interrupted message, in the conversation it came from. Replay's pass-local SlackTransport admits the listed IDs for that notice only (shared_access.listed_ids, none while the switch is off); replay starts no turn.

Known limit: Enterprise Grid. A listed ID counts only when users.info gives the same team_id as the bot's auth.test. On an org-wide Enterprise Grid install, a person whose home workspace differs from the one the bot token reports is refused, and the settings page lists them with "This person is in a different Slack workspace.", even inside the same org. This fails closed: the person gets no access. Matching on enterprise_id instead is left for a follow-up if a Grid owner needs it.

Sensitive change review: none needed. The diff touches no SENSITIVE_GLOBS path, which I checked with sensitive_files() from .github/scripts/sensitive_change_review.py. It adds no rows to security_posture*.py or exfil.py.

Tests

Proof: not provable -- other: feat PR adds a new capability behind a default-off switch, so there is no fix to revert

  • test/test_slack_shared_access.py (47 tests) covers the following. With every production hunk reverted, the 8 core admission and refusal tests all failed.
    • Defaults, and parsing of the switch and the list.
    • Off stays owner-only and calls Slack for nobody; a stale allowed_users entry is never admitted.
    • Slack confirmation: workspace, person, deactivated, unknown, or unreachable; the owner on the list is never a shared user.
    • A removal or switch-off applies on the next event, and the cache is re-asked once old.
    • Own-prompt only, and never Trust, for both transport prompts and Slack prompts.
    • A / command or privacy modifier is still refused once the confirmation has aged out.
    • Button allow-list and the refusal reply; dashboard links, owner commands, schedules and task runs refused; harness / commands and privacy modifiers refused before the turn.
    • Queued messages dropped when access ends but kept when only the cache aged out.
    • Review drafts after removal; every modal submission re-checked.
  • test/test_slack_shared_access_routes.py (12 tests): after an unapplied removal the page still shows the live grant; every route is owner-gated; an app or internal caller and a remote session change nothing; turning on needs the confirm; an add is kept only once Slack confirms it; a removal is stored and audited by ID; a re-listed ID is checked again; an unapplied write isn't reported as done, and its 409 names slack when that section was unreadable, never a file or a value.
  • website/src/test/SettingsSlackSharedAccess.test.tsx (35 tests): sharing doesn't turn on while anyone listed is unconfirmed (the page names them and says to remove them or fix what each row says), so the confirm only ever names confirmed people, and it won't open when Slack confirmed nobody; the warning shows while off and stays while on, including that the agent can still create schedules and start tasks as you, naming the Schedule page in bold, with no link, in the warning and the confirm; turning on needs a confirm that names who gets access, a cancel changes nothing, turning off needs none, and with nobody listed it doesn't turn on; each person is listed by name, with the reason first when Slack didn't confirm them, and the owner's own ID gets no "can't use" line, neither blocks turning on nor appears in the confirm; a row gives the reason first, then, in warning text, that they can't use the Crew now and get access without asking the owner if Slack says the account is fine at their next message; while off, a row gives only the reason; a line at the switch says the state in words (off: nobody below can use the Crew, and the list is titled "People to share with"; on: the people Slack confirmed can, under "People with access"); the owner-only line is hidden on a remote session, and a remote viewer's row never says to remove someone; a check that failed (Slack unreachable) shows as an error notice in the list, saying when the page asks Slack again, while Slack's own verdicts stay plain status text; a malformed ID is refused locally, with how to find a member ID; the not-applied notice says the earlier list and switch are still in effect, says in plain words when the Slack settings could not be read, and sits under the switch and opens with the state in effect and the change that was saved ("Sharing is still on: turning it off is saved but not applied yet.", or the person added or removed), then why and what to do; after the confirm the list is read from the server again, and a change the page had not shown yet, a refetch that left before the click, a failed read, the owner's own ID turning into someone else's, leaving the page during the read, or another window having turned sharing on sends nothing, and while it reads the switch is busy (it keeps its tab stop) and Add and Remove are held, so one change is sent (each fails on 6d9044092e); a hint at the switch drops once the list no longer says so; a failed load offers Try again and re-reads the section; read-only on a remote session; inside the Slack panel, a failed load of the section keeps the form and its typed values, prints no raw load error (fails on the block layout), and Try Again loads it (fails on a plain lazy + Suspense version).
  • test/test_slack_shared_access.py: a person removed (or sharing switched off) while their message is in flight is still refused the owner-only controls (fails without the fix).
  • test/test_slack_code_channels_events.py: with Slack Code off, a shared user can't answer a card, mention the bot, reply in a linked thread or Stop in a bound or revoked channel; an unreadable store refuses them.
  • test/test_slack_shared_access_code_channel_surface.py (32 tests): a shared user runs no code-channel command, can't archive, rename or Stop there, can't reach a code channel's session through a linked thread, a pinned answer or any spelling of its key, including a worker that session dispatched (feat(slack): let a code channel's own session dispatch its workers #22001); quarantined and revoked rows stay fenced. A plan-canvas comment (feat(slack): code-channel bar actions, canvas comments, view tabs #22370's read-back) from a shared user, a listed but unconfirmed ID or an unlisted one is refused, audited and not read again, with the feature on or off, and the route the read-back uses refuses a shared user on its own. Neither the context bar's Stop nor Slack's own Stop at the channel root lets a shared user stop the channel's session, with Slack Code on or off.
  • test/test_slack_shared_access.py: is_allowed_user refuses a confirmed shared user, and only the named sites call is_shared_user.
  • test/test_slack_inline_stop.py: a shared user's Stop button stops their turn, except in a code channel.
  • test/test_slack_events_coverage.py: a listed person whose confirmation aged out between the two reads is still refused /kirocrew dashboard (fails without the fix).
  • website/src/test/settingsCoverage.test.ts: the new section is mapped for settings search (scripts/settingsExtract.ts; regenerated settingsRegistry.gen.ts, settings-registry.generated.json, ui-index.generated.json) and its draft input accounted for.
  • Updated tests: test_slack_handler_composition_contract.py (shape digest), test_slack_post_message_call_sites.py (dispatch.py 10, transport_dispatch.py 5), test_ssm_loopback_trust_sites.py (dashboard/slack_shared_access.py: 1), test_slack_code_channels_events.py, test_slack_events_coverage.py, test_interactions_approvals.py, test_review_mode.py, test_config_refactor_contract.py, test_action_interactions.py, test_slack_agent_session_stop.py, test_slack_gateway_channels.py, test_slack_options_one_click.py, test_slack_reconnect.py, test_stop_clears_only_its_own_sender_slack.py.
  • Local runs, oldest first (the review rounds and their heads are under "Review notes handled"):
    • Before the rebases onto feat(slack): code-channel bar actions, canvas comments, view tabs #22370 and fix(slack): use plain words instead of emoji in slack messages #38837: changed tests plus every test importing a changed module (1,140 files): 51,671 passed, 72 failed. All 72 also fail on the clean base (test_kas_bundle, test_decisions_sagemaker_provider, test_terminal_commands, test_cli_stt_memory_doctor, test_cli, test_kas_cli_floor, test_bedrock_kb_connector), none from this change.
    • Repo-wide scanning gates plus every test naming a changed file (271 files): 12,277 passed, 2 failed, both test_codex_session_mcp.py tests that also fail on the clean base.
    • vitest related to the changed website files: 57,302 passed (3,652 files); i18n register style tests: 114 passed.
    • After the rebase onto feat(slack): code-channel bar actions, canvas comments, view tabs #22370 and fix(slack): use plain words instead of emoji in slack messages #38837: every test/test_slack*.py, the shared-access suites, the ratchets in PR mode and the config and settings tests (237 files): 8,570 passed; the changed test files three more times, 306 passed each; all 21 Fast Gate steps, Semgrep's diff scan and the agent-SDK boundary check pass.
    • Pushed head 137482b60f on main fb1d703759: backend on b484461645 (base 77091ea555): the 20 changed test files (999 passed), every ratchet and tree-scan test in PR mode (234 files, 12,864 passed, 14 skipped), the process-cache-floor ratchet, the prepush static gates, the file line cap, all 22 Fast Gate steps, Semgrep's diff scan and the agent-SDK boundary check; web on b484461645: the changed web tests three times (237 passed each), i18n style tests (1,270 passed), i18n:check, tsc, eslint and the bundle size gate; vitest related to the changed web files on 16f86ea358 (3,695 files, 57,842 passed). After the rebases onto main's ladder, config, catalog and conftest changes: the ladder, section-builder, web-ask and changed test files (66 files, 4,228 passed, on 137482b60f), the web tests, i18n style (1,270 passed), i18n:check, tsc, eslint, the file line cap, all 22 Fast Gate steps, the prepush static gates and Semgrep on c3ed531024.
    • Final content 380379b7b7 on main f99b644158 (the ErrorNotice fix on top of 137482b60f, checked on 0670cb897d; after the '=' rebase onto main's config-loader change, the config-loader, shared-access and torn-config test files: 23 files, 1,319 passed): the Share Slack access and Slack panel tests, settings coverage and API surface (237 passed; the three not-applied tests fail on 137482b60f), i18n style tests (1,270 passed), i18n:check, tsc, eslint, the file line cap, the bundle size gate and the 13 screenshots.
    • Per-file coverage: the three new files measure 89.6% to 94.8% on the focused Slack/config set; every changed file stays at or above 87.9% when that run is combined with main's CI coverage for unchanged lines.
    • isort, flake8, black gate, mypy (changed files), comment-history, brand name, feature map, changelog and decisions history, docs-lint and its self-test, file line cap, the portability scan and generator drift checks all pass.

Manual verification

  • Ran the built SPA against a mocked API with website/scripts/capture-slack-shared-access.mjs and checked each of the 13 captured states by eye (see Screenshots).
  • Not done: a live Slack workspace run with a second real account.

Screenshots / video

Turning sharing on confirms with the people Slack confirmed, by name:

Confirm with two confirmed people

With nobody listed, the switch doesn't turn on and says what to do:

Empty list hint

Off with the warning, on with two people, a malformed ID, and the read-only remote view

Off, warning shown

On with people listed by name

Malformed ID hint

Read-only from a remote session

Slack confirmed nobody, a person Slack could not be asked about, the switch refused while someone is unconfirmed, saved but not applied, a failed save, a failed load, and the chunk-load Try again notice

None confirmed hint

Unverifiable row

Refused while someone is unconfirmed

Saved but not applied

Save failed

Load failed

Try again when the section's chunk fails to load

Review notes handled

On 70318715e0:

  • First Principles (block): is_slack_user_id now validates through USER_ID_RE from validation_parts/input_bounds.py, the pattern the messaging schemas use; its own character set is gone. A probe table (valid U and W, lowercase, empty, U alone, 20 and 21 characters, a trailing newline, spaces, non-ASCII letters and digits, non-strings) gives the same answer as the old loop on every probe, and test_a_member_id_is_what_the_messaging_schemas_accept pins it.
  • UX (block): the warning and the confirm now say how to stop a schedule left running: open Schedule (the page's own nav label) and delete it. The page is named in bold, not linked: the warning sits in the Slack settings form and its confirm, and a navigation away would drop the form's unsaved tokens and fields (no settings page has a leave guard).
  • UX (notes): the tools bullet is in plain words ("They can't start runs or schedules by typing a command") and keeps every risk it named; "won't get access" shows the same name and ID as the person's row and says "for now": they stay on the list and get access if Slack confirms them later, so remove them to keep them out (the row's line says "yet" too); the read-only line says "the computer where Kiro Crew is installed (not this remote session)".
  • UX, local lane on 0b3c0110d9 (block, off state): while off, "Off: no one below can use this Crew from Slack." sits at the switch and the list is "People to share with"; "People with access" only while on. Search lands on the switch; the list keeps its data-setting-key anchor in both states. Not taken (a later lane's note, asked again on cddef2b55f): one heading in both states; the conductor ruled for the two headings above.
  • UX, local lane (block, a refused person's later access): the row and the confirm give the reason first, then, in warning text (never muted), that the person can't use the Crew now and gets access without asking you if Slack says the account is fine at their next message (it asks again after a minute). While off, a row gives only the reason, since a Slack answer gives nobody access then. Not taken: a Remove button inside the confirm. Removal is a saved server call, and running it inside a pending confirm adds a mutation, an error state and a live list to that dialog, a new interaction that needs its own review. The confirm no longer lists them at all (see the next round); the row keeps "Remove them to keep them out" beside its own remove button.
  • UX, local lane (notes): "after you remove that person"; the owner-only line is in plain words and hidden on a remote session; screenshots added for every evidence gap, including the chunk-load Try again notice.
  • UX, local lane on a5af3b4980 (block, not applied): the notice now says the change is not applied yet, that Slack still uses the earlier list and switch so anyone who had access still has it, and that the change is saved. (Corrected on 9ab098de9c: it applies after a restart, not on its own; see below.) Note: a failed load of the section now has Try again, which re-reads it.
  • UX, CI on 9ab098de9c (block, the confirm named a person it then told you to cancel for): the page doesn't turn sharing on while anyone listed is unconfirmed. The hint at the switch names them and says to remove them or fix what each row says, so the confirm only ever opens with people who get access, and its count and names agree. The hint is worded from the list as it is now, so it drops a name once that person is removed; a list holding only the owner's own ID reads as nobody listed; and if a refetch changes the list while the confirm is open, the confirm does not turn sharing on and says the list changed. This is a UI guard: the server's switch route, its confirm requirement and config.json handling are unchanged, and the gateway still admits only IDs Slack confirms. No Remove action in the confirm, for the reason above.
  • UX, CI (notes): "Slack hasn't confirmed anyone on the list. Remove them below, or ask them to reactivate their Slack account if it is deactivated; each row says why Slack hasn't confirmed it." (the lane's words, plus the condition, since not every reason is a deactivated account) Not taken: a "Check again" button. The only call that re-asks Slack now is the add route, which would write an add audit row and rewrite config.json for someone already listed. Instead the row says what the code does: the page asks Slack again when it is reopened or regains focus, and an answer can be up to a minute old (a refusal is cached for 60 s when the page's client is the gateway's own bot). The not-applied notice names what Kiro Crew could not read (in plain words since 6d9044092e, see below): the 409 carries unread, ["slack"] when this process once read the slack section as unreadable (the one observation the Slack watcher waits on; names only, never a value). Then it says to restart, because the loader keeps that observation until the gateway restarts (config/resolution.py). Otherwise it promises no restart: it says another setting, such as the same one in config.local.json, still holds the earlier value, and that The switch and the list show what is in effect.
  • Design (note), not taken: linking Slack shared access: refuse owner-scoped Crew tools in a shared user's turn #30678 from the settings warning would put a GitHub issue link in the product's UI. The RFC's R10 section names Slack shared access: refuse owner-scoped Crew tools in a shared user's turn #30678 instead.
  • Design (note): the description was cut at the 8,000-byte capture before "Backwards compatibility". That section now sits right after "Not a goal", inside the capture.

Since 9ab098de9c (the UX round), folded into the second commit:

  • Backend Tests (CI on 9ab098de9c, facade red): config/sections_slack.py imported USER_ID_RE at module level, so test_sections_facade.py found an owner name the config.sections facade does not bind. The import now sits inside is_slack_user_id, so the facade and its frozen import inventory are unchanged and the assertion is as strict as before. The local gate set missed it because it ran four named facade tests but not test_sections_facade.py; it now runs every test/test_*facade*.py.
  • Frontend Tests (CI, fr): the fr strings use U+202F before : ; ! ?, as the fr style test requires.
  • GPT, local lane on 6d9044092e (block, the post-confirm check read the cache): after OK the page now reads the list from the server, and sends nothing unless it is exactly the list the owner confirmed, by ID, confirmation and reason. A failed read sends nothing and shows the load-failed notice with Try again.
  • GPT, local lane on a6d7476c52 (block, writes could start while the list was read again): while that read is out, the switch, Add (button and Enter) and Remove are busy, so no second confirm and no list write starts under the answer being checked, and one change is sent. A refetch already in flight is cancelled first, so the answer can't predate the click (Opus), and leaving the page during the read turns nothing on.
  • UX, local lane on 5ce9f1d49a (block, the switch showed On beside "What you saved: turn sharing off"): the not-applied notice now sits under the switch, not at the foot of the section, and opens with the state in effect: "Sharing is still on: turning it off is saved but not applied yet." (or off/on, or "Ada is still on the list Slack uses: removing them is saved but not applied yet."). The cause and what to do follow as a second line, which names the settings file. Notes: Slack's check is "verified", so it no longer shares a word with the confirm dialog ("the people below that Slack verified", "while Slack hasn't verified someone on the list"); the owner-only line is "Only you can change this list or switch, approve tool prompts for a whole session, or use Slack Code channels." Not taken: removing Reload page from the chunk-failure notice. That notice is the shared lazyRetry inline layout, so dropping the button or warning about unsaved fields is a new control in a shared component, outside this PR; Try Again, which keeps the form, comes first.
  • GPT, CI on 137482b60f (block, errors-use-error-notice): the not-applied notice under the switch now renders through ErrorNotice (title: the state in effect; message: why and what to do), so a rejected request reads as an error, in the same place. Every other value from a rejected request on this page already goes through ErrorNotice (a failed save or add, a failed load, a failed Slack check in a row); the switch hint and the member-ID hint come from the list and local validation, not from a request.
  • UX, CI on 137482b60f (PASS), notes deferred to a follow-up (lead ruling, 15:40Z): each needs new strings in all 13 catalogs and new screenshots, and would risk another UX round on a head where UX passes. (1) save_failed is one message for the switch, add and remove: name each change ("Could not turn sharing off", "Could not add U...") next to its control. (2) The on-state row of a person deactivated after sharing was turned on should say so ("Deactivated since sharing was turned on; Slack blocks them until reactivated."). (3) "Slack verified" / "Slack hasn't verified": no row is ever marked verified; add a "Verified" tag on confirmed rows or reword.
  • UX, local lane on 0670cb897d (PASS), notes deferred with the three above (same reason): (1) not_applied_unread should lead with the action ("Restart Kiro Crew to apply it; you don't need to change the switch again."), the config.local.json check second. (2) A failed switch save should show under the switch, the way the not-applied notice does (with note 1 above). (3) Keep the find-a-member-ID help visible under the Add field when the list is not empty.
  • UX, local lane on d8c1c85393 (PASS, the blocker above answered; notes): the restart line says where config.local.json is: "(first check the slack section of config.local.json in the Kiro Crew data folder)". Not built (each needs new logic, which this round takes no further): putting "until you restart" in the bold line, because only the unread case is fixed by a restart, so it needs its own branch and keys; naming the change in a failed save ("Could not turn sharing off"), because the generic failure would need a per-change message.
  • Opus, local lane on 8fa81f8c10 (minors): the capture script waits for the current copy; a 409 on turning sharing on is tested too; the CJK space between joined sentences is gone with the two-line notice.
  • UX, local lane on 647da76607 (PASS, notes): an "On: the people below that Slack confirmed can use this Crew from Slack." line sits where the off line does; the pending hint opens "You can't turn sharing on while someone on the list isn't confirmed by Slack."; a not-applied notice names the saved change (reworked on 5ce9f1d49a, below).
  • Opus, local lane on 647da76607 (minor): the docs' memory sentence says "this Crew's saved memory, and change what this Crew remembers", as the page does.
  • UX, local lane on cddef2b55f (PASS, notes): the owner-only line and the memory bullet use the labels the product shows and "this Crew": "press Trust session on a tool prompt, get a dashboard link from Slack, change channel settings, or use Slack Code channels"; "this Crew's saved memory, and change what this Crew remembers". In the read-only view a row no longer says "Remove them to keep them out" (there is no Remove there). One heading in both states: not taken, see the 0b3c0110d9 entry.
  • GPT, local lane on cddef2b55f (minor): the re-read tests run with the app's never-stale cache, so they fail if the read's staleTime: 0 is dropped.
  • Opus, local lane on a71ea1c77f (minors): the switch is marked busy, not disabled, while its own change is checked or written, so it keeps its tab stop and is announced as busy; a re-read that finds sharing already on (another window) writes nothing.
  • Opus, local lane on a6d7476c52 (minors): the section is its own row of the Slack card, so the one-line load-failure notice sits in a padded row; the docs line says "remove them, or fix what their row says"; the focus test now proves the in-flight refetch case.
  • UX, local lane on 6d9044092e (block, the not-applied notice left the switch unexplained): it no longer shows the raw (slack) key, says "could not read its Slack settings", and ends "The switch and the list show what is in effect." Notes: the pending hint says "Remove {{names}}, or fix what each row says"; a malformed ID's hint carries how to find a member ID, which the empty-list help no longer shows once anyone is listed; a failed chunk load uses the inline layout, so the raw load error is read out and shown on hover, never printed.
  • Opus, local lane on 6d9044092e (minors): the "add someone first" and "nobody confirmed" hints hold only while the list still says so; zh-CN not_applied gets its full first sentence back; the 409's error string and the _live_matches docstring name the real causes (config.local.json overrides it, or the slack section was unreadable); the focus test restores focus in onTestFinished.

Related Issues

Part of #22759. Follow-up: #30678 (refuse owner-scoped Crew tools in a shared user's turn).

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

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners November 5, 2026 20:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 380379b7b773bf92b02b4a99d0e139a8eaa00aa0 — 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

The switch ships off, so this is not a product-shape change. But it carves an exception to accepted R10, and the only record of that decision is an RFC this same diff adds.

Notes

  • Item 2 — inherited: "decided by Kyle on 2026-11-05 and recorded in the new docs/request-for-change/rfc-slack-shared-access.md" sets aside accepted R10 ("It never runs as the owner"). On the base list that RFC does not exist, so it reads as draft. The decision itself has no record on base.

What this change ships

Inventory (10 items) — 10 justified

Intent: let an owner who trusts named teammates let them use the Crew from Slack, off unless the owner turns it on. ADDITION.

  1. Settings → Slack gains a "Share Slack access" section with a switch, a member list and a warning — justified
  2. Listed, Slack-confirmed people can message the bot and act as the owner — justified
  3. Turning the switch on needs an explicit confirm that names who gets access — justified
  4. Owner-only dashboard API for the switch and the list, writes loopback-only — justified
  5. New config keys slack.shared_access.enabled / user_ids, default off and empty — justified
  6. Tool prompts carry their requester, so a shared user answers only their own prompts — justified
  7. Slash commands, run, cron and code channels refuse shared users — justified
  8. A queued message or modal from a removed person is dropped on the next check — justified
  9. Admissions, refusals and list edits log a security event — justified
  10. Confirmations are cleared when the bot reconnects to a new workspace — justified

[FIRST-PRINCIPLES-REVIEWED] 380379b

Description read

[DESCRIPTION-READ] acbb2ed5aa5e465cfe8feef713f9f3d51e00b58eedcf3e004bcdac9f48349b6e

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks. The opt-in is off by default and only admits people the owner names and Slack confirms, and the PR records why it departs from R10. The move of options_answer_permitted keeps its readers working through the re-export, and no test pinning the opposite behaviour is weakened.

Notes

  • The R10 exception is a maintainer decision that sits only in an RFC marked in-progress. Adding a docs/decisions/ entry would stop a later review from treating "shared user runs as owner" as a regression to fix.
  • is_shared_listed treats "admitted as shared earlier in this process" as listed, so that state is lost when the process restarts. Once Slack shared access: refuse owner-scoped Crew tools in a shared user's turn #30678 lands, the requester should be the only thing deciding what a shared user may do.

[DESIGN-REVIEWED] 380379b

Description read

[DESCRIPTION-READ] 6f165a5d1b82b3b153fea09068c0b5b6853999b1785e7552f9dbfda94eb9c49b

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

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

UX-Verdict: PASS

cannot evaluate: missing the confirm dialog that turns sharing on. That dialog is the only way to grant access, so it is the PR's main path, and none of the eight screenshots shows it.

Evidence gaps

  • Turn-on confirm dialog. Its strings are confirm_title_one/_other ("Let {{count}} person act as you in Slack?"), confirm_label_one/_other and the named-people list (SlackSharedAccess.tsx:289-299). No shot shows it. A screenshot of the dialog with 1 and with 2+ confirmed people would close this gap.
  • Empty list state. people_empty ("No one yet. To find a member ID… Copy member ID.") is in no shot. The blind reader asked exactly this: "I don't know where to find someone's ID". A screenshot of the empty list would close this gap.
  • Normal on state. Sharing on, everyone confirmed, list editable (Ada only, no warnings) is never shown. Every "on" shot carries an error or is read-only. A screenshot of that state would close this gap.

Notes

  • Shot-05: the reader could not tell "which one is true" between the switch showing on and the text "turning it off is saved but not applied yet". They also could not act on "config.local.json". Lead with the action: "Restart Kiro Crew to turn sharing off."
  • Shot-06: "Could not save the change. Try again." does not say which change. The reader asked "what to retry". Name the change (switch, adding someone or removing someone).
  • The list heading flips between "People with access" and "People to share with", and Grace's note changes length from shot to shot. The reader saw these as unexplained differences. Use one heading in every state, and one version of Grace's note.

[UX-REVIEWED] 380379b

Description read

[DESCRIPTION-READ] 141c98d60ee4ba46673676d709e363ff16b07d1cccc11c0c798c5623f2da767f

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 380379b7b773bf92b02b4a99d0e139a8eaa00aa0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 380379b

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

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 380379b7b773bf92b02b4a99d0e139a8eaa00aa0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 380379b

Verdict parsed from the review's SHA-scoped output markers for commit 380379b7b773bf92b02b4a99d0e139a8eaa00aa0.

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 5, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes on head 88566c8. The feature itself is accepted: an owner opt-in, off by default, that lets named people drive the bot from Slack. I read the product code in the diff (config, the shared_access module, the Slack event, dispatch, queue, approval and modal paths, and the dashboard routes), not every test or locale line. Three things need to change.

  1. A shared user can get past an owner-only refusal. shared_command_refused in slack/shared_access.py asks handler.is_shared_user(user_id), which needs a fresh Slack confirmation (600 seconds). A listed person whose confirmation is 598 seconds old is admitted in _route_message, then a file download takes a few seconds, the confirmation ages out, and shared_command_refused returns False. The owner-only / harness command or the !temporary or !incognito modifier then rides into the admitted turn. The Opus review describes the same path. The diff already defines is_shared_listed, which does not need a fresh confirmation, for exactly this kind of refusal gate. Please use it here, as the cron and task-runner gates do, and add a test that ages the confirmation out between admission and dispatch and still sees the refusal.

  2. Keep is_allowed_user owner-only, as on main. Widening it to "owner or shared user" means every owner-only site must remember to add and not is_shared_user(...). The diff does that by hand at the Home tab, the sessions keyword, the slash command, !dashboard, the message shortcut, code channels and trust, and any reader it does not touch now admits shared users without anyone deciding it. The Design Review names three: runs_script_hooks (the owner's hooks would run on a shared user's DM), send_message with target_user in dashboard/handlers/messaging.py, and the stop and kill buttons in interactions_sessions. Please add a separate check, default deny, for the sites that are meant to admit a shared user (message routing, their own requester prompt, the queued re-check, modal submissions), and leave is_allowed_user alone.

  3. The Static Ratchet Gate is red on test_error_code_contract: slack_shared_access.py: dynamic_status 0 -> 1 (lines [47]). Line 47 is the _deny helper, which builds its error response with a status and an optional code that defaults to empty. Several callers pass none: the 403 write refusals in the switch, add and remove routes, both "invalid JSON" answers, and "enabled must be a boolean". Please make code a required argument of _deny and give each of those answers a lower_snake id. Do not regenerate the baseline.

Smaller notes: Backend Lint & Type Check and Await Fast Gate are also red on this head (I did not read their logs), and the Opus review points out that the Slack gateway and messaging specs were not updated for the new trust model.

I will review again once these are in.

@kyleseaman
kyleseaman force-pushed the feat/slack-shared-access branch from 88566c8 to d9a68e1 Compare November 5, 2026 21:20
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 5, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-shared-access branch from d9a68e1 to 142c673 Compare November 5, 2026 22:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Nov 5, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Checked head 142c673 against my change request. Two of the three points are resolved, thank you: shared_command_refused now asks handler.is_shared_listed, so an aged-out confirmation can no longer let an owner-only command through, and _deny in slack_shared_access.py now takes a required code.

The second point is still open. is_allowed_user still returns "owner or shared user", and each owner-only site must add its own is_shared_listed check. The diff covers more sites now (for example send_message with target_user, the profile read and the Home tab), but the readers the Design Review named, the owner's script hooks and the stop and kill buttons, are not in this diff, so they still admit shared users by default. A separate default-deny check for the places that are meant to admit a shared user, with is_allowed_user left owner-only, would close that for every reader.

The branch now also conflicts with main, so please update it onto main. The new head's checks are still running, so I have not seen the lane results yet.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 5, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-shared-access branch from 142c673 to ba6a9be Compare November 5, 2026 23:29
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Nov 5, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed at 69853ab. Thank you: point 3 of my change request is now fixed. is_allowed_user is owner-only again, and the sites that should admit a shared user ask the new is_shared_user on purpose, so every other reader stays owner-only by default. The branch also merges with main again.

Four items from this head's CI block the merge:

  1. Line budget test (Backend Tests (3.12, 2)): test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget reports the package grew past its budget. Please move the new lines out of that package, or shrink them, so the budget holds.
  2. Docs path test (Backend Tests (3.12, 4)): test_docs_settings_channel_paths.py::test_channel_settings_paths_go_through_messaging_channels asks for Settings → Messaging Channels → <channel> wording, since there is no per-channel Settings tab.
  3. GPT 6.1 (upheld), slack/handler_runtime/dispatch.py:128: an OPTIONS answer such as /workspace from an admitted shared user reaches shared_command_refused even though _answer_options calls handle_message with interpret_commands=False, so the card shows the answer but the agent never gets it. Please skip that refusal when commands are not interpreted.
  4. Opus 5.5, slack/interactions_sessions.py:550: the inline Stop gate checks only for a live binding, so a shared user can still press Stop from a code channel that was revoked. Every other shared-user code-channel gate in this PR refuses revoked channels; please make this one match.

Once these are in and CI is green, I will approve.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-shared-access branch from 69853ab to 5c2dc7b Compare November 6, 2026 19:07
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 6, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed at 5c2dc7b. Thank you, two of my four points are fixed:

  • The docs and strings now say Settings → Messaging Channels → Slack, in every locale.
  • The inline Stop gate now refuses a shared user in a revoked code channel, with a test.

The security package line budget failure (Backend Tests (3.12, 2)) also fails on main and has its own fix pending, so it does not block this PR.

Still open:

  1. OPTIONS answers (GPT 6.1, upheld again). slack/handler_runtime/dispatch.py:128 still runs shared_command_refused(user_id, text) when an OPTIONS answer arrives with interpret_commands=False, so a shared user's /tmp answer is refused instead of reaching the conversation. Please apply that refusal only when interpret_commands is true.

New on this head, both from this change:
2. Backend Tests (3.12, 1): test_ssm_loopback_trust_sites.py::test_every_loopback_trust_site_is_classified says is_direct_local_request is now called from a place its list does not know. Please add the new call site to that list with its classification.
3. Backend Tests (3.12, 7): test_facade_mirror_guards.py::test_no_test_patches_a_shared_name_on_an_owner_directly says a new test patches a name that more than one mirrored module binds, directly on its owner. Please patch it through the facade the guard names.

Once these are in and CI is green, I will approve.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-shared-access branch from 5c2dc7b to 13df52b Compare November 6, 2026 21:56
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 6, 2026
@kyleseaman

kyleseaman commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

@bolichen97 thanks. Re-reviewed points from your 5c2dc7b review, at b4d129c (rebased onto current main, including #21429):

  1. OPTIONS answers with interpret_commands=False. I kept the refusal, but it now happens before the card is claimed, so the owner can still answer the card. Limiting it to interpret_commands would let the / text through: the harness reads a leading / as its own command whatever Slack's flag says. A shared user's /tmp answer would then run as a harness command in the owner's session. So the change is where the refusal happens, and it no longer costs the card:
  2. SSM loopback trust sites. dashboard/slack_shared_access.py is in the list with its classification (test_ssm_loopback_trust_sites.py). It passes locally.
  3. Facade mirror guard. The tests patch shared names through kiro_crew.slack.handler / kiro_crew.slack.interactions, never on the owner module. test_facade_mirror_guards.py passes locally.

New since your review, from the rebase onto #21429: code channels stay owner-only for shared users on every new path. That covers the code-channel slash commands, Archive, threads linked to a code channel's session (live tab or closed), pinned answers, every spelling of the session key, card answers (checked before the claim), agent-session Stop and rename, !stop, and a link made while a turn is being set up. The tests are in test_slack_shared_access_code_channel_surface.py. The spawn list and status keywords no longer show a shared user host-wide state, and the admission cache trusts only verdicts from the live bot.

@kyleseaman
kyleseaman requested a review from bolichen97 November 6, 2026 23:53
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@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 20% chance that this change introduces a defect, above the 12% limit for approving on its own.

Adds an off-by-default owner opt-in (slack.shared_access) that lets named, Slack-confirmed users drive the Crew from Slack as the owner. It is a recorded maintainer decision, written up as an RFC exception to R10, and the settings warning discloses that a shared user acts as the owner. I verified: with the switch off every gate keeps its owner-only result and Slack is never called. A listed ID counts only after users.info/auth.test confirm it; a failed check refuses the person, and a reconnect clears all confirmations. Removing someone or switching off applies to the next event, including queued messages and open modals. The gates that keep shared users out use is_shared_listed (listed now, or admitted earlier in this process), so neither an aged-out confirmation nor a mid-message removal gets past them. Those gates cover Trust, other people's prompts, !dashboard and the other ! commands, /⁠kirocrew, messages starting with /, privacy modifiers, run/cron/spawn/status/sessions, the Home tab and other buttons, and code channels on every route I traced. Dashboard writes need an owner-gated request made directly on this machine and never from an app token or internal caller. Shared Crew

Tier: 3, held for a person: merge conflict.

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

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Thank you for this work. The design is accepted on record in this PR's review history. The PR now waits for a maintainer to approve it. The open change request also needs a re-review at this head. Points 2 and 3 of that request look addressed. For point 1 you kept the refusal and moved it ahead of the card claim, and the reviewer has to accept that answer. This change widens who the Slack gateway admits, so a maintainer decides whether to accept it.

What this review checked on head b4d129c: is_allowed_user stays owner-only. Only the named sites call is_shared_user, and a test pins that set. The refusal gates use is_shared_listed, so an expired confirmation or a mid-message removal does not open them. Approval prompts carry the requester on both the native and the transport paths. The dashboard writes need the owner gate and a direct local request. The switch is off by default. No blocking finding came out of the review. One thing done well: admission is deny-by-default by construction, so any reader this PR did not touch refuses a shared user instead of admitting one.

Optional:

  • src/kiro_crew/slack/interactions.py:653: no test covers the "never Trust" fence on the transport approval path. If you drop pressed_trust or from the condition, a shared user can grant session Trust on their own transport prompt, and the shared-access and interaction suites still pass. A test beside test/test_slack_shared_access.py:272 that presses Trust on a prompt the shared user requested would pin it. Add the owner's Trust press on the same prompt as the passing side.
  • src/kiro_crew/slack/handler_runtime/permission_ladder.py:687: when a shared user presses Trust on their own DM prompt, the press is refused, but they get no reply and the card does not change. Either send them a short ephemeral "owner only" reply, or build the card without the Trust button when the requester is a shared user.
  • docs/request-for-change/rfc-slack-shared-access.md: the RFC does not say how it relates to docs: propose Slack channel roles for teammates and maintainers #23362, the other RFC on the same issue. It also does not mention that the issue rejected the allow-list-as-owner model. A short paragraph would help readers of both RFCs.

…by default

slack.shared_access (enabled: false, user_ids: []) lets the Slack users the
owner lists drive this Crew as the owner in DMs, mentions and threads, once
Slack confirms each ID (users.info: same workspace as auth.test, a person,
not deactivated, not the owner). slack.allowed_users, !allowlist and
/kirocrew @user stay inert.

A shared user answers only the tool prompts their own turns post and never
grants Trust. The access list, Trust/YOLO, !dashboard and every other !
command, /kirocrew, the Home tab, the sessions list, cron and run keywords,
other buttons and code channels stay the owner's. Removal or switch-off
applies to the next event. Admissions and refusals are audited by user ID.

Settings -> Slack gets a Share Slack access toggle with a warning that is
always shown, a confirm to turn it on, and the ID list with each person's
name. Docs, the configuration reference, the feature map and a design note
record the decision.
A shared user's caption-less file was refused as a "/" command: the check read
the ingested text, which leads with the attachment's temp path. The command
refusal now reads what the person typed (spool_text). A privacy token inside an
attachment, a voice transcript or a forwarded body never changes a mode for a
shared user; a card label is judged only for a leading "/"; a review revision
is judged on the person's feedback before the draft is consumed, and a refused
one is audited with the owner-only notice.

The UX round on 9ab098d (CI UX Review, then local GPT, Opus, First
Principles and UX lanes), changed since 9ab098d:
- The page refuses at the switch while anyone listed (apart from the owner's own
  ID) is unconfirmed and names them, so the confirm only names people who get
  access. UI guard only: the switch route and config.json handling are unchanged.
- After the confirm the page cancels any read in flight, reads the list again and
  turns sharing on only if it is the list just confirmed (ID, confirmation and
  reason) and still off. While it reads, the switch is busy and Add and Remove are
  held; a failed read or leaving the page sends nothing.
- Switch hints hold only while the list still says so.
- A 409 not_applied carries unread: ["slack"] when the slack section was
  unreadable (names only); the notice says so in plain words, says to restart,
  and says the switch and list show what is in effect. The 409 error string and
  _live_matches docstring name the real causes.
- Copy in all 13 catalogs: the pending hint says "Remove {{names}}, or fix what
  each row says"; a malformed ID's hint carries how to find a member ID; the
  unverifiable row says when the page asks Slack again; fr uses U+202F; zh-CN
  not_applied wording restored. The docs line matches.
- The section is its own row of the Slack card and a failed chunk load uses the
  inline layout, so the raw load error is never printed.
- config/sections_slack.py imports USER_ID_RE inside is_slack_user_id, so the
  config.sections facade binds no new owner name (test_sections_facade.py).
@kyleseaman

Copy link
Copy Markdown
Contributor Author

@bolichen97 thanks for the three reviews. Where each ask stands at 380379b (rebased onto current main):

5792229642

  1. Owner-only refusals after a confirmation ages out: shared_command_refused asks is_shared_listed (shared_access.py), pinned by test_an_aged_confirmation_lets_no_harness_command_through and test_a_listed_user_is_refused_the_owner_keywords_even_with_an_aged_confirmation.
  2. is_allowed_user stays owner-only; the sites that admit a shared user ask is_shared_user on purpose, pinned by test_only_the_named_sites_admit_a_shared_user.
  3. Error codes: code is a required argument of _deny, every refusal names one, and the baseline is not regenerated.

5802201110

  1. The security package line budget failed on main too, as you noted, and was fixed there; nothing in this PR was needed for it.
  2. The docs and strings say Settings → Messaging Channels → Slack (slack-integration.md).
  3. OPTIONS answers: see point 1 under 5806360025.
  4. The inline Stop refuses a shared user in a revoked code channel, pinned by test_a_shared_users_inline_stop_is_refused_in_a_revoked_channel_but_not_a_dm.

5806360025

  1. OPTIONS answers with interpret_commands=False: the leading / refusal stays, because the harness reads a leading / as its own command whatever the Crew's flag says, so a shared user's /tmp answer would otherwise run as a harness command in the owner's session. It runs before the card is claimed, so the owner can still answer the card (_shared_answer_refused, test_a_shared_users_command_option_leaves_the_card_answerable). The rest of your ask is taken: privacy modifiers are judged only when commands are interpreted (dispatch.py, modifiers=interpret_commands), and never on a card answer.
  2. SSM loopback trust sites: dashboard/slack_shared_access.py is in the list with its classification (test_ssm_loopback_trust_sites.py).
  3. Facade mirror guard: tests patch shared names through kiro_crew.slack.handler / kiro_crew.slack.interactions, never on an owner module, and test_facade_mirror_guards.py passes.

Line cap. events.py and routing.py grew on main past the 2,000-line cap with this PR on top, so whole blocks moved as a pure move (same order, same audit rows, same returns) into code_channels/shared_refusal.py: the router's code-channel drop with its audit row (shared_message_dropped, now pinned by test_a_shared_users_dropped_message_in_a_code_channel_is_audited), the shared user's !stop session check (shared_stop_refused) and the OPTIONS-answer permit (options_answer_permitted, still imported through routing).

R10. This PR departs from R10 of your rfc-per-person-execution ("unknown people are never the owner"): Slack teammates the owner names act as the owner, but only when the owner opts in. It is off by default, each ID must be confirmed by Slack as a person in the bot's own workspace, and the owner-only controls stay refused. Everyone else stays under R10 as written. As owner, Kyle accepts that exception here; rfc-slack-shared-access.md records it.

Could you take another look?

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.

4 participants