Repository navigation
feat(slack): pick each code channel's agent - #21991
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No blocker. The reader understood every primary control; it held back only on the Trust confirmations, which are red danger buttons and correctly read as risky. Notes
[UX-REVIEWED] 52f9789 Description read[DESCRIPTION-READ] 1e60397595520f35b38ccbfc785059eeb9bb871fb89264c5e7285928c6ae5a99 That sha256 names everything this verdict read: the PR description, plus the 43 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: both pickers reuse the dashboard's audited transactions, and the approval-inheritance change only tightens raises. Notes
[DESIGN-REVIEWED] 52f9789 Description read[DESCRIPTION-READ] 955505d8d7cdf0d1e1786df597df6621f2e8c52a93eec053367a7f7887f3a28f 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) — ✅ human override accepted@kyleseaman overrode this lane for |
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: |
c9289e3 to
e6a8146
Compare
Sensitive Change Review
|
7d192f9 to
b7c23f8
Compare
e6a8146 to
408d621
Compare
408d621 to
90250b1
Compare
2a7700d to
9312e70
Compare
9312e70 to
5137e5a
Compare
|
UX evidence for the mode explanations (current head). Slack frames: rendered from the exact Block Kit JSON the code emits, in a Slack-style page (a mock, not a Slack client capture). Settings frames: the real built SPA with fixture API answers. Kickoff: the line under the Approval mode select now says what Normal, Reads and Trust each do. Settings → Code channels: the picked mode's description shows under the field (Normal, Reads); on Trust the channel warning stands in its place. |
|
UX evidence for the current head. Slack frames are rendered from the exact Block Kit JSON the code emits, in a Slack-style page (a mock, not a Slack client capture). Settings frames are the real built SPA with fixture API answers. The Approval mode select no longer carries a fixed dialog (Block Kit confirms a select as a whole, so it could never name the pick). Picking Reads or Trust now changes nothing and replies privately with what that mode does and a button that names it ("Switch to Reads" / "Switch to Trust", one click, 10 minutes). Normal applies at once. Also shown: the line under the select saying what each mode does, the YOLO line, and Settings with Reads explained and Normal's source as "Built-in default". |
|
UX evidence for the agent picker and approval copy fixes (rendered from the code's own Block Kit JSON and the shipped agents' spec descriptions; the Settings frame is the real built SPA with fixture API data).
|
Code change approver recommendation: A person should decideAutomated, not a person, and not a review: a maintainer still decides.
Why: the decider flagged 1 possible problem (p_defect 0.72); a person should check it. This PR adds the code-channel agent picker and approval mode. I'm requesting changes. The new worker approval relay builds its Slack card without the event's trusted MCP identity. Owners can approve a worker's MCP call, or put the whole channel on Trust from that card, without seeing which server runs it. Every other Slack approval card, including the linked card in the same function, shows that line. No test checks the identity line on worker cards. Separately, the product decision for Trust in group channels has no recorded owner override yet. Things to check (the decider's concerns; it is right less than half the time):
If this recommendation is wrong, reply here; the replies are how the approver is evaluated. |
bolichen97
left a comment
There was a problem hiding this comment.
Request changes at f932d40, for one point.
Blocking: a new regex in product code. slack/code_channels/approval_picker.py adds _COMMAND_NAME = re.compile(r"[a-z0-9_-]{1,32}"), and _command() uses it with fullmatch to decide whether a configured slash-command name may be echoed into a channel. We don't take new regex in product code. An exact character check does the same job and is easier to read:
_COMMAND_CHARS = frozenset(string.ascii_lowercase + string.digits + "_-")
def _is_command_name(name: str) -> bool:
return 1 <= len(name) <= 32 and all(ch in _COMMAND_CHARS for ch in name)Use it in _command() in place of _COMMAND_NAME.fullmatch(routed) and drop import re. A small test for a name that is too long, has an upper-case letter, or has a space would pin it. The rest of the added product code has no regex.
What I read and found sound:
approval_picker.pyin full: owner-onlyauthorizebefore any change, and every raise re-checks the gates at its commit. Normal is never held back. Trust is said in the channel. The confirmations are single-use, tied to the session, the latest intent and a 10-minute TTL. Every decision writes a SEL row.worker_approvals.py: the relay posts only for a verified direct child of the channel's current session, and re-checks the egress gates past each await. Answers go through the slot-scopedresolve_slot_approvalpinned to the card's future.- The
agent_picker.pyswitch: iamwhatever's two-rows point is fixed._switchnow builds the caller withnotice=False, and_announcewrites the one row. - Small pieces:
binding.channel_sessionrefuses a slot whose transcript-read link names another session.slot_approval_seed.pyis the crewmate seed moved out, with its behaviour unchanged.still_live/still_permitted/cascade_may_raiseonly apply when the new Slack callers pass them.
approval_inheritance: a raise now needs every edge above it to be gateway-verified, not only the last one. That applies the cascade's existing verified-edge rule to the deeper walk it skipped, so I read it as restoring main's boundary, not adding strictness.
CI: the 5 cancelled runs each have a newer success on this head. Everything else is green.
bolichen97
left a comment
There was a problem hiding this comment.
Follow-up to my request-changes, after reading the rest of the product diff at f932d40 (the rest of agent_picker.py, wrapup.py, enterprise.py, events_slash.py, features.py, format.py, handler_runtime/approvals.py, interactions.py and the Settings page). There's one more small thing, so you can do it in the same round:
- Unrelated reformat of
slack/enterprise.py. The PR drops it from.github/black-baseline.txtand reflows it. That's out of scope here, and the reflow leaves implicit string concatenations where two literals used to sit on separate lines:"Failed to read slack.allowed_enterprise_ids; failing closed " "with no origin admitted", and"Enterprise validation: auth.test unavailable; " "continuing default-open". Please either revert theenterprise.pyand baseline change and leave it to its own PR, or join each pair into one literal.
Everything else in that part reads fine:
- The app-command routing (
events_slashnow hands the app's own slash command tohandle_slash) returnsFalsebefore any gate or side effect unless the text isagentorapprovalin a bound code channel. - The "Trust this channel" button and the command-once card rendering are only added under
channel_trust, with mrkdwn and code-fence escaping on the agent-authored parts. Decoded JSON parts are redacted again, andcommand_and_restrefuses input whose decode would surface hidden characters. - The owner-refusal audit rows in
interactions.dispatchmatch the pickers' own. - The agent pick goes through the
channelspolicy pluschannel_refusalpair beforehandle_select. - The Settings field stores
askas unset, the same way the backend validator does.
The _COMMAND_NAME regex in my review above is still the one blocker.
|
@bolichen97 thanks, both fixed in
|
…irocrew agent
The kickoff carries a static_select of the choosable agents (the same roster as Settings' default-agent picker), preselected with the resolved default (card default > folder default_agent > kirocrew-conductor). /kirocrew agent <name> in a code channel switches that channel too. Both run the dashboard's switch_slot_agent as a non-owner caller with notice=False (the picker writes its own /agent line), are owner-only and SEL-audited, and refuse a pick made during a turn with turn_in_flight ("try again when this turn ends").
Also: harden the code-channel agent switch against stalls, closed gates and failures
Load a restored slot's transcript window off the event loop before the
switch transaction and the announcement (notice=False skipped the built-in
notice's load). Re-check the code-channel gates after the pre-commit awaits,
and pass the synchronous ones into switch_slot_agent as the new optional
SlotAgentSwitchCaller.still_permitted, read at its commit, so a gate that
closes mid-switch refuses (caller_not_permitted) instead of committing.
A switch that raises is answered, audited and redrawn; a cancel before the
commit redraws the kickoff; sub-agents get a try-again reply; the refusal
reason is redacted; a pick checks the workspace before any side effect; a
stale or rebound kickoff points at the live one; and a typed value that
can't be an agent name is shown and audited as <invalid>.
#21997) * feat(slack): start code-channel sessions in a configured approval mode A code channel's session starts in the approval mode set on the Code channels card (Normal / Reads / Trust). The channel's owner can change it from the kickoff message's Approval mode menu, with /kirocrew trust ask|reads|all, or with "Trust this channel" on an approval card. Every change goes through apply_approval_mode, the same audited path as the dashboard picker, and ends a live YOLO grant on Ask. Approval cards for a code channel post top-level in the channel. Workers started by the channel's own session relay their approval cards into the channel; only the owner can answer them, and each click settles only that worker's waiting call. A mode change reaches the channel session's own running workers (raise and lower, capped at the channel's mode), and a raise to Trust approves their waiting prompts the way a mid-wait dashboard switch does. Person-only question cards are never answered automatically. * fix(slack): fence code-channel mode changes and worker cards at the mutation A lowering reaches every session that inherited the channel's grant (a worker's workers, linked ones) and the reply names any it could not change. Each grant re-checks, right before it applies, that the channel is not archived here, the feature is on and the channel session is the one the caller authorized against. A cancelled change releases the cards it claimed. Worker cards keep the UNVERIFIED warning and post only where the channel's own prompt would. A literal code fence cannot end a code-channel card's code block, and a hand-edited command name is never echoed into the channel. --------- Co-authored-by: Kyle Seaman <kseam@dev-dsk-kseam-1b-55230d27.us-east-1.amazon.com> Also folded in: the seam fixes between the agent and approval pickers, and the reconciliation with creator-mode inheritance (#25866): the seed marks its mode as the slot's own, a channel change keeps a worker following its channel, and a raise to Trust reaches a worker only under the creator-mode rules, with its relayed card claimed before the cascade sweep.
|
Owner decision: Trust stays available in code channels, owner-only to change. A Slack Code channel's own session offers an owner-only "Trust this channel" on its approval cards, an intentional exception to the group-channel no-Trust rule in |
|
/ai-review override first-principles 52f9789 owner-decision: Trust stays available in code channels, owner-only to change; recorded in the RFC. #21991 (comment) |
Human judgment recorded@kyleseaman recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving at 52f9789, without auto since you hold auto-merge. Thank you: both points from my reviews at f932d40 are done.
- The regex is gone.
approval_picker.pydropsimport reand_COMMAND_NAME. It now uses_COMMAND_CHARSplus_is_command_name()(length 1 to 32, each character in the set), and_command()calls it. I searched the saved diff for_COMMAND_NAME,re.compile, the otherre.calls,new RegExpand/.../literals in product code, and found none. The new parametrized tests cover empty, 33 characters, upper case, a space, a newline and a non-ASCII letter, plus the accepted shapes. - The
slack/enterprise.pyreflow and its baseline change are no longer in the PR.
The rest of the change since f932d40, read in full:
- The relayed worker approval card now carries the permission event's MCP identity (
mcp_server_name,tool_name,mcp_identity_trusted) throughrelayandstart, so it names the proven server and tool like the linked card does. An unproven identity is left out. Both have tests. - Trust texts now say "helper sessions it starts, including ones already running", and each raise says only the owner can undo it by picking Normal. YOLO is described before it is named. The test pins those and keeps the confirm texts under Slack's 300-character limit.
- The concurrency test now freezes the picker's clock and bounds every wait.
- No new refusals, and no regex in product code.
The newest run of every check on this head is green; the cancelled GPT 6.1 entry has a newer passing run.
|
This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/). Review result on head 52f9789: no blocking code defect was found. The review traced each owner-only control to the These decisions stay with the maintainers:
For the security review:
Optional:
|












































Two commits on
main:feat(slack): pick each code channel's agent in its kickoff or with /kirocrew agent: this PR's own work, the agent picker and its hardening.feat(slack): start code-channel sessions in a configured approval mode (#21997): feat(slack): start code-channel sessions in a configured approval mode #21997, which was reviewed as its own PR and then squash-merged into this branch (by iamwhatever, 2026-11-02 16:34Z) instead of into main, plus the seam fixes and the creator-mode reconciliation below. feat(slack): start code-channel sessions in a configured approval mode #21997 predates main's fix(dashboard): workers follow their conductor's approval mode after dispatch #25866 (a conductor's mode change reaches the workers that inherited it), so on this base its own Trust raise had to be narrowed to fix(dashboard): workers follow their conductor's approval mode after dispatch #25866's rules; that is the one place this branch differs from a plain rebase of the merged branch beyond moving feat(slack): start code-channel sessions in a configured approval mode #21997's Settings controls into the base's split files (slackCodeDraft.ts,SlackCodeChannelDefaults.tsx). See Sensitive change.Seam fixes (in commit 2). A fresh-context review of the two features together found one should-fix and four nits, all fixed, each with a test that fails without it: a finished archive (stamp stored, fence lifted) now fails the agent switch's commit check, which only read the fence; the approval select, the Trust card and worker cards check the workspace before any reply; an approval select value that is no mode is audited as
<invalid>; a rebind during a raise points at the live kickoff; a cancelled approval pick redraws the select; both pickers share one validated slash-command name; and a worker whose window can't load leaves its card unclaimed.Problem / Motivation
Goal: Let the owner of a Slack code channel run that channel from Slack without the dashboard: choose which agent runs it, and choose how its tool approvals are answered. In scope:
/kirocrew agent <name>;/kirocrew approval normal|reads|trust, and Trust this channel on an approval card; both the button and the select ask for confirmation first;This deliberately reverses the earlier "Trust excluded in group channels" decision for code channels: Kyle approved all three modes (Normal, Reads, Trust) for a code channel, with the owner-only gate and the in-channel Trust warning.
Kyle's asks, verbatim: "I would like you to build the fulll implementation of Slack Code for Crew" and "i want this to be a GREAT experience, customers should be able to create a default folder and/or agent (with model/effort) as default and just make it work." Then, for the agent picker: "let us pick ANY agent."
"Any agent" resolves to the
_choosableroster: every agent that can actually run a channel. That is every user-defined agent plus the shippedkirocrew-conductor,kirocrew-team-leadand the coding agents.kirocrew-lite(no tools),kirocrew-guest(a trust boundary), the dashboard manager andkirocrew-heartbeat(unattended polling) stay out, per the "Which agents." paragraph ofdocs/request-for-change/rfc-slack-code-channels.md, because none of them can run a channel. The kickoff picker,/kirocrew agentand Settings → Slack's "Default agent" picker all call that one existing function, unchanged.Today every code channel runs the resolved default agent (the Slack Code card's default, else the folder's
default_agent, elsekirocrew-conductor), and its session always starts in Normal: every tool call waits for an approval click in the dashboard. Nobody is usually watching the dashboard while the channel is in use, so the agent stops at its first shell command and the channel goes quiet.Why it matters
A default suits most channels, but not all of them. Without a per-channel choice, someone who wants a coding agent for one task has to change the default for every channel, or leave Slack and switch the session in the dashboard. And without an approval mode the channel can use, the first build or test command waits on a prompt only someone at the dashboard can answer; the workaround is to open each channel's session in the dashboard and flip it to Trust by hand, every time a channel opens.
Not a goal
channel_session). A separate item designs that exemption.docs/request-for-change/rfc-slack-code-channels.md) gains §3.4 Approval modes in code channels, recording the owner-only "Trust this channel" exception to the group-channel no-Trust rule. The exception itself awaits the owner's decision on this PR./kirocrewand interactivity are already in the manifest.What changed (motivation → approach → change)
Both features reuse the dashboard's own transactions, so neither adds a store or a privileged write of its own.
_choosableroster, preselected with the resolved default;/kirocrew agent [<name>]does the same from the command line. Both runswitch_slot_agentas a non-owner caller (notice=False; the picker writes the one/agenttranscript line). Owner-only, SEL-audited, and a pick during a turn is refused with "try again". The gates are re-checked after the switch path's awaits and again at the switch's commit (new optionalSlotAgentSwitchCaller.still_permitted,Nonefor every existing caller), and a restored session's transcript is loaded off the event loop first. Details: Agent picker below.slack.code_channel_defaults.approval_mode(ask/trust_reads/trust, unset =ask), seeds the channel's session through a new sharedseed_slot_approvalonce the binding is written. In the channel: an owner-only Approval mode select under the agent picker,/kirocrew approval normal|reads|trust, top-level approval cards with Trust this channel, a relay of the channel's workers' prompts, and propagation of a mode change to running workers. Every change goes throughapply_approval_mode, the dashboard picker's audited mutation, fenced at the commit. Details: the three approval sections below.Docs:
docs/guides/slack-setup.mdgains "Choosing each code channel's agent" and "Approval mode for code channels".Agent picker (commit 1)
static_select(kc_code_channel_agent) set to the resolved default (card default > folderdefault_agent>kirocrew-conductor). Its options come fromslack_code_settings._agent_names, the same call the Settings picker makes. A pick switches the channel's session and the kickoff is redrawn from the session's real agent with a "set by @user" note; a refused switch puts the select back. If the new session took a different agent than the resolved default,routing._bind_channelredraws the kickoff once to show it./kirocrew agent [<name>]in a code channel.commands.handle_slashtakes theagentsub-command (and, with commit 2,trust); any other/kirocrewtext goes to the normal registry. Same gates as/summarize. An unknown name is refused with the list; a bare/kirocrew agentshows the current agent and the list. Outside a code channel/kirocrew agentis the app's own command.Team lead (kirocrew-team-lead)), or the name alone for any other; labels are unique and never cut (a name past Slack's 75-character label cap is not offered;/kirocrew agentstill reaches it). What the agent does goes on the option's owndescriptionline: for each shipped agent a short hand-written best for phrase that fits Slack's 75 characters uncut (one table,agent_picker._SHIPPED, with a test that each fits and none repeat); only a user-defined agent shows its spec's description, through the display sink, cut at a word to fit, and/kirocrew agentlists one line per agent with its description.turn_in_flightanswers "A turn is running. Try again to switch to X when this turn ends." and running sub-agents get their own try-again reply. Nothing is kept in memory (a deliberate subtraction; see Review history).is_allowed_user), in a code channel that is not archived and whose activation and origin both admit the bot. Every decision writes one SEL row (caller=slack-code-channels,operation=slack.code_channel.agent). A typed value that can't be an agent name is shown and audited as<invalid>.channelspolicy, then the synchronous gates (workspace, owner, archive fence, feature, channel and origin activation). The synchronous ones also ride intoswitch_slot_agentasstill_permitted, read in its no-await commit section, so a gate that closes during its own awaits refuses withcaller_not_permitted(403).notice=Falseskips the built-in notice'sload_window_off_loop, so the picker awaits it before the switch (which readsslot.messages) and before_announce's append. A failed load refuses with "try again" before anything commits.result=failed) and redrawn; a cancel before the commit redraws the kickoff; a refusal reason is redacted before it reaches Slack.missing_scope) it goes out as plain text. Names over Slack's 75-character label cap are not offered (the 150-character value cap is wider); the 100-option cap keeps the selected agent.Where:
src/kiro_crew/slack/code_channels/agent_picker.py(new),commands.py,routing.py,surface.py,src/kiro_crew/slack/events_slash.py,interactions.py,src/kiro_crew/dashboard/chat_api/agent_switch.py(the optionalstill_permittedfield).Approval mode default and seeding (commit 2)
Settings. The Code channels card gets an Approval mode picker with the session approval picker's labels (Normal / Reads / Trust). A new code channel runs with gains an Approvals row. Picking Trust shows an inline warning: anyone allowed to talk to the bot in the channel drives an agent whose tools run without asking, and sessions it starts inherit that.
PUT /api/slack/configaccepts the three values, storesaskas unset and refuses anything else; a value already stored is not re-checked on a save that does not touch it. The copy is in all 12 locales.Runtime. When
create_bound_sessionhas created and bound the channel's session, it puts the slot on the mode, only after the binding is written, so a retracted session leaves no audit record. The new shared helperdashboard/slot_approval_seed.seed_slot_approvalwrites what the dashboard picker's Reads / Trust writes (_trust/_trust_readson every slot sharing the session, the session's approval policy, amode_change:<mode>SEL record attributed toslack:code_channel). Unlike a person's press it never touches the YOLO override and never replaces trust the slot already holds. The crewmate thread seed (handlers/members._seed_member_approval) now calls the same helper.askchanges nothing.Hook point. Crew's script hooks fire once a turn is under way and can't set a session's approval mode; the code-channel turn hooks are internal. The setup guide says so and tells the user how to keep one channel on Normal.
RFC addition (for #21425's
rfc-slack-code-channels.md, §1 Resolution order): one row,approval mode | code_channel_defaults.approval_mode only; unset is ask. The API paragraph gains: an approval mode must beask,trust_readsortrust, withaskstored as unset. The runtime applies it throughseed_slot_approvalonce the session is bound, never touching the YOLO override.config/sections_slack.py,config/section_builders.py,config/sections.pyslack/features.pyslack/code_channels/binding.py,dashboard/slot_approval_seed.py,dashboard/handlers/members_thread.pydashboard/slack_code_settings.py,website/src/api/client/messaging.tspages/settings/SlackCodePanel.tsx,website/src/i18n/locales/(12 locales + regenerateden-XA.json)Approval cards in the channel, Trust this channel, worker approvals (commit 2)
apply_approval_mode, whose sweep approves the waiting call; posts one warning line in the channel; and writes aslack.code_channel.approval_modeSEL row. Nothing is resolved by id state-wide; the already-on-Trust race is answered withresolve_slot_approvalpinned to the card's future.apply_approval_modegains an optionalstill_livepredicate, asked before any trust flag or policy is written; a prompt answered or expired meanwhile gets a 409. Existing callers omit it._created_by) is also posted top-level, headed Worker: <title> wants to run:, with the tool and its arguments through the usual outbound redaction and nothing from the worker's transcript. Approve / Reject (owner-only, lineage re-checked live) resolve the worker's own future; Trust this channel approves the call and puts the whole channel on Trust. A card decided elsewhere is updated in place and its buttons go./kirocrew approval normal|reads|trustjoins/kirocrew agent(bare/kirocrew approvalshows the mode). Trust this channel and the Approval mode select each carry a Block Kitconfirmsaying the channel's agent and its running workers will run tools without asking (Slack confirms a select as a whole); Approve and Reject stay one click. Both reuse commit 1'sauthorize,kickoff_blocksand sub-command parse. YOLO: a pick is never "unchanged" while the override is on, so Normal ends the grant; the kickoff carries a line saying tools run without asking. Known limit: the select shows the mode as of the last redraw (a dashboard change or restart does not redraw it).Files:
slack/code_channels/approval_picker.pyandworker_approvals.py(new),slack/handler_runtime/approvals.py,slack/interactions.py,dashboard/chat_runner.py,dashboard/chat_turn/permission_prompt.py,dashboard/chat_api/slot_approval.py,docs/system-specs/modules/slack-gateway.md.Running workers follow the channel's mode (commit 2)
approval_picker.set_channel_mode(the Trust button on either card, the kickoff select,/kirocrew approval) changes the channel's session throughapply_approval_mode, whose creator-mode cascade (fix(dashboard): workers follow their conductor's approval mode after dispatch #25866,approval_inheritance) carries the change to the workers that inherited it. That cascade is the only way a raise reaches a worker. This feature adds lowering only, where the cascade does not reach: workers a person raised on the dashboard and the whole_created_bytree (a worker's own workers, Slack-linked ones). Each change writes the dashboard's audit row plus aslack.code_channel.approval_moderow naming the worker. A worker the change could not lower is named in the reply.still_livepredicate: the exact worker object is still registered, still in the channel's lineage, and the mode still lowers it. Any change but to Normal re-runs commit 1's gate checks (agent_picker._still_admittedafter taking the channel lock,_sync_gatesat each grant's commit, which include the per-channel governance ceiling), Trust to Reads included, because a slot put on Reads hands Reads to inheriting sessions on Normal. A worker lowering to Reads that a closed gate refuses falls back to Normal (not while YOLO is on, since a Normal write ends it everywhere). Every slot's window is loaded off the loop first, and a Trust raise whose descendant window cannot load changes nothing. Normal, and a Reject, are never held back.ask_questioncards are never answered.commandin its own code block, other arguments only when there are any; decoded parts are redacted again, and an input with control or format characters is shown raw.Premise (for the maintainer override)
Approval mode (#21997). First Principles blocked an earlier #21997 head because per-channel mode changes contradicted its old
## Not a goal("No per-channel override") and because the worker relay, live-worker propagation and top-level cards were outside its stated Goal. Kyle ruled (2026-10-23) to amend the Goal rather than split, and the Goal above owns all of it:/kirocrew approvaland Trust this channel are the Goal's per-channel mode changes, owner-only, throughapply_approval_mode, with no approval store of their own;One PR for both. The approval-mode work was squash-merged into this branch by a maintainer, so this PR now carries both; they share the kickoff,
authorizeand the/kirocrewsub-command parse, and the second builds on the first's gate re-checks.Trust from Slack follows the dashboard's creator-mode rules. On this base, a channel's Trust reaches a worker only through main's creator-mode cascade (#25866), exactly as a dashboard Trust on the same conductor would; #21997's own per-worker raise is removed rather than kept as a second copy of those rules (Sensitive change below). This narrows #21997 as reviewed; it widens nothing.
The override is the maintainer's to post; nothing here posts it.
Sensitive change
Head commit:
52f9789151e5fb349e6846ab7dab7d4ebefa1357No Sensitive Change Review watched path is touched (
security_posture*.py,exfil.py,security/,sandbox_*,gate_tiers.py,governance.py). The behaviour below is security-relevant, so it is spelled out for review. Every change narrows what a Slack Trust raise can reach._created_bynamed the channel's session, throughapply_approval_modeas a person's pick. That included an edge read back from an editable file after a restart, a worker linked to another session (whose other slots were raised with it), and a crewmate's worker.apply_approval_moderaises its workers through main's creator-mode cascade (approval_inheritance.plan_descendant_posturesviaslot_approval._apply_inherited_postures), under its rules: inherited posture only, never a crewmate's worker, only along a gateway-written creation edge (never a linked session), only to a slot alone on its session. On a channel already on Trust nothing is raised; a worker card's Trust this channel there approves only that one call. Lowering stays this feature's own, and reaches every worker above the channel.channelsgate, not the per-channelallowed_channel_idsceiling, so a channel the policy had since refused could still be switched to Trust, have its pending calls approved, or have its agent switched.interactions.dispatch's agent-select branch andworker_approvals.dispatch_card_clickapplychannel_refusalbefore any side effect, as the Archive, OPTIONS and tool-approval branches do;agent_picker.authorizerefuses on it silently (audited; nothing is written into the refused channel, and the liveSlackClientrefuses writes there anyway viarequire_channel); andagent_picker._sync_gatesincludes it, so every commit-time fence (the agent switch'sstill_permitted, a raise's grant fence, a worker card's re-check after its awaits) re-reads it. Only a change to Normal is never held back by it.seed_slot_approval) marks the mode it sets as the slot's own, as main's crewmate seed does.Review round on
5c546bc597(each fix with a test that fails without it): UX blocked the one-click Trust this channel, now behind a confirmation, as is the Approval mode select;normalis the command word shown for Normal; the Settings preview row reads Approval mode like its field; and the hint points at the channel's first message or/kirocrew approval. GPT blocked three test awaits that depended on a cancellation with no deadline; they are bounded withkiro_crew.testing.waitand drained infinally. Neither change touches the Trust-raise gating above.Review round on
906b367369: GPT and Opus (security-class) found the missing per-channel ceiling, fixed above; First Principles found the per-worker raise duplicating main's cascade, removed above. Tests (each fails without its fix, checked in scratch worktrees): a restored, unverified edge; a linked worker and its session's other slot; a crewmate's worker; a worker sharing its session; a person-set worker; a worker that turns ineligible while the raise awaits; worker cards say "Ran under Trust" and a worker card's Trust click is answered as approved; a dashboard lowering after a Slack raise still reaches the worker; on a channel already on Trust no worker is raised and a worker card's Trust approves only its own call; and a channel the policy refuses changes nothing from the agent select,/kirocrew agent, the Approval mode path, the Trust card or a worker card, including when the policy narrows mid-switch or mid-raise.Review round on
528648ee73: Opus found each cascade-swept worker card written twice, the second time without its header (the channel's own-card rewrite now gets only the channel's cards); GPT found a descendant window that failed to load ignored before a Trust raise (now refused before anything changes). The fresh-context review's should-fixes are fixed with fail-first tests: Trust to Reads is gated (channel and worker fences),apply_approval_mode's Reads branch re-checks its fence after its awaited trust-scope ending, a policy refusal posts nothing into the channel, and each policy guard (dispatcher card and agent-select branches,authorize,_sync_gates) has its own test, mutation-checked one guard at a time. First Principles' block on the remaining Slack-only lowering pass is a premise call, left for the owner.Channel-policy audit of every Slack handler this PR adds (each refuses a channel
allowed_channel_idsrefuses before any side effect and again at its commit, each pinned by a refused-channel test and mutation-checked): the kickoff agent select and/kirocrew agent(dispatcher or/kirocrewgate, thenauthorize; commit_sync_gatesin the switch),/kirocrew approvaland the Approval mode select (authorize;set_channel_mode's grant fence), "Trust this channel" (authorize; the grant fence, then_sync_gatesbefore its hand answer), a worker card's Approve / Reject / Trust (dispatch_card_click,authorize; the policy at the commit for every button, Reject included), and the worker card relay (the policy right before it posts). The session's starting approval mode is not seeded on a channel the policy refuses. These guard points are listed insurface.policy_gated_handlers()beside #21429's. A change to Normal is the one deliberate exemption at the commit: it only takes grants away, and its entry checks still refuse.Worker lineage: a worker card is relayed, and answered from Slack, only for a creation edge the gateway minted or the crew log records (
approval_inheritance._verified_child, the check the creator-mode cascade uses; a linked session never qualifies), never for a_created_byread back from an editable transcript. It is checked when the card is relayed, again right before it posts, when a click arrives, afterauthorize, inside the Trust button's own grant fence and before its own answer. Lowering still reaches a worker that cannot be verified (it only takes a grant away, and a real worker restored after a restart must not be left on Trust); the reply then names it only as "a session". Code-channel text reaches Slack and the dashboard through the shareddisplay_safe_forsink (surface.display_text), not direct redactor calls; the wrap-up post delegates to it too. Right before a worker card posts, the relay re-reads lineage, the channel's egress (mirror pause, origin, Slack Stop) and the channel policy, with no await between those reads and the post. Lowering a worker only ever takes grants away: the shared mutation's creator-mode cascade runs lower-only for it (apply_approval_mode(cascade_may_raise=False)), a raise anywhere in that cascade now needs every edge above it gateway-authored, not just the last (approval_inheritance.plan_descendant_postures), and a lowering to Reads that would raise another slot sharing the worker's session lands on Normal instead. A deny-override prompt is never relayed to the channel: like the linked mirror, it is answered on the dashboard alone, since a Slack Approve on it would be read as a decline under a card saying "Approved". Every owner control (the agent select and/kirocrew agent, the Approval mode select, confirm and command, both Trust buttons) acts on the channel's session only while it is still the one the binding recorded (binding.channel_session): the slot's key is the binding'ssession_keyand it carries nolinked_session_key, since a code channel's session is never linked and a link read back from its transcript names some other session. It is checked at entry and again at each commit fence. A worker card also names the call's proven MCP server and tool (MCP tool: *server* / *tool*) exactly as the linked card does: the runner passes the event'smcp_server_name,tool_nameandmcp_identity_trustedthrough the relay, and an unproven identity is not shown.Owner-only, by identity (owner decision). Every control that changes a code channel's approval mode or agent (the kickoff selects, the private confirmation,
/kirocrew approval,/kirocrew agent, Trust this channel, a worker card's Trust) checks the clicking or sending user withis_owner, at entry (agent_picker.authorize) and again at each commit fence (agent_picker._sync_gates), never the widenableis_allowed_userallow-list, being in the channel or a value in the payload; anyone else is refused privately and audited. The dashboard route already requires the owner's own request (deny_non_dashboard_caller). Recorded in the Slack Code RFC §3.4 andslack-gateway.mdas the one exception to the group-channel no-Trust rule.Confirmation race (GPT). A Reads/Trust confirmation is checked and spent with no await in between, after
authorize, and carries the channel's request number: any later mode request voids it, and a raise commits only while it is the channel's latest request and the mode it started from still holds (a dashboard change meanwhile voids it). The by-hand answers of Trust this channel and a worker card's Trust also require the channel to still be on Trust, so a revoke during their awaits approves nothing.Backwards compatibility
Compatible, with one change of meaning: in a bound code channel,
/kirocrew agent <name>now switches only that channel's session. It no longer reachesevents_slash._handle_agentthere, so it no longer sets the app's global default agent. Outside a code channel/kirocrew agentis the app's own command, as before. Pinned bytest_kirocrew_agent_name_switches_the_channelandtest_kirocrew_agent_outside_a_code_channel_is_the_apps_own_command.The new
approval_modekey is optional and defaults to today's behaviour (ask); an existing config without it, or with any other value, keeps every new code channel asking.SlotAgentSwitchCaller.still_permittedandapply_approval_mode'sstill_livedefault toNone, so every existing caller is unchanged. The crewmate seed's behaviour is unchanged (test/test_member_approval_default.pypasses as is).Removes nothing:
_seed_member_approvalkeeps its name, signature and outcome and only delegates its body;src/kiro_crew/dashboard/slack_code_settings.py's agent list and its tests are the base's.Tests
Commit 1:
test/test_slack_code_channel_agent_picker.py(new): the kickoff select and its preselection (zero config, card default, folder default); the 100-option and 75-character label caps; the owner's pick throughswitch_slot_agentand the redraw; non-owner refusals in the handler and throughinteractions.dispatch; a pick during a turn and while sub-agents run;/kirocrew agentswitch, unknown name, non-owner, bare listing, pass-through outside code channels; the code channel's own activation; the app scope; list parity with_choosable_agent_names().caller_not_permitted); a rebind during the awaits; a cancel before the commit; a switch that raises; a redacted refusal reason; the workspace checked before any side effect; a stale kickoff; a forged typed name.test/test_agent_slash_command.py::test_a_caller_whose_gate_closes_before_the_commit_is_refused: the realswitch_slot_agentreadsstill_permittedat its commit.Commit 2 (#21997):
test/test_slack_code_channel_approval_mode.py: config parse and round-trip; resolution; Settings GET/PUT; the runtime seed with the realcreate_bound_session(flags, policy, exactly one SEL record;askuntouched; retracted session records nothing; YOLO untouched).test/test_slack_code_channel_approval_select.py(27),test/test_slack_code_channel_trust_from_slack.pyandtest/test_slack_code_channel_worker_approvals.py(49),test/test_slack_code_channel_mode_reaches_workers.py(27),test/test_slack_code_channel_approval_prepush.py(54): the select and command, Trust this channel, the worker relay, propagation and its fences, as described above. Each new gate was mutation-checked.website/src/test/SettingsSlackCodePanel.test.tsx,website/src/test/settingsCoverage.test.ts,test/test_slack_code_settings.py: the Settings picker and its warning.Manual verification
There is no live pilot workspace, so the Slack side is verified only against fakes and recorded payloads. The Slack frames below are drawn from the exact Block Kit JSON the code emits, in a Slack-style page: a mock, not a Slack client capture. The Settings frames were captured from the built SPA with canned API responses.
Review history (commit 1): a fresh-context adversarial review found one Critical (
/kirocrew agentwas captured outside code channels) plus Medium/Low issues; all fixed with regression tests. First Principles then blocked on the widened agent list (restored to the_choosableroster) and the held mid-turn pick (deleted; a mid-turn pick answersturn_in_flight). Opus found a double transcript row per switch: fixed withnotice=False; First Principles item 8 (delete_announceinstead) answered by keeping it, the house pattern for a caller writing its own/agentline, which also marks a pick made before the first message. GPT 6.1 then blocked at09bfe4f79e(no-blocking-call-on-event-loop): fixed for the whole path with the off-loop window load, and the gate re-check class closed end to end withstill_permitted, after two more fresh-context reviews.Why both
/kirocrew agentand the in-turn@bot /agent(crew-pr-reviewer r113): Kyle asked for both doors. They are one switch; the slash command posts nothing to the channel, answers ephemerally, and a bare/kirocrew agentlists the agents a person may pick.Screenshots / video
Trust copy and resolved cards (current head). Both Trust confirmations now say who can undo Trust and how (only Kiro Crew's owner, by picking Normal in the first message; helper sessions follow). The two cards after Trust are shown: the channel card resolved by Trust this channel, and a helper session's card that ran under Trust. The override note leads with what it does and names YOLO after it. Settings describes Reads and Trust for new code channels. Slack frames are rendered from the exact Block Kit JSON the code emits, in a Slack-style page: a mock, not a Slack client capture. Frames that showed older copy were removed.
Channel approval card after Trust this channel succeeds:












Helper session's card after the Trust sweep approved its call:
"Trust this channel?" confirm, now saying who can undo it and how:
Kickoff select, private "Switch to Trust" confirm, same undo line:
Kickoff while the all-sessions override is on, leading with what it does:
Settings → Code channels: Reads and Trust described for new channels, not "this chat":
The warning line after a switch to Trust (unchanged):


Agent picker (current head). Each option leads with a plain role and the name (
Team lead (kirocrew-team-lead)), and its description line says what that shipped agent is best for, written to fit uncut, so no two options read alike. Only an agent Kiro Crew doesn't ship shows its own description, cut at a word. Drawn from the exact Block Kit JSON the code emits, with the real shipped agents:Earlier round.
/kirocrew agentlists one line per agent with its description. The approval command is named after the mode (/kirocrew approval normal|reads|trust); the/kirocrew trustspelling and theask/allwords never reached main and are gone (each is now refused as unknown). The YOLO line leads with the effect (every tool runs without asking, in every session, whatever the select shows), then what turns it off. Settings keeps Trust's description, with the warning below it. Trust this channel? confirms with a red (danger) button on both cards, the same colour as the select's Switch to Trust, and on a worker's card the dialog says it approves the worker's call and puts the whole channel on Trust. The docs (slack-setup.md, the Slack gateway spec) teachapproval normal|reads|trust, withtrust …only as an alias. Frames 1-5 and 7-8 are rendered from the code's own Block Kit JSON with the shipped agents' real descriptions; frame 6 is the real built SPA with fixture API data.UX review round. The button keeps the label Trust this channel: it is the name Kyle approved in his 2026-10-23 rulings. What it does is spelled out where it is pressed: the button opens a "Trust this channel?" confirm saying it approves this call and puts the whole channel on Trust, and a Reads or Trust pick in the Approval mode select asks privately, naming the mode. The frames below show both dialogs, the select opened (kickoff and Settings), the shipped Trust warning (
/kirocrew trust normal) and the current Settings hint; frames whose text changed since were replaced. The worker card header now says whose worker it is ("A worker this channel started (…)"). The "no picker" frame is the state where the agent list could not be read, not a non-owner view: Slack shows one message to everyone, and a non-owner's pick is refused privately ("Non-owner refused"). Each mode is now explained where it is picked: the kickoff carries a line under the Approval mode select ("Normal asks before every tool · Reads runs read-only shell commands on its own and asks for the rest · Trust runs everything without asking"; Block Kit options cannot carry a description), and Settings shows the picked mode's description (the dashboard picker's own text) under the field, with Trust's channel warning in its place on Trust. The select carries no dialog: Block Kit confirms a select as a whole, so its dialog could never name the pick. Picking Reads or Trust changes nothing and replies privately with what the mode does and a button that names it ("Switch to Reads" / "Switch to Trust"; one click, pinned to the channel's session, good for 10 minutes); Normal applies at once. Someone other than Kiro Crew's owner is told who can change it. Settings gives Normal a source note too ("Built-in default").Kickoff with the agent picker on the default,
kirocrew-conductor:The picker open, listing the
_choosableroster:After a pick:
/kirocrew agent, with an unknown name and then a valid one:Kickoff with both selects:
Approval cards in the channel:
Settings → Code channels, default (Normal):
Pick during a turn, text fallback, non-owner refusal, dark and light themes
Related Issues
Builds on #21429 (merged). Carries #21997 (merged into this branch). #22001 stacks on this PR.
Checklist
docs/guides/slack-setup.md: "Choosing each code channel's agent", "Approval mode for code channels")