Skip to content

fix: make gateway --approval yolo auto-approve dashboard chat tools - #31487

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/29697-gateway-yolo-dashboard
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/29697-gateway-yolo-dashboard

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A gateway started with --approval yolo runs dashboard chat tool calls without an approval card, as the flag's help promises.

kirocrew gateway --approval yolo (isolated KIROCREW_HOME) still stops a dashboard chat on a permission card for a shell call, a cron_add call or a skill load. Nothing runs until someone clicks Allow, an unattended run is declined after the approval timeout, and the chat's mode picker shows Normal.

Why it matters

Test harnesses, eval runs, pods and the GUI user test start the gateway with --approval yolo so that no prompt ever appears (scripts/gui-user-test/boot.sh says so). In those runs every dashboard chat waits on a card instead, which is the opposite of the documented "'yolo' auto-approves all tools".

Not a goal

  • The background (cron, subagent, task runner) and messaging-channel approval paths: they already read the flag.
  • Changing Slack. Slack turns, and dashboard turns a Slack message started or that run in a channel-linked slot, keep asking under the flag exactly as before.
  • --approval reads in dashboard chats. The dashboard's Reads rung is per slot (trust_reads) with no process-wide switch to seed, and --test-mode defaults to reads, so honouring it would change every test-mode harness. It needs its own issue.
  • Kiro Crew's own deny floors. A command the gate refuses (the issue's echo yolo > file, refused as an unsafe shell pattern) stays refused under yolo, and the "You rejected it" wording after that refusal is a separate defect.
  • Making an approval_modes deny or a dashboard mode pick reach background turns.

What changed (motivation → approach → change)

Dashboard chats stopped on a card because they decide auto-approval from the process-wide safety override, while the --approval flag only ever reached the orchestrator's background approval path. Nothing armed the override from the flag.

The gateway passes its --approval value to start_dashboard, and _apply_startup_yolo arms the override from yolo through grant_declared_yolo (safety_override.py, which now takes the grant's source), with source cli. Slack also reads that override, so a cli grant is the dashboard's only (SafetyOverride.is_cli_launch in safety_override_grant.py): Slack's is_yolo_mode, its /yolo command and its subagent gate ignore it, and so does a dashboard turn a channel message started or steered, or one in a channel-linked slot (DashboardState.yolo_reaches, read wherever a dashboard turn decides or stores auto-approval).

Control What it does to the flag's grant
activation audit critical: no audit row, no grant
yolo_max_seconds, yolo_duration scope make it a timed grant that lapses
approval_modes policy denying yolo refuses or revokes it
status bar, mode picker show it, and another pick ends it
tool gate deny list, protected paths still refuse

The flag is a launch-time operator declaration (only the operator starting the process can pass it, it needs a non-default KIROCREW_HOME, kirocrew restart repeats it), so it lasts the launch like the config declaration. The CLI, governance and dashboard-bootstrap specs describe this.

Backwards compatibility

Compatible: only a gateway launched with --approval yolo behaves differently, and only in dashboard chats on unlinked slots, which now do what the flag documents. Slack and channel-linked dashboard turns ask as before. start_dashboard and _apply_startup_yolo take an optional approval_mode (default None), and grant_declared_yolo an optional source (default config), so every existing caller is unchanged.

Removes nothing: the diff arms an existing grant from an existing flag; no path, record, validator or key is taken away.

Tests

  • test/test_dashboard_yolo_startup.py::test_gateway_approval_yolo_arms_a_cli_grant: the flag arms a no-expiry grant with source cli.
  • ::test_gateway_approval_yolo_leaves_slack_asking: under it, is_yolo_mode() is false and Slack's _resolve_approval_mode answers interactive; ::test_a_slack_yolo_grant_still_reaches_slack keeps the owner's own yolo on working.
  • ::test_the_cli_grant_reaches_unlinked_dashboard_turns_only and ::test_any_other_grant_reaches_every_dashboard_turn: the narrowing is the cli grant's alone.
  • ::test_gateway_approval_yolo_is_refused_when_policy_denies_yolo, ::test_gateway_approval_yolo_is_refused_when_its_audit_fails, ::test_gateway_approval_yolo_expires_at_the_time_cap, ::test_gateway_approval_yolo_shows_on_the_status_bar, ::test_only_gateway_approval_yolo_arms_the_grant, ::test_gateway_approval_yolo_keeps_the_tool_gate_floors: the controls in the table, and that no other --approval value arms anything.
  • ::test_an_ended_cli_grant_is_not_one: is_cli_launch covers a live or renewable cli grant only.
  • test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo: picking Reads or Trust on one slot ends the flag's grant, as it ends a declared one.
  • test/test_slack_events_coverage.py::TestHandleYolo::test_the_cli_grant_is_not_slacks and test/test_slack_handler_coverage.py::TestYoloCommand::test_the_cli_grant_is_not_slacks_to_renew: Slack's /yolo and !yolo read the grant as off and do not renew it.
  • test/test_channel_approval_meta.py::test_a_cli_grant_leaves_channel_agents_asking: a channel agent shows its card under a cli grant and auto-approves under a dashboard one.
  • test/test_unattended_slot_guardrails.py::TestGatewayApprovalYoloReachesDashboardChatsOnly: through the turn runner, an unlinked dashboard turn auto-approves, while a Slack-linked slot's turn and a turn typed in Slack show the card and store no auto policy.
  • test/test_slack_gateway_run.py::TestInitDashboard::test_init_dashboard_creates_state: the orchestrator hands its approval_mode to start_dashboard.
  • test/test_dashboard_server_composition_contract.py and test/test_state_parts_dashboard_state.py: the new _apply_startup_yolo signature and the new yolo_reaches member.

test/test_chat_mode_cron.py and test/test_chat_mode_security.py give their override fakes the new is_cli_launch attribute.

Determinism: the new tests and their files passed 20 runs at -n0 and 5 runs at -n 4 --dist loadgroup beside test_safety_override.py, and one shuffled run (122 ids, seed 31487).

Proof: PROVEN test/test_channel_approval_meta.py::test_a_cli_grant_leaves_channel_agents_asking[cli-True], test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo[trust_reads], test/test_dashboard_chat_approval_mode.py::TestApiChatModePropagation::test_a_slot_pick_ends_gateway_approval_yolo[trust], test/test_dashboard_server_composition_contract.py::test_the_moved_names_keep_their_base_shapes, test/test_slack_events_coverage.py::TestHandleYolo::test_the_cli_grant_is_not_slacks[renew] (head 6efb4c7118bf; since then only rebased and black-formatted, now ffc14e3)

Manual verification

Not run against a live gateway. To check by hand: KIROCREW_HOME=$(mktemp -d) kirocrew gateway --test-mode --approval yolo, open a dashboard chat and ask it to run sleep 1; echo ok. The command runs with no card and the status bar shows auto-approve on.

Screenshots / video

N/A — no file under website/ changes.

Related Issues

Closes #29697

Sibling sweep

Swept: git grep -n "safety_override().is_active()|is_yolo_mode()|state.is_yolo_active()" -- src/kiro_crew
Sibling: src/kiro_crew/slack/handler_runtime/access.py:214 -- changed here
Sibling: src/kiro_crew/slack/events_slash.py:233 -- changed here
Sibling: src/kiro_crew/slack/handler_runtime/commands.py:226 -- changed here
Sibling: src/kiro_crew/dashboard/chat_api/slot_approval.py:451 -- changed here
Sibling: src/kiro_crew/slack/gateway_runtime/subagent_wiring.py:331 -- changed here
Sibling: src/kiro_crew/channel.py:1571 -- changed here

is_yolo_mode covers the Slack queue, permission ladder, commands and home tab; /yolo and !yolo read and renew only Slack's view; a slot-scoped Reads or Trust pick ends a cli grant as it ends a declared one; Slack's subagent spawn gate ignores a cli grant, and a dashboard parent passes it on through its stored session policy; a dashboard channel agent (channel.py, which does not read the flag) keeps asking under a cli grant.
Sibling: src/kiro_crew/slack/gateway_runtime/turn_approvals.py:302 -- not affected -- that path already auto-approves on the flag itself
Sibling: src/kiro_crew/telegram/gateway.py:72 -- not affected -- reads the flag in _resolve_approval_mode on every message, as do the discord, feishu, imessage, teams, webex and wecom gateways
Sibling: src/kiro_crew/dashboard/chat_turn/turn_ending.py:390 -- not affected -- it reads yolo only to downgrade a recovery to a notice, which is the safer reading

Pattern harvest

Not generalizable: one launch flag had two consumers reading two different switches; no syntactic shape marks a flag whose second consumer was never wired.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license (see the Licensing section of CONTRIBUTING.md).

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 15:18
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 15:18
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision ffc14e388b0d02f51098bde4be575b846379ef48 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ffc14e388b0d02f51098bde4be575b846379ef48 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix arms an existing grant from an existing flag. The new cli grant source and its Slack and channel exemptions cost more than the fix itself.

Notes

  • Item 8 — symptom-level: the flag's grant is process-wide, so keeping Slack and channel agents asking ("Slack also reads that override, so a cli grant is the dashboard's only") takes is_cli_launch/yolo_reaches guards at 13 sites in src/ (grepped is_cli_launch|yolo_reaches). Seven other safety_override().is_active() readers stay unguarded (e.g. messaging/dispatch_contract.py:351), and the next reader added will have to remember the exemption. The underlying problem is that yolo has two sources: the flag on the orchestrator and the process-wide override. Subtraction: none smaller that still keeps the enterprise approval_modes ceiling. The description should say this sits at mechanism level and that the two-source split is what remains.

What this change ships

Inventory (8 items) — 7 justified

Intent: FIX, closes #29697: a gateway started with --approval yolo runs dashboard chat tools without an approval card.

  1. Dashboard chats on unlinked slots run tools with no card under --approval yolo — justified
  2. The status bar and mode picker show auto-approve on for the flag's grant — justified
  3. Picking Reads or Trust on one slot ends the flag's grant — justified
  4. The policy deny, yolo_max_seconds and the critical audit now govern the flag's grant in dashboard chats — justified
  5. Slack is_yolo_mode, /yolo status and renew, and !yolo renew read the flag's grant as off — justified
  6. Dashboard turns that a channel started or steered, or that run in a channel-linked slot, keep asking — justified
  7. Channel agents and the Slack subagent gate ignore the flag's grant — justified
  8. New cli grant source, is_cli_launch, yolo_reaches, and a source parameter on grant_declared_yolo — symptom-level: guards spread across 13 sites

[FIRST-PRINCIPLES-REVIEWED] ffc14e3

Description read

[DESCRIPTION-READ] 15bb40cd273b92fa2462ab1c38cca25388df71a19a2fce0ac9a8039b3d4c788f

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the flag now arms the existing declared grant through its existing controls, and the Slack carve-out keeps Slack behaving as it did before.

Notes

  • The cli carve-out is opt-out: each Slack reader has to add is_cli_launch is not True on its own (five sites here). A new Slack-side safety_override().is_active() reader that skips that check would auto-approve under --approval yolo without any error. Either make is_active() take a scope that Slack passes in one place, or add a sibling-sweep test that pins the list of Slack readers.
  • turn_ending.py:390 still reads bare state.is_yolo_active(). Under the cli grant, a Slack-linked slot whose turns still prompt for approval would also get its recovery downgraded to a notice. This is harmless, but it is the one dashboard reader that was not routed through yolo_reaches.

[DESIGN-REVIEWED] ffc14e3

Description read

[DESCRIPTION-READ] 6b3d2700170fd80512703df5ebb229170af92514f80279f38aabbc4fdfae8822

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ffc14e3

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

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ffc14e3

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

@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 15:43
@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

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The red that remains on this PR belongs to main: the security package line budget check has failed on main since #30774 (reported in #31648), and this PR does not touch that package. #31625 raises the budget and is in flight. This PR waits for #31625 to merge, then rebases onto it and pushes once.

@bolichen97
bolichen97 force-pushed the fix/29697-gateway-yolo-dashboard branch from 1cc692d to 4eb77aa Compare November 6, 2026 23:50
@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
A gateway started with --approval yolo still stopped dashboard chats on
an approval card: only the background approval path read the flag, and
dashboard chats read the process-wide safety override, which nothing
armed from it.

At startup the dashboard takes the declared grant from the flag (audit
source cli), the same grant agent.dangerouslySkipPermissions uses: it
is refused when an approval_modes policy denies yolo and bounded by the
yolo_duration scope and yolo_max_seconds. Picking another mode in the
dashboard ends it for dashboard chats.

Closes #29697
@bolichen97
bolichen97 force-pushed the fix/29697-gateway-yolo-dashboard branch from 4eb77aa to ffc14e3 Compare November 7, 2026 00:28
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for the on-call. Review lanes pass on ffc14e3, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit f2d2537 into main Nov 7, 2026
109 of 114 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/29697-gateway-yolo-dashboard branch November 7, 2026 07:34
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…31487)

A gateway started with --approval yolo still stopped dashboard chats on
an approval card: only the background approval path read the flag, and
dashboard chats read the process-wide safety override, which nothing
armed from it.

At startup the dashboard takes the declared grant from the flag (audit
source cli), the same grant agent.dangerouslySkipPermissions uses: it
is refused when an approval_modes policy denies yolo and bounded by the
yolo_duration scope and yolo_max_seconds. Picking another mode in the
dashboard ends it for dashboard chats.

Closes #29697

(cherry picked from commit f2d2537)
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.

kirocrew gateway --approval yolo does not auto-approve tool calls in dashboard chats

2 participants