Skip to content

feat(relay): Remote Crews with no setting, team hosts on by default - #39394

Open
bolichen97 wants to merge 1 commit into
mainfrom
feat/relay-stories
Open

bolichen97 wants to merge 1 commit into
mainfrom
feat/relay-stories

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A person signed in to Kiro sees the Remote Crews they can open with nothing to set, a team Crew hosts on the relay by default and can sign in with its own workload identity, and a refused lease shows the service's own reason.

Four relay gaps, one story each:

Story What a person hits today
1. Remote Crews with no setting No Remote Crews until tunnel.relay_viewer_enabled true is set by hand. A leftover tunnel.relay_viewer_relay_domain hides every Crew. Signed out, the switcher shows a red notice.
2. Workload identity A team Crew that runs as a workload has no person sign-in: it is never ready, serves no models and falls back to the person sign-in lease.
3. Team hosts on by default A team Crew with a team key does not register until someone runs kirocrew remote-control on, so teammates see it offline.
5. Lease refusal reason A refused lease says "cannot host now, or remote access is off" when the service said "Invalid token".

Why it matters

Remote Crews is the way into a Shared Crew. Today nobody finds it without a config line, a leftover test value turns it off without a word, a team host stays offline until a manual on, and a team host in a pod cannot host at all. When a lease is refused, the owner cannot tell a bad key from a policy.

Not a goal

  • Turning Remote Control (hosting) on by default for personal sign-ins.
  • A new settings row for the relay viewer's dev settings.
  • Changing tunnel.relay_viewer_oidc_scope_prefix.
  • A gRPC Workload API client (story 2 reads the JWT-SVID file a sidecar writes).
  • Doctor, kirocrew kas status and whoami text for a workload host.

What changed (motivation → approach → change)

Story Change Where
1 The relay viewer needs no setting; only an LTS build keeps it off. tunnel.relay_viewer_enabled becomes a dev switch: the dev control plane URL, the test credential and (with the URL) the relay domain count only while it is on, so a leftover value cannot hide every Crew or receive the person's sign-in. With no dev domain, a Crew is listed and gets a token only at https://<endpointId>.<one label>.relay.kiro.dev. Every owner dashboard lists, desktop app and browser tab alike. The list hides quietly while signed out, refused or not the owner; a network or server failure shows a notice (with the rows it had, if any); and it reads again after 15 minutes on a refusal (a longer Retry-After wins), inside the existing poll; those routine refusals are not journaled. dashboard/handlers/relay_viewer.py, relay_viewer/cps.py, hooks/useRelayViewerCrews.ts, components/TeamCrewsGroup.tsx, components/SharedCrewsCards.tsx, api/client.ts, api/client/instances.ts, api/client/transport.ts, test/relayViewerCrewsApi.test.ts, i18n catalogs
2 Behind KIROCREW_WORKLOAD_IDENTITY, the Crew signs in with its own JWT-SVID, read from a file a sidecar such as spiffe-helper writes and refreshes. The KAS callback answers with it, the turn gate counts it for a turn on KAS (the kiro-cli probe stays kiro-cli's own answer), models come from the engine's recording, and the lease reads the same file through the existing file form of tunnel.relay_lease_credential. Nothing reads or writes the person vault while the switch is set, the relay viewer included. Based on a prototype by Sam. workload_identity.py, acp/kas_host_auth.py, acp/kas_route.py, agent_sdk/kas_model_catalog.py, auth/bridge.py, kiro_prerequisite_probe.py, relay_client/provider.py, dashboard/kiro_readiness.py, dashboard/sign_in_refresher.py, dashboard/handlers/agents.py, dashboard/handlers/models_kas_bundle.py
3 tunnel.relay_enabled has three stored values: true hosts, false never hosts, unset (the new default) hosts only when the Crew has a team key (API_KEY) or a workload identity. A personal sign-in stays off by default, and a stored value always wins. The first default connect says so once (a log line and a bell note). Builder ID and social sign-ins are held locally with no lease call. Turning Remote Control off over the relay itself is refused (403, audited; the read still answers and the card shows read-only). --test-mode and --seed imply --no-tunnel. remote_control/hosting.py, remote_control/default_notice.py, remote_control/guard.py, remote_control/setting.py, remote_control/cli.py, remote_control/defaults.py, edition_locks.py, config/validation.py, config/section_builders.py, config/integration_sections.py, relay_client/lease_signin.py, dashboard/handlers/remote_control.py, dashboard/kiro_relay/, dashboard/server_runtime/tunnel.py, src/kiro_crew/cli.py, cli_gateway_boot.py, pages/settings/RemoteControlCard.tsx, api/client/remoteAccess.ts, config-baseline.json
5 Each lease refusal text and its log line end with The service said: "<message>". The message is kept only when it is plain ASCII words with no ARN or 12-digit number, redacted and cut to 200 characters. relay_client/lease.py, security_posture_sinks_gateway.py (the status text is a registered redaction sink)

Upgrade: an existing home that has a team key and stores no tunnel.relay_enabled value starts hosting on the relay after this upgrade, with no on: setting the team key is the owner's choice to host. A home that stores false (an off, a pod seed, a full settings save on an older build) stays off. A personal sign-in never starts hosting by itself.

Docs: remote-crew.md, configuration.md, the feature map and the specs (kas-auth.md, platform-context.md, config.md, cli.md, dashboard-token-auth.md, shared-crew.md) describe the new behaviour.

Backwards compatibility

Breaking: (1) a stored tunnel.relay_viewer_enabled: false no longer hides the list, and a stored tunnel.relay_viewer_cps_url, tunnel.relay_viewer_credential or tunnel.relay_viewer_relay_domain is ignored unless tunnel.relay_viewer_enabled is true. Writer sweep on origin/main @ 99953f8: the only writers of these keys are kirocrew config set and hand edits (the settings page refuses tunnel.relay_viewer_enabled); test setups that use the dev keys already set tunnel.relay_viewer_enabled true (remote-crew.md says so). (2) An unset tunnel.relay_enabled with a team key now hosts (see Upgrade above); writers of tunnel.relay_enabled are kirocrew remote-control on|off, the pod seed (writes false) and full settings saves, all of which keep their stored value. (3) PUT /api/remote-control through the relay is refused; the only caller is the Remote Control card, which shows read-only there. (4) --test-mode and --seed no longer start a tunnel.

Reader: website/src/components/TeamCrewsGroup.tsx:TeamCrewsSwitcher -- crew page -- reads hidden, crews, account, refreshOnOpen; the list-refusal notice is gone, row refusals stay (TeamCrewsGroup.test.tsx)
Reader: website/src/components/SharedCrewsCards.tsx:SharedCrewsCards -- crew page -- hidden until a list loads; row refusals and the Kiro account link stay (SharedCrewsCards.test.tsx)
Reader: website/src/hooks/useRelayViewerCrews.ts:relayRetryable -- crew page -- removed; its only reader was the list notice (git grep relayRetryable is empty)
Reader: website/src/i18n/locales/*.json:components.relayCrews.try_again, sign_in, request_id, components.sharedCrews.refusal_signed_out, refusal_not_configured, refusal_list_generic -- crew page -- no reference left (deadKeys.test.ts)
Reader: src/kiro_crew/dashboard/handlers/relay_viewer.py:_settings -- crew page -- every relay viewer route; dev values honoured only with the switch (test_with_the_dev_switch_off_leftover_dev_settings_are_ignored)
Reader: src/kiro_crew/dashboard/handlers/remote_control.py:PUT /api/remote-control -- crew page -- refused only through the relay; local Turn off unchanged (test_off_over_the_relay_is_refused_and_audited_but_get_answers)
Reader: src/kiro_crew/cli_gateway_boot.py:--test-mode, --seed -- release -- test and seed gateways start with no tunnel; the relay is never the point of either (test_remote_control_hosting_default.py)
Reader: src/kiro_crew/relay_viewer/cps.py:_crew_endpoint -- crew page -- list and mint, desktop and browser open; hosts outside Kiro's relay zone are left out (test_with_no_setting_the_browser_opens_only_a_crew_in_kiros_relay_zone)

Tests

  • Story 1: route tests for no setting, the dev switch, a leftover URL alone (no bearer), the domain only with a URL, and the LTS lock; the relay zone rule (kept and left-out hosts); POST /api/relay-viewer/browser-open opens only a zone Crew; hook tests for quiet hide, a list kept through a failed read with its notice on both surfaces, the 15-minute refusal back-off and Retry-After; the crews read does not journal its routine refusals.
  • Story 2: test/test_workload_identity.py (31 tests): settings, claims, fail-closed, the KAS answer, the lease credential, no vault use; the kiro-cli probe stays not ready on a usable JWT-SVID, and the turn gate admits only a turn on KAS.
  • Story 3: test/test_remote_control_hosting_default.py: the three stored values, the team key and workload cases, a personal sign-in, a quoted "false", the one-time notice, off over the relay, --test-mode; the leaf names pinned to the lease client and workload_identity.
  • Story 5: test/test_relay_client_lease_refusal_message.py (22 tests) and two flipped pins in test_relay_client_lease.py.
  • Determinism: the changed relay viewer files 5 repeats with -n 4 (373 passed each), and 254 node ids in a shuffled order with -n0 (254 passed). The new tests use no clock; the hook tests use a fake clock moved by hand.

Manual verification

See below; the UI was checked in the desktop app (Xvfb) and in a plain headless Chromium.

Real-machine verification

Machine: EC2 e2e-viewer, Ubuntu, x86_64, 8 vCPU; and a DevSpace host, Amazon Linux 2023, x86_64, 32 vCPU. Own home, gateway 6991, fake control plane on loopback 7991.
Before (main a4efe28 on EC2, dcc3121 on DevSpace): signed in, no setting -> GET /api/relay-viewer/crews 404 RELAY_VIEWER_OFF, no Crew switcher in the app or a browser; a leftover relay domain -> 200 with 0 Crews; a dev control plane listing <id>.evil.example.test -> listed; signed out with the viewer on -> red "Sign in to Kiro to see your Shared Crews."
After (head, same steps): 200 with the 4 Shared Crews in the app and a browser; Connect in a browser opens the Crew at kcr-<sid>.localhost:6991; a leftover tunnel.relay_viewer_cps_url alone gets 0 requests through sign-out, sign-in and list reads; the leftover domain is ignored (4 Crews); the evil host is left out; signed out -> hidden, no notice. Story 5 RenewCrewLease with a junk key against the prod lease service -> The service said: "Invalid token" (and the two other token types). Story 2 with a fake sidecar and lease service -> models 200, the KAS callback and the lease carry the SVID, an empty credential is refused by name, the person vault is unchanged. Story 3 with a junk team key and no on -> main: requested:false, no lease call; head: requested:true, by_default:true, the prod lease service called; a personal sign-in and a stored false stay off; --test-mode starts no tunnel.
Cleanup: own computers and an existing test box; every test gateway and fake stopped, the run homes with junk keys deleted. No machine stopped.

Screenshots / video

Before and after, desktop app and browser:

Before (main) After
Signed in, no setting: no switcher The 4 Shared Crews
Signed out: red notice Signed out: hidden

A browser tab's Connect opens the Crew on its own loopback site:

Related Issues

Closes #39384
Closes #39353
Closes #39357
Closes #39391

Checklist

  • A Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits
  • 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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 19, 2026 04:48
@bolichen97
bolichen97 requested a review from buluoray November 19, 2026 04:48
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks. Every tunnel.relay_enabled reader now goes through remote_control.hosting.relay_requested, and a stored value always wins.

Notes

  • Story 2 (the workload identity sign-in in workload_identity.py, kas_host_auth.py and the readiness and catalog hooks) is a separate feature from the relay stories. Ship it in its own PR so a revert of the hosting default doesn't also pull the pod sign-in.
  • After upgrade, a home with a team key and no stored value starts accepting relay traffic with no action from the owner. The first-connect notice is the only signal they get. A one-time doctor or startup line naming kirocrew remote-control off would make that step easy to find.
  • defaults.py still calls the personal-sign-in default "an open product decision". The team-key default this PR adopts is a product decision too, but no docs/decisions/ entry records it.

[DESIGN-REVIEWED] 12ab428

Description read

[DESCRIPTION-READ] 787bd3cd2bb54ac4017540f0a8216357438f5ffdbb692ddad14b2ff2b393e7cd

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🔴 BLOCK

Premise-level review of 12ab42826f070879a3cd69ed563692bdc4e4aceb — 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: BLOCK

The PR changes two defaults: the relay viewer now lists Remote Crews with no setting, and an unset tunnel.relay_enabled now hosts on the relay whenever a team key exists. No base RFC or recorded decision covers either one.

Notes

  • Item 9 — rides along, undeclared in Goal: "--test-mode and --seed imply --no-tunnel". Neither story's harm needs it. Subtraction: drop the cli_gateway_boot.py flag implication from this PR.

What this change ships

Inventory (10 items) — 7 justified

Intent: let a Kiro-signed-in person find and open Remote Crews, and let team Crews host by default with a readable lease refusal. ADDITION.

  1. Remote Crews list appears with no setting (off only in LTS) — changed default, no recorded decision
  2. Leftover dev viewer keys are ignored unless relay_viewer_enabled is true — justified
  3. Signed-out or refused list hides quietly; the red notice is gone — justified
  4. A team-key or workload Crew hosts on the relay with no on ("relay_enabled": false → null) — changed default, no recorded decision
  5. One-time log line and bell note on the first default connect — justified
  6. Workload identity sign-in from a JWT-SVID file behind KIROCREW_WORKLOAD_IDENTITY — justified
  7. Lease refusal shows The service said: "<message>" — justified
  8. Turning Remote Control off through the relay is refused (403) — justified
  9. --test-mode/--seed no longer start a tunnel — rides along
  10. Builder ID/social sign-ins held locally with no lease call — justified

Blockers

Product-shape change without accepted RFC: Remote Crews viewer on by default (item 1)
Trigger: the feature map row changes from "Off unless tunnel.relay_viewer_enabled is set" to "On with no setting (off in an LTS build)". The base RFC list has no relay-viewer RFC. rfc-remote-crew-sidebar.md (partial) covers peer sidebar grouping, not this default.
Outcome: every non-LTS owner dashboard now calls the control plane with the person's sign-in, and nobody recorded deciding that.
Clears when: an RFC covering the relay viewer's default-on shape is merged non-draft on base (then push or rebase), or a maintainer posts /ai-review override first-principles 12ab42826f070879a3cd69ed563692bdc4e4aceb product-shape: <decision>.

Product-shape change without accepted RFC: team hosts on the relay by default (item 4)
Trigger: config-baseline.json changes -"relay_enabled": false to +"relay_enabled": null. The description says "an existing home that has a team key … starts hosting on the relay after this upgrade, with no on". No base RFC covers relay hosting defaults.
Outcome: existing team-key homes start exposing their Crew on the relay after an upgrade, with no recorded decision.
Clears when: an RFC covering default relay hosting for team-key and workload Crews is merged non-draft on base (then push or rebase), or a maintainer posts /ai-review override first-principles 12ab42826f070879a3cd69ed563692bdc4e4aceb product-shape: <decision>.

[FIRST-PRINCIPLES-REVIEWED] 12ab428

Description read

[DESCRIPTION-READ] 393cce63f56e2ce956b97b5fe685a49dd91c8382a4064e16596412e78d593dd5

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 19, 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 12ab42826f070879a3cd69ed563692bdc4e4aceb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing screenshots of the "Couldn't load" state with rows kept, the read-only Remote Control card on a relayed page, and the default-hosting bell note. Shot-03 shows the signed-out notice this PR removes, so it is not this revision.

Evidence gaps

  • Signed-out switcher. The diff removes RelayListRefusalNotice and the refusal_signed_out string, so a signed-out user should now see the "Remote Crews" group hidden with no message. Shot-03 still shows the red "Sign in to Kiro to see your Shared Crews." line, which is the base build. A head-build screenshot of the signed-out switcher would close this gap.
  • Failed read in the switcher. The new failed branch shows "Couldn't load your Shared Crews." above the last rows it loaded, or with no rows on a first read. No screenshot shows it. One screenshot of each case, with rows and with none, would close it.
  • Failed read on the "Shared with me" page. SharedCrewsCards gets the same failed notice (shared-crews-refresh-failed) above its rows, and the card also lost its sign-in link and Try again. No screenshot shows this card at all. A screenshot of the card in both its loaded and failed states would close it.
  • Remote Control card on a relayed page. remote-control-local-only reads "Turn Remote Control off on the machine running {{productName}}. It can't be turned off through the relay.", and the Turn off button and its off-effect line are gone. No screenshot shows the card. A screenshot of it opened through the relay would close it.
  • Bell note for default hosting. The note reads "This Crew is now reachable through the Kiro relay" / "Remote Control is on by default because this Crew has a team key…". It appears once, the first time a team Crew connects by default. No screenshot shows it. A screenshot of the bell panel holding it would close it.

Notes

  • The failed notice has no Try again, so the reader can only wait for the next poll, which can be up to a minute away. Add a "Reload list" item next to "Couldn't load your Shared Crews." in the menu and on the card.
  • The blind reader would not dare press "Connect" ("I don't know whose machine they are"). The change this PR makes is that every signed-in user now sees these rows. Add the owner or host name to each row's "Shared · online" line.

[UX-REVIEWED] 12ab428

Description read

[DESCRIPTION-READ] af8e41722002988a3ddccf26e8b6f2c63db33a45225ec46ce5954cebbff8c214

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .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 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — 🔴 changes requested (blocking)

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

A failed first read of the relay Crew list (a 5xx, a network failure or a throttle) now shows nothing at all, which breaks the blocking errors-use-error-notice rule. Separately, now that the viewer is on by default, a non-owner dashboard's routine 403 owner_only gets journaled on every read.

BLOCKING — website/src/hooks/useRelayViewerCrews.ts:256
if (!q.data || isOffError(q.error) || isRefusal(q.error)) { / return { hidden: true, crews: [], account: null, failed: false, refreshOnOpen }
Trigger: An owner with Shared Crews opens Settings > Remote Crew (SharedCrewsCards), or the top-bar switcher (TeamCrewsSwitcher). The first GET /api/relay-viewer/crews answers 502 SERVICE_ERROR, 503 UNREACHABLE or 429, or the fetch rejects. q.data is undefined, so the hook returns hidden: true, failed: false, and SharedCrewsCards returns null.
Outcome: The query's error never reaches the JSX. A server or network failure looks exactly like "no relay access": no ErrorNotice, no Ask the agent, no retry. The new tests pin this ([502, 'SERVICE_ERROR'] "renders nothing, with no notice"). Before this PR, the same failure rendered shared-crews-refusal / RelayListRefusalNotice.
Anchor: errors-use-error-notice
Fix: Hide quietly only for isOffError / isRefusal. For any other failure with no data, render refusal_list_generic through ErrorNotice: with askAgent in the Shared Crews card, and as the ErrorNoticeMenuItem sibling form in the switcher.

BLOCKING — website/src/api/client.ts:1329
const RELAY_VIEWER_ROUTINE: readonly BenignDenial[] = [ (lists 404 OFF, SIGNED_OUT, REMOTE_ACCESS_DISABLED, CREW_ACCESS_NOT_GRANTED, ACCESS_DENIED; no owner_only)
Trigger: A non-owner dashboard session, such as a Telegram, Teams or Webex allowlist link (require_owner_for_dashboard_caller), loads any page. shellHeader mounts TeamCrewsSwitcher, which calls api.relayViewerCrews(). _settings() no longer returns None on a non-LTS build, so the handler reaches require_owner_dashboard_request and answers 403 owner_only. That code is not in RELAY_VIEWER_ROUTINE, so apiFailure calls recordError.
Outcome: The client treats this answer as "off" (HIDING_403) and hides the list, yet it files an error-journal report on every load and every 15-minute poll. Before this PR, the 404 RELAY_VIEWER_OFF came before the owner check and was benign. The spurious reports push real ones out of the 20-entry journal that ErrorNotice / Ask the agent read their context from.
Anchor: defect
Fix: Add { status: 403, code: 'owner_only' } to RELAY_VIEWER_ROUTINE, which matches HIDING_403 and the jConfigPending precedent.

[BLOCK-MERGE] f281b4e
[OPUS-REVIEWED] f281b4e

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

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

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging f281b4e988395bdf89dc51ed4a2142863055680f. 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/dashboard/handlers/relay_viewer.py:152 -- Workload hosts still consume a leftover personal sign-in

return "", "", ""
Trigger: Open the owner dashboard on a workload-identity Crew that retains a usable personal sign-in. useRelayViewerCrews → api_relay_viewer_crews → _settings supplies an empty credential reference → _bearer constructs KasAuthProvider and reads the personal vault.
Outcome: The automatic request sends the person's bearer and displays their remote Crews despite the host running under its workload identity. When renewal is due, ensure_fresh also refreshes and writes that personal vault; disabling the background refresher does not prevent this path.
Anchor: defect
Fix: Reject person-backed viewer requests during workload mode before constructing the personal auth provider, covering both list and mint paths.

[BLOCK-MERGE] f281b4e
[GPT-REVIEWED] f281b4e

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 (fenced). The rung is UNBOUNDED as claimed, because the personal credential gets used and renewed on a host that is meant to run only under its workload identity. I checked each condition in the code:

  • _settings returns "", "", "" when the dev switch is off (src/kiro_crew/dashboard/handlers/relay_viewer.py:151-152).
  • _bearer with an empty ref goes straight to KasAuthProvider(default_token_store(), ...) (relay_viewer.py:211-226), and on a CPS 401 it forces a refresh at relay_viewer.py:236. Nothing on that path checks workload_identity.active(), while auth/bridge.py:79,187 and dashboard/sign_in_refresher.py:169 do check it.

This is not a FLAG. All it needs is a host that had a personal sign-in and was then switched to KIROCREW_WORKLOAD_IDENTITY. That is an ordinary migration, not an extreme combination. Nothing recovers from it: the PR's stated invariant ("No path reads, renews or writes the person vault while the switch is set") is broken without any visible sign.

[ADJUDICATION] f281b4e988395bdf89dc51ed4a2142863055680f total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] f281b4e988395bdf89dc51ed4a2142863055680f

[ADJUDICATION-FENCED] f281b4e988395bdf89dc51ed4a2142863055680f fenced=1 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/dashboard/handlers/relay_viewer.py:152 -- With the dev switch off, _bearer reads and force-refreshes the person vault with no workload_identity.active() check (unlike bridge.py:79,187 and sign_in_refresher.py:169), and a workload host keeping a sign-in from before its switch is an ordinary migration state, not an extreme one.
[GPT-ADJUDICATED-FENCED] f281b4e988395bdf89dc51ed4a2142863055680f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f281b4e988395bdf89dc51ed4a2142863055680f 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 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: workload readiness moved from the kiro-cli probe to the KAS turn gate

  • span=85c60ed7f214 Workload readiness authorizes destructive reruns on signed-out Kiro CLI

fixed in f281b4e: the kiro-cli prerequisite probe is back to kiro-cli's own answer (authenticated/ready = whoami.ok, file identical to main).
A usable JWT-SVID now counts only in kiro_readiness.kas_crew_signin_ready, and only for a turn whose configured backend is KAS (_kas_turn_sync); a live session off the bundle keeps the kiro-cli gate, so a rewind of a kiro-cli session stays refused.
Tests: test_the_kiro_cli_probe_stays_kiro_clis_own_answer, test_a_kas_turn_is_ready_on_a_usable_svid_and_only_a_kas_turn (kiro backend -> False).

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: refresh-failure notice on both list surfaces

  • span=2865379d24ec Unexpected list failures lose their error surface

fixed in f281b4e: a failed read after a list loaded keeps the rows and shows an ErrorNotice ("Couldn't load your Shared Crews.") in the switcher group and the Settings card (failed from useRelayViewerCrews).
Kept quiet on purpose: refusals (signed out, remote access off, not granted) and a failed FIRST read with no list, because every owner dashboard now reads the list with no setting and a person who never used the relay must not see a relay error.
Tests: TeamCrewsGroup keeps the loaded list through a later failed read, says the read failed, ...; SharedCrewsCards keeps the rows through a later failed read and says the read failed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=101f03cf04a5 product-shape change without accepted RFC: relay hosting and viewer defaults

Rebutted: the owner (Bolin) decided both defaults for this PR: Remote Crews listed after sign-in with no setting (#39384), and a Crew with a team key or workload identity hosts by default, an old home with a team key and no stored value hosts after upgrade, an explicit off still wins, personal sign-ins stay off (#39391).
The PR body states the upgrade behaviour plainly; the decision is recorded by the override on the current head.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles f281b4e product-shape #39391: owner decision (Bolin): Remote Crews list with no setting; team-key/workload Crews host by default, an unset old home with a team key hosts after upgrade, explicit off wins, personal sign-ins stay off.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: product-shape is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture_sinks_gateway.py

  • @bolichen97 posted a complete reasoning template for 12ab428.

Story 1. A signed-in person sees the Remote Crews they can open in the
desktop app and in a browser tab with nothing to set; only an LTS build
keeps the viewer off. tunnel.relay_viewer_enabled becomes a dev switch:
the dev control plane URL, test credential and (with the URL) relay
domain count only while it is on. With no dev domain a Crew is listed,
and gets a token, only at <endpointId>.<one label>.relay.kiro.dev. The
list hides quietly while signed out or refused, keeps a loaded list
through a failed read, backs off 15 minutes after a refusal (a longer
Retry-After wins), and its routine refusals are not journaled.

Story 2. Behind KIROCREW_WORKLOAD_IDENTITY a team Crew signs in and
leases with its own JWT-SVID, read from the file a sidecar such as
spiffe-helper writes and refreshes. No path reads, renews or writes the
person vault while the switch is set.

Story 3. With tunnel.relay_enabled unset, a Crew hosts by default only
when it has a team key or a workload identity; a personal sign-in stays
off, and a stored value always wins. An older home with a team key and
no stored value hosts after the upgrade; an explicit off stays off.
Turning Remote Control off over the relay is refused; --test-mode and
--seed imply --no-tunnel.

Story 5. A refused lease shows the service's own message, kept only
when it is plain ASCII words with no ARN or 12-digit number, redacted
and cut to 200 characters.

Closes #39384
Closes #39353
Closes #39357
Closes #39391

Based on a prototype by Sam.
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: failure notice now also on a failed first read

  • span=b72d3b3a8171 A failed first read of the relay Crew list shows nothing

fixed in 12ab428: a network or server failure, or a throttle, with no list now shows "Couldn't load your Shared Crews." through ErrorNotice (Ask the agent included) in the switcher group and the Shared Crews card; refusals and a 404 still hide quietly.
Tests: TeamCrewsGroup "says the list could not be read when the first read answers 503 / 429"; SharedCrewsCards "says the list could not be read when the first read fails".

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • span=a88cd5aeced5 owner_only 403 journaled on every read

fixed in 12ab428: { status: 403, code: 'owner_only' } added to RELAY_VIEWER_ROUTINE, matching HIDING_403; test "does NOT journal its routine 403 owner_only".

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: viewer refuses a person sign-in on a workload host

  • span=44cccfc59160 Workload hosts still consume a leftover personal sign-in

fixed in 12ab428: relay_viewer._bearer answers SIGNED_OUT before building KasAuthProvider when workload_identity.active(), and _sign_in_marker reads no fingerprint; both list and mint go through them, so no person vault read or refresh happens. The test credential path is unchanged.
Test: test_a_workload_host_reads_no_person_sign_in (KasAuthProvider, token store and fingerprint poisoned).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=761f0f24d63e product-shape change without accepted RFC: Remote Crews viewer and relay hosting on by default

Rebutted: the owner (Bolin) decided both defaults for this PR, recorded in #39384 and #39391; the override on the current head records it.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 12ab428
  • What rule changed: one new row in security_posture_sinks_gateway.py registering relay_client/lease.py as a redaction sink (the lease refusal text in /api/tunnel/status and its log line). No rule, mask, fence or policy changes.
  • Before -> after (what was allowed/blocked, now): before, the lease refusal text carried no service message and lease.py was not listed; after, the service's message is appended only when it is plain ASCII words with no ARN or 12-digit number, redacted and cut to 200 characters, and the sink is listed in Settings > Security.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a service message carrying a credential shape the redactor misses would show in the tunnel status; the ASCII-words filter, the ARN / 12-digit drop and the redactor bound that. Nothing is blocked and no one is locked out.
  • Evidence checked (which sandbox result proves it): N/A, no sandbox rule changed; test_security_posture TestOmissionDetection passes with the row, and test_relay_client_lease_refusal_message plants a synthetic credential and checks it is redacted.
  • No regression:
    • Tools still work (which tools/commands were run, result): real-machine lease refusal on EC2 and DevSpace, 3 token types, texts as expected.
    • Backward compatible (old config / old data / old callers still work, how checked): the refusal text only gains a suffix; refusal_of signature unchanged; test_relay_client_lease.py passes.
    • Existing tests (which suites passed on this head): test_security_posture.py, test_relay_client_lease*.py, test_relay_viewer_*.py, test_workload_identity.py, test_remote_control_hosting_default.py (448 passed).
  • How to undo: revert the row in security_posture_sinks_gateway.py together with refusal_message in lease.py.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 12ab428 product-shape #39391: agent: records the owner's decision (Bolin): Remote Crews list with no setting (#39384); team-key/workload Crews host by default, an old home with a team key and no stored value hosts after upgrade, explicit off wins.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: product-shape is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: action required A blocking check or review needs attention

Projects

None yet

1 participant