Repository navigation
fix: let every shared crew teammate act as the owner inside the crew - #38209
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of 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
What this change shipsInventory (8 items) — 7 justifiedIntent: let everyone a Shared Crew admits use the Crew as its owner does, except the Terminal and access management. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 581ba13 Description read[DESCRIPTION-READ] 0f9e60cb5e3d6709b99eccd2f3ca79dd9cc772031effdc02ee677702ddd9e6ec That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of 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. BlockersConfinement keys stay writable by teammates, which reopens the withheld Terminal and secrets Notes
[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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ human override acceptedHuman judgment by @bolichen97 overrides the GPT 6.1 finding for [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: |
2a746bd to
05e5bf4
Compare
|
|
|
|
05e5bf4 to
8986c9a
Compare
|
|
|
Sensitive Change ReviewSensitive files changed:
|
Sensitive change review
|
Sensitive change review
|
8986c9a to
ed355db
Compare
Sensitive change review
|
|
|
/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. |
|
AI-review override not recorded: class |
|
/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. |
Human judgment recorded@bolichen97 recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
buluoray
left a comment
There was a problem hiding this comment.
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
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.
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 behindis_owner_dashboard_requestrefuses 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
people_policy.json(the roles work).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_requestnow admits a Shared Crew teammate on every route but the Terminal's, and the per-feature teammate code that this makes redundant goes.shared_crew/teammate_access.pylimits.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_providersis_owner_dashboard_requestasks it.is_host_owner_dashboard_requestis the machine owner alone, read where that is a fact or a share:/api/auth/me'sowner_ok, the decide-by-id approval form, the mobile setup (tailnet_mobile), and redaction.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 carriesTEAMMATE_WS_FLAG, which every owner-socket send reads (redaction_audience.socket_reads_as_owner).{"enabled": false}, so their tab hides the Terminal.apps/routes_listing.pyA 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_refusaladmits 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 200Reader:
website/src/api/apiError.ts:PERMISSION_REFUSAL_CODES-- crew page -- still listsrelay_apps_teammate; harmless with no senderReader:
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_rosterre-export -- crew page -- removed with the helper;/api/membersserves 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_channelre-exports -- crew page -- removed with their only callers inmessaging_api/notifications.pyReader:
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 diffTests
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.pyalso: 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 403owner_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.pyis removed: it pinned the withholds this change drops; its teammate-redaction case moved totest_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, nois_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 answer403 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:localhostresolves only to::1(the sign-in token pins127.0.0.1), and with that pointed at127.0.0.1the harness's ownconfig.jsonseed 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_requestChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement