Skip to content

fix: let every shared crew teammate act as the owner inside the crew - #38209

Merged
bolichen97 merged 1 commit into
mainfrom
fix/teammate-owner-parity
Nov 17, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/teammate-owner-parity

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Everyone a Shared Crew admits can use the Crew as its owner does, except the host's Terminal and managing who may reach the Crew.

A teammate is refused one owner feature after another with 403 owner_only: Bots, then a Bot's Dashboard, then apps (relay_apps_teammate), each opened by its own PR. An SSM invite guest sees "Could not load your bots". The recorded rule is that every admitted person has the owner's rights while roles are off (docs/decisions/2026-11-01-shared-crews-give-each-person-one-role.md). But a teammate's subject (ssm:<invite>, relay:<id>, tailnet:uid:<id>) never equals the owner's, so every route behind is_owner_dashboard_request refuses them too.

Why it matters

Teams are starting to use a shared Crew, and each person hits the next refusal one at a time. Every fix so far opened one feature, so the next one was always waiting; the people sharing a Crew cannot rely on it.

Not a goal

  • Roles or per-person limits. Those stay with people_policy.json (the roles work).
  • App pages over the SSM listener. An app web origin serves only a direct local request; that is separate design work.
  • Letting a teammate manage who may reach the Crew (invites, the access card, the preview switch).
  • Frontend changes. A teammate's tab hides Import from file and the host's first-run chapters, which read owner_ok; the server already lets them use the first.

What changed (motivation → approach → change)

The refusals are one class: the owner gate matches subjects, and a teammate's never matches. So the fix is in the gate, not per route. is_owner_dashboard_request now admits a Shared Crew teammate on every route but the Terminal's, and the per-feature teammate code that this makes redundant goes.

Piece What it does
shared_crew/teammate_access.py Who is a teammate: an SSM invite guest, a team Crew teammate the relay verified, or a collaborator the Tailscale listener or serve path admitted (never the machine owner). The gate admits them anywhere but the owner-only routes: the Terminal; every route the relay refuses a remote caller by path (limits.remote_route_limit: remote instances, local credentials, shutdown); channel connection writes and cron secret grants; and, in the config PATCH, any key that opens a listener or is an allow-list (is_admission_config_key).
source_providers is_owner_dashboard_request asks it. is_host_owner_dashboard_request is the machine owner alone, read where that is a fact or a share: /api/auth/me's owner_ok, the decide-by-id approval form, the mobile setup (tailnet_mobile), and redaction.
Redaction A teammate reads redacted while the owner's switch is off, per the 2026-11-15 decision: the HTTP audience, owner_view_for_request, the reveal route, the redaction switch, Layer B exports, cron secret-grant names and the sign-in email ask the machine owner; a teammate's owner socket carries TEAMMATE_WS_FLAG, which every owner-socket send reads (redaction_audience.socket_reads_as_owner).
Terminal probe Answers a teammate {"enabled": false}, so their tab hides the Terminal.
apps/routes_listing.py Lists apps for an SSM guest; only an SSM request that is not a guest's gets the empty list.
Relay The apps-for-teammates limit and the app-frame withholds (WebSocket, SSE, notifications) go. A teammate's socket is an owner socket, so question cards and live owner frames reach them.
Bots and approvals The narrowed Bots roster, the export and Bot-create narrowing and the approval card's teammate-only branch go; a relay teammate's owner-path reads are filed under their relay label.

A teammate keeps their own subject and actor, so audit rows and attribution name them, never the owner. Sharing stays the machine owner's: routes_invites._owner_refusal admits only the local operator or this machine's own tailnet user. Specs updated: shared-crew (new "What a teammate may do"), dashboard-token-auth, member-event-log, app-kit-platform, app-notifications, dashboard-instances.

Backwards compatibility

Compatible: every request admitted today is still admitted; teammates are admitted to more. A relay teammate does not wait on the Shared Crew preview (the relay is the team Crew's own access path), so a team Crew that never turned the preview on widens too.

Reader: website/src/api/client.ts:APPS_RELAY_TEAMMATE -- crew page -- a benign-denial match for a refusal the server no longer sends; the app list now answers 200
Reader: website/src/api/apiError.ts:PERMISSION_REFUSAL_CODES -- crew page -- still lists relay_apps_teammate; harmless with no sender
Reader: src/kiro_crew/dashboard/chat_handlers.py:_shared_crew_teammate -- chat -- still exported; now only the decide-by-id rule reads it (test_shared_crew_teammate_approvals.py)
Reader: src/kiro_crew/dashboard/handlers/members.py:_teammate_roster re-export -- crew page -- removed with the helper; /api/members serves the owner's roster to a teammate (test_members_roster_relay_teammate.py)
Reader: src/kiro_crew/dashboard/handlers/messaging.py:_is_app_note, _refuse_hidden_note, refuse_relayed, is_app_channel re-exports -- crew page -- removed with their only callers in messaging_api/notifications.py
Reader: src/kiro_crew/dashboard/kiro_relay/caller.py:RELAY_TEAMMATE_WS_FLAG -- crew page -- its only readers (ws.py, websocket_hub.py) go in this diff

Tests

  • test_shared_crew_teammate_owner_access.py (from the SSM guest fix, widened): each sharing path passes the gate and is still told apart from the machine owner; the owner on a tailnet path is never a teammate and keeps the Terminal; no Terminal route admits a teammate; a teammate is refused the mobile setup; a messaging link and a widened-bind peer are not teammates; preview off removes the SSM and Tailscale paths but not the relay; end to end: the Bots roster, Trust and YOLO, the app list, the Terminal probe.
  • test_shared_crew_teammate_approvals.py: a relay teammate approves, sets the approval mode from a card and from /api/chat/mode, decides with the preview off, and still names the card.
  • test_members_roster_relay_teammate.py: the owner's roster, a Bot's rules, any Bot's chat and a full export for a relay teammate, filed under their relay label.
  • test_kiro_relay_caller_identity.py: no remote limit tells a teammate from the owner; a teammate passes the owner gate as themselves.
  • test_shared_crew_teammate_owner_access.py also: webhook tokens, app secrets, the vault, sign-in links and channel connection writes stay the owner's for every teammate kind, while reading and using a channel stays open; a teammate's config PATCH of an admission key answers 403 owner_only; every allow-list in the live config schema is an admission key.
  • test_shared_crew_teammate_redaction.py: with redaction off, the SSE stream, the HTTP audience and the WebSocket fan-out keep a teammate's reads redacted while the owner's go as written.
  • test_kiro_relay_teammate_app_frames.py is removed: it pinned the withholds this change drops; its teammate-redaction case moved to test_shared_crew_teammate_redaction.py.

Proof: not provable -- other: prove.py reports BASELINE_RED in its throwaway worktree while the same changed tests pass in place (366 passed); run against origin/main's code they give 7 failed and 2 import errors (no teammate_access, no is_host_owner_dashboard_request)

Manual verification

A two-guest smoke over the SSM listener on a throwaway harness gateway (fake ACP backend, preview on, two invites): 34/34 checks on this branch, 28/34 on origin/main. Each guest loads the Bots roster, the app list, People, settings and question cards, reads the Terminal as off and is refused creating one, and is refused invite management; one opens a session and runs a turn, the other reads it (the message names its author) and sets the session to Trust and back. On main the roster, the Terminal probe and the approval mode answer 403 owner_only.

setup.py test_e2e: the HTTP smoke passes (32/32). The browser suite cannot start on this host, on this branch and on clean main alike: localhost resolves only to ::1 (the sign-in token pins 127.0.0.1), and with that pointed at 127.0.0.1 the harness's own config.json seed is held as pending by the config provenance check, which runs only on a host with user namespaces. CI's E2E job runs it.

Not yet clicked through in a browser over the relay: a team Crew on gamma with a second account (Bots, an App, a question card, the Terminal hidden) is the check before merge.

Related Issues

Closes #38188

Sibling sweep

Swept: git grep -nE "== *owner_id|owner_id *==|_LOCAL_DASHBOARD_OWNER_SUBJECTS" -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/handlers/source_providers.py -- changed here
Swept: git grep -nE "_relay_teammate(|is_relay_teammate(" -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/handlers/members_access.py -- not affected -- only files a teammate's grant under their relay label
Sibling: src/kiro_crew/shared_crew/routes_identity.py -- not affected -- admits a teammate to reads the gate admits them to anyway

Pattern harvest

Rule candidate: review-prompt
Pattern: a route that admits "the owner or a Shared Crew teammate" with its own teammate check instead of asking is_owner_dashboard_request

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

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 581ba139351bc8b3ce6da063a4769b3b908d3478 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 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 581ba139351bc8b3ce6da063a4769b3b908d3478 — 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

One rider carries a premise risk: relay teammates now get owner rights while the Shared Crew preview is off. Every other item is grounded in the recorded one-role decision.

Notes

  • Item 6 — rides along: the base pin said "nobody is one while the Shared Crew preview is off". The description now says "A relay teammate does not wait on the Shared Crew preview… so a team Crew that never turned the preview on widens too." The 2026-11-01 decision covers people Shared Crew admits, and whether that includes a team Crew that never opted into the preview is a coverage call, not a reading. Subtraction: put back the preview_enabled() check on the _relay_teammate branch of is_shared_crew_teammate. Clears when: the check is back, or a human confirms the decision covers relay teammates with the preview off.

What this change ships

Inventory (8 items) — 7 justified

Intent: let everyone a Shared Crew admits use the Crew as its owner does, except the Terminal and access management. This is a FIX.

  1. Teammates (SSM guest, relay, Tailscale) pass every owner gate except the owner-only routes — justified
  2. The Terminal is refused to teammates and its probe answers them "off" — justified
  3. Credentials, shutdown, instances, channel-connection writes, cron secret grants and admission config keys stay the machine owner's — justified
  4. Teammates keep reading redacted while the owner's redaction switch is off — justified
  5. The relay no longer refuses teammates apps, app frames or notifications — justified
  6. Relay teammates are admitted with the Shared Crew preview off — rides along
  7. Teammates may now set Trust and YOLO approval modes from a card — justified
  8. The narrowed Bots roster and narrowed exports are gone; teammates get the owner's — justified

[FIRST-PRINCIPLES-REVIEWED] 581ba13

Description read

[DESCRIPTION-READ] 0f9e60cb5e3d6709b99eccd2f3ca79dd9cc772031effdc02ee677702ddd9e6ec

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

Copy link
Copy Markdown
Contributor

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

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

Design-Verdict: PASS

The Terminal and local-secret carve-outs don't hold: the gate lets a teammate through by default, and the config PATCH refuses only admission keys, so a teammate can switch off the agent's confinement and then run a host shell through chat.

Blockers

Confinement keys stay writable by teammates, which reopens the withheld Terminal and secrets
Trigger: a teammate (SSM guest, relay teammate or tailnet collaborator) sends PATCH /api/config/kirocrew with agent.sandbox=off (or agent.env, hooks.auto_approve_tools, agent.yolo). The new check refuses only "is_admission_config_key(path_key)", so the write goes through. They then set YOLO, which the PR grants ("approval modes including Trust and YOLO"), and ask for a shell command in chat.
Outcome: the gate admits by default → core_config_patch.py writes the config through the gateway's own endorsing writer → the next session spawns without the OS sandbox → the teammate's turn runs a shell as the machine owner's OS user, which can read .env, the credential homes and the token-signing secret. Those are exactly what the module docstring says "stay the machine owner's" (the Terminal; "Crew's local tokens and secrets, the vault"). A leaked credential can't be taken back, and AGENTS.md says the sandbox's scope is "the operator's to widen, never yours".
Fix: refuse a non-host-owner write to the confinement keys too. loosening_provenance._CONFIG_SECURITY_KEYS already lists "the keys whose change can loosen confinement", so check it next to is_admission_config_key.
Clears when: a teammate's PATCH of every key in _CONFIG_SECURITY_KEYS answers 403 owner_only, pinned by a test in test_shared_crew_teammate_owner_access.py that iterates that tuple.

Notes

  • Every owner route added from now on is open to teammates unless someone remembers to add it to is_owner_only_for_teammates. Give a new owner-only surface a registration point that a test enumerates, so the deny-list can't silently go stale.

[DESIGN-REVIEWED] 581ba13

Description read

[DESCRIPTION-READ] 094080beb0f1937f4117efbf5fcdc489c156fdc36d25e70e41a2a6a736186da1

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 581ba13

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

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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @bolichen97 overrides the GPT 6.1 finding for 581ba139351bc8b3ce6da063a4769b3b908d3478; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] 581ba13

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

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

@bolichen97
bolichen97 force-pushed the fix/teammate-owner-parity branch from 2a746bd to 05e5bf4 Compare November 17, 2026 02:14
@bolichen97 bolichen97 changed the title fix: let every shared crew teammate act as the owner except the terminal fix: let every shared crew teammate act as the owner inside the crew Nov 17, 2026
@bolichen97

bolichen97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=fed63f7f7e32 Teammates now get the owner's raw credentials with redaction OFF

fixed in 05e5bf4: redaction now asks the machine owner, not the owner gate. request_audience, owner_view_for_request and redacted_reveal._refusal use is_host_owner_dashboard_request; a teammate's owner socket carries teammate_access.TEAMMATE_WS_FLAG, read by redaction_audience.socket_reads_as_owner in the hub and the subagent replay.
The deleted teammate SSE case is back in test_shared_crew_teammate_redaction.py, with HTTP-audience and WebSocket-fan-out cases; with the flag check removed the socket cases fail.

@bolichen97

bolichen97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=82168f071d71 Teammates can obtain credentials that survive invite revocation

fixed in 05e5bf4: teammate_access.is_owner_only_for_teammates keeps every route the relay refuses as relay_local_credential (limits.is_local_credential_path: webhook tokens, app register and token exchange, the vault, local tokens and sign-in links, built-in app credential mints, the relay viewer) and channel connection writes (CHANNEL_CONNECTION_WRITES) the machine owner's on every path.
Pinned for each teammate kind by test_a_credential_that_outlives_access_stays_the_owners.

@bolichen97

bolichen97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=82168f071d71 Teammates bypass mandatory credential redaction

fixed in 05e5bf4: the HTTP audience, owner_view_for_request and the reveal route ask is_host_owner_dashboard_request; a teammate's owner socket is flagged (TEAMMATE_WS_FLAG) so for_socket redacts its frames while event access is unchanged.
Pinned by test_shared_crew_teammate_redaction.py (SSE, HTTP audience, hub fan-out).

@bolichen97

bolichen97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=23546856c53a The admission controls are fenced on one route only, not on what decides admission

fixed in 05e5bf4: PATCH /api/config/kirocrew refuses a teammate 403 owner_only on any admission key (teammate_access.is_admission_config_key: the dashboard.shared_crew, dashboard.tailscale and tunnel subtrees, and any segment starting allow or equal to dm_policy, so a new allow-list is covered by name). Channel connection writes, which carry each channel's allow-list, are owner-only too. PUT /api/config/kirocrew writes only agent.*.
Pinned by test_a_teammate_cannot_patch_an_admission_key and test_every_allow_list_in_the_config_schema_is_an_admission_key, which walks the live schema.

@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 17, 2026
@bolichen97
bolichen97 force-pushed the fix/teammate-owner-parity branch from 05e5bf4 to 8986c9a Compare November 17, 2026 02:36
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=dbbf8733a9ed Owner deliveries reach a teammate's socket raw

fixed in 8986c9a: WebSocketHub._await_owner_send (deliver_ws_owners: question, change and guide cards) now runs a text frame through redaction_audience.for_socket when socket_reads_as_owner is false, before the snapshot hold; the browser-live connect snapshot does the same. Every owner-socket send path in the hub now redacts for a teammate's socket.
Pinned by test_an_owner_delivery_reaches_a_teammate_redacted, red with the check removed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=d1c57c2edb35 A teammate can export the raw model context (Layer B)

fixed in 8986c9a: the Layer B condition asks is_host_owner_dashboard_request. Swept the same class (an owner-only view gated on the owner check): the redaction switch, the cron board's secret-grant names and the sign-in email moved to the machine owner too.
Pinned by test_a_teammate_never_gets_the_raw_model_context and test_session_export.py.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=be105fded4d6 Peer-owner credential mints remain accessible to teammates

fixed in 8986c9a: approach changed rather than adding another route. A teammate is held on every path to every route limit the relay applies by path (limits.remote_route_limit: remote instances, local credentials, shutdown, non-canonical paths), the boundary already reviewed for remote callers; cron secret grants are owner-only too.
Pinned by test_a_credential_that_outlives_access_stays_the_owners (instances connect, refresh-token, embed-token, shutdown, cron secrets) for each teammate kind.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/dashboard/handlers/credential_redaction.py

  • @bolichen97 posted a complete reasoning template for 581ba13.

@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 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 8986c9a
  • What rule changed: credential_redaction._deny_non_owner, the gate on the owner's credential-redaction switch, now asks is_host_owner_dashboard_request (the machine owner alone) instead of is_owner_dashboard_request, which this PR widens to admit Shared Crew teammates.
  • Before -> after (what was allowed/blocked, now): before, only the dashboard owner could read or flip the switch, and teammates were refused because their subject never matched. After, the same: only the machine owner. Without this line the PR's widened owner gate would have let a teammate flip the owner's switch.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the host-owner predicate wrongly answered False for the owner, the owner could not change their own redaction switch (403). It cannot widen access: the new predicate is strictly narrower than the old one.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. is_host_owner_dashboard_request is the unchanged pre-PR owner predicate (subject equals owner_id, else a bootstrap subject); test_shared_crew_teammate_owner_access.py pins that it is True for the owner and False for every teammate kind.
  • No regression:
    • Tools still work (which tools/commands were run, result): the owner's switch routes are exercised by the credential-redaction tests and a two-guest SSM smoke on a harness gateway (34/34).
    • Backward compatible (old config / old data / old callers still work, how checked): the owner's own calls answer as before; no config or stored data changes.
    • Existing tests (which suites passed on this head): test_redaction_one_setting.py, test_redaction_audience_dashboard.py, test_shared_crew_teammate_redaction.py, test_shared_crew_teammate_owner_access.py and the 6,251 tests touching the redaction, socket and relay seams.
  • How to undo: revert this PR's single commit; the switch's gate returns to is_owner_dashboard_request.

iamwhatever
iamwhatever previously approved these changes Nov 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: ed355db
  • What rule changed: credential_redaction._deny_non_owner, the gate on the owner's credential-redaction switch, now asks is_host_owner_dashboard_request (the machine owner alone) instead of is_owner_dashboard_request, which this PR widens to admit Shared Crew teammates.
  • Before -> after (what was allowed/blocked, now): before, only the dashboard owner could read or flip the switch, and teammates were refused because their subject never matched. After, the same: only the machine owner. Without this line the PR's widened owner gate would have let a teammate flip the owner's switch.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the host-owner predicate wrongly answered False for the owner, the owner could not change their own redaction switch (403). It cannot widen access: the new predicate is strictly narrower than the old one.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. is_host_owner_dashboard_request is the unchanged pre-PR owner predicate (subject equals owner_id, else a bootstrap subject); test_shared_crew_teammate_owner_access.py pins that it is True for the owner and False for every teammate kind.
  • No regression:
    • Tools still work (which tools/commands were run, result): the owner's switch routes are exercised by the credential-redaction tests and a two-guest SSM smoke on a harness gateway (34/34).
    • Backward compatible (old config / old data / old callers still work, how checked): the owner's own calls answer as before; no config or stored data changes.
    • Existing tests (which suites passed on this head): test_redaction_one_setting.py, test_redaction_audience_dashboard.py, test_shared_crew_teammate_redaction.py, test_shared_crew_teammate_owner_access.py and the 6,251 tests touching the redaction, socket and relay seams.
  • How to undo: revert this PR's single commit; the switch's gate returns to is_owner_dashboard_request.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: bc4eb8b
  • What rule changed: credential_redaction._deny_non_owner, the gate on the owner's credential-redaction switch, now asks is_host_owner_dashboard_request (the machine owner alone) instead of is_owner_dashboard_request, which this PR widens to admit Shared Crew teammates.
  • Before -> after (what was allowed/blocked, now): before, only the dashboard owner could read or flip the switch, and teammates were refused because their subject never matched. After, the same: only the machine owner. Without this line the PR's widened owner gate would have let a teammate flip the owner's switch.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): if the host-owner predicate wrongly answered False for the owner, the owner could not change their own redaction switch (403). It cannot widen access: the new predicate is strictly narrower than the old one.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. is_host_owner_dashboard_request is the unchanged pre-PR owner predicate (subject equals owner_id, else a bootstrap subject); test_shared_crew_teammate_owner_access.py pins that it is True for the owner and False for every teammate kind.
  • No regression:
    • Tools still work (which tools/commands were run, result): the owner's switch routes are exercised by the credential-redaction tests and a two-guest SSM smoke on a harness gateway (34/34).
    • Backward compatible (old config / old data / old callers still work, how checked): the owner's own calls answer as before; no config or stored data changes.
    • Existing tests (which suites passed on this head): test_redaction_one_setting.py, test_redaction_audience_dashboard.py, test_shared_crew_teammate_redaction.py, test_shared_crew_teammate_owner_access.py and the 6,251 tests touching the redaction, socket and relay seams.
  • How to undo: revert this PR's single commit; the switch's gate returns to is_owner_dashboard_request.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=82168f071d71 Newly admitted teammates can read credentials embedded in Bot rules

Rebutted: reading a Bot's rules is a teammate right the maintainers decided: every admitted person has the owner's in-Crew rights while roles are off (docs/decisions/2026-11-01-shared-crews-give-each-person-one-role.md), and sessions, memory and Bot setup are shared the same way. Rules are owner-written free text, not a credential store; the vault is, and it stays the machine owner's (remote_route_limit, CRON_SECRET_GRANTS).
The redaction decision governs the redactor seams, which this PR keeps on the machine owner; extending it to every owner-authored text a teammate may read is new scope, recorded by the maintainer as an owner decision.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 581ba13 owner-decision: agent, per the maintainer's ruling: admitted Shared Crew teammates read Bot rules as the owner does (docs/decisions/2026-11-01-shared-crews-give-each-person-one-role.md); rules are owner-written text, not a credential store, and the vault stays machine-owner-only.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: class owner-decision needs a link to the owner's decision comment (https://github.com/<owner>/<repo>/pull/<n>#issuecomment-<id>) in the reason. 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.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt 581ba13 owner-decision: agent, per the maintainer's ruling #29609 (comment) : every admitted Shared Crew teammate has the owner's in-Crew rights, reading Bot rules included; rules are owner-written text, not a credential store, and the vault stays machine-owner-only.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the gpt AI finding on 581ba139351bc8b3ce6da063a4769b3b908d3478.

agent, per the maintainer's ruling #29609 (comment) : every admitted Shared Crew teammate has the owner's in-Crew rights, reading Bot rules included; rules are owner-written text, not a credential store, and the vault stays machine-owner-only.

This decision applies only to this commit. A new push requires a new judgment.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve on 581ba13. The owner gate now admits every Shared Crew teammate, both kinds alike, on every route except the Terminal, the relay's credential and vault limits, cron secret grants, channel writes, admission config keys, invites and access management. Ray ruled that teammates may have the rest (security settings, deletes, owner-account actions) under equal rights. No hole outside that: no header path, no unauthenticated path, and the owner's behaviour is unchanged. 686 targeted tests pass at 581ba13; the 8 guard mutations all went red at bc4eb8b. Decisive lines: src/kiro_crew/shared_crew/teammate_access.py:110-122, src/kiro_crew/dashboard/kiro_relay/limits.py:93-106, src/kiro_crew/shared_crew/routes_invites.py:134-153, src/kiro_crew/shared_crew/routes_access.py:69-86, src/kiro_crew/shared_crew/teammate_access.py:131-211, src/kiro_crew/dashboard/handlers/source_providers.py:959-987

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@bolichen97
bolichen97 merged commit d9a91a7 into main Nov 17, 2026
117 of 119 checks passed
@bolichen97
bolichen97 deleted the fix/teammate-owner-parity branch November 17, 2026 05:26
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 17, 2026
KiroCrewCaptain pushed a commit that referenced this pull request Nov 17, 2026
Since #38209 the owner gate admits a Shared Crew teammate on every
route the owner-only table in shared_crew.teammate_access does not
list, and /api/portability was in none of its entries. The export
writes config.json and the settings documents, config.local.json
among them, raw into the archive, so a channel bot token or an agent
env secret a teammate downloaded would outlive their access. The
import, with mode=replace, overwrites the owner's config.

Add PORTABILITY_ROUTES to that table, so is_owner_only_for_teammates
keeps every /api/portability route the machine owner's and the export
and import refuse a teammate 403 owner_only. This restores main's
behaviour from before #38209, when both routes refused every teammate.
The relay's remote_route_limit is unchanged, so what a relayed remote
caller gets does not move, and the preview, which asks no owner gate,
is unaffected.
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.

Shared Crew teammate's attached image shows "Image failed to load" Shared Crew teammates are refused owner-gated features one at a time

4 participants