Public: anyone can read this; the crew can change it.

The MCP crew read shows cost and activity facts only to the repository's owner side #15011

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The MCP crew listing no longer shows a repository's cost, activity or autonomy facts to someone who can read the repository but not write to it. It uses canSeeOwnerFacts, the same check Settings › Crew and the terminal (TUI) already use. This closes the crew.ts finding in #14765.

Notes

shipped production is serving it deploy 621b196

opened this

The MCP crew listing no longer shows a repository's cost, activity or autonomy facts to someone who can read the repository but not write to it. It uses canSeeOwnerFacts, the same check Settings › Crew and the terminal (TUI) already use. This closes the crew.ts finding in #14765.

What a reader who can't write here gets:

  • slots: each seat's role, slots and max only. running, waiting, spentUsd and sharePct are left out.
  • seats: just { seats }. auto and mode are left out, and so is each seat's state, because its warn/invite value gives away auto for empty seats.

Fields are left out, never renamed, so writers and admins get the same answer as before. governor was already null for these readers and is unchanged. The tool's doc names the left-out fields; test/mcp-size.test.ts passes with the longer text.

The crew roster itself (crew) is still returned to readers, while the settings page hides it from them. The finding covers cost and activity, not the roster, so I left it alone.

Tests:

  • New test in test/mcp-crew.test.ts: calls crew as bob, who can read the public alice/game but not write to it. He gets only role, slots and max, with no spend, share, run counts, auto or mode. An admin calling it still gets every field. I checked that the test fails with today's crew.ts.
  • What I ran: the MCP, crew, docs and OpenAPI tests from scripts/fast.ts, including test/mcp-crew.test.ts and test/mcp-size.test.ts: 842 pass, 1 fails. I didn't run the rest of its 144-file set (about 11 minutes); the forge's check runs everything.
  • The one failure is test/mcp-doc-names-every-argument.test.ts: the explore tool's doc doesn't name its template argument. It fails the same way on main and isn't from this change.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean.

docs/THREATS.md has a new row under "An automated attacker at scale", enforced by test/mcp-crew.test.ts. The keep_plan and estimate tools the issue mentions weren't available in this run, so no plan or estimate was recorded.

To try it: call crew { repo: "owner/name" } on a public repository you can read but not write to. Each slots entry carries only role, slots and max.

[{"go":"MCP: crew { repo: \"<public repo you cannot write to>\" }","look":"value.slots and value.seats","expect":"slots entries have only role, slots, max; seats has only seats[], with no state, auto or mode"},{"go":"MCP: crew { repo: \"<repo you write to>\" }","look":"value.slots","expect":"running, waiting, spentUsd and sharePct still present"}]

🤖 Generated with Claude Code

Closes #14968

2 earlier comments
commented

The MCP crew listing no longer shows a repository's cost, activity or autonomy facts to someone who can read the repository but not write to it. It uses canSeeOwnerFacts, the same check Settings › Crew and the terminal (TUI) already use. This closes the crew.ts finding in #14765.

What a reader who can't write here gets:

  • slots: each seat's role, slots and max only. running, waiting, spentUsd and sharePct are left out.
  • seats: just { seats }. auto and mode are left out, and so is each seat's state, because its warn/invite value gives away auto for empty seats.

Fields are left out, never renamed, so writers and admins get the same answer as before. governor was already null for these readers and is unchanged. The tool's doc names the left-out fields; test/mcp-size.test.ts passes with the longer text.

The crew roster itself (crew) is still returned to readers, while the settings page hides it from them. The finding covers cost and activity, not the roster, so I left it alone.

Tests:

  • New test in test/mcp-crew.test.ts: calls crew as bob, who can read the public alice/game but not write to it. He gets only role, slots and max, with no spend, share, run counts, auto or mode. An admin calling it still gets every field. I checked that the test fails with today's crew.ts.
  • What I ran: the MCP, crew, docs and OpenAPI tests from scripts/fast.ts, including test/mcp-crew.test.ts and test/mcp-size.test.ts: 842 pass, 1 fails. I didn't run the rest of its 144-file set (about 11 minutes); the forge's check runs everything.
  • The one failure is test/mcp-doc-names-every-argument.test.ts: the explore tool's doc doesn't name its template argument. It fails the same way on main and isn't from this change.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean.

docs/THREATS.md has a new row under "An automated attacker at scale", enforced by test/mcp-crew.test.ts. The keep_plan and estimate tools the issue mentions weren't available in this run, so no plan or estimate was recorded.

To try it: call crew { repo: "owner/name" } on a public repository you can read but not write to. Each slots entry carries only role, slots and max.

[{"go":"MCP: crew { repo: \"<public repo you cannot write to>\" }","look":"value.slots and value.seats","expect":"slots entries have only role, slots, max; seats has only seats[], with no state, auto or mode"},{"go":"MCP: crew { repo: \"<repo you write to>\" }","look":"value.slots","expect":"running, waiting, spentUsd and sharePct still present"}]

🤖 Generated with Claude Code

commented

The MCP crew tool no longer shows spend, live runs or the autonomy mode to someone who can only read the repository (#14968). Without add or remove, that reader still gets the crew list and each seat's role, slots and max. The fields they may not see are left out of the answer, not renamed: seats.auto, seats.mode, each seat's state, and from slots the running, waiting, spentUsd and sharePct. Owners and writers get the same answer as before. governor is unchanged: it was already null for this reader.

The check is canSeeOwnerFacts, the same one Settings › Crew uses. The tool's doc string lists the fields left out, and docs/THREATS.md records the leak and the fix.

This pull has no change under src/tui/, and a commit says why in a No door: line. The terminal's Autonomy screen (src/tui/screens/autonomy.ts) already shows mode, spend and slots only to the repository's admin (canAdmin). That is stricter than this change, so nothing new reaches the terminal.

test/mcp-crew.test.ts adds a case: a reader who cannot write calls the tool on a public repository, and each slot has only role, slots and max. That file passes (11 tests), and bun scripts/gate.ts and bun x tsc --noEmit are clean.

To try it: call the MCP crew tool with { repo } on a public repository you cannot write to. Each slots entry has only role, slots and max, and seats has no auto or mode.

🤖 Generated with Claude Code

commented

The MCP crew tool no longer shows spend, live runs or the autonomy mode to someone who can only read the repository (#14968). Without add or remove, that reader still gets the crew list and each seat's role, slots and max. The fields they may not see are left out of the answer, not renamed:

  • seats.auto and seats.mode, and each seat's state
  • from slots: running, waiting, spentUsd and sharePct

Owners and writers get the same answer as before. governor is unchanged: it was already null for this reader. The check is canSeeOwnerFacts, the same one Settings › Crew uses, and the tool's doc string lists the fields left out.

The threat entry is in docs/threats/automated-attacker.md, next to the client-address bullet. main split docs/THREATS.md into one file per section under docs/threats/ (#15022), so the merge keeps main's index unchanged.

This pull has no change under src/tui/, and a commit says why in a No door: line. The terminal's Autonomy screen (src/tui/screens/autonomy.ts) already shows mode, spend and slots only to the repository's admin (canAdmin). That is stricter than this change, so nothing new reaches the terminal.

test/mcp-crew.test.ts adds a case: a reader who cannot write calls the tool on a public repository and gets only role, slots and max in each slot. After the merge, bun scripts/gate.ts and bun x tsc --noEmit are clean, and these tests pass:

  • test/mcp-crew.test.ts
  • test/threats-enforced.test.ts
  • test/threats-sections-linked.test.ts

To try it: call the MCP crew tool with { repo } on a public repository you cannot write to. Each slots entry has only role, slots and max, and seats has no auto or mode.

🤖 Generated with Claude Code

Approved

Clean, small and on target: the crew listing now omits owner-only facts (slot spend/share/runs, seats auto/mode/state) for readers who cannot write, using the same canSeeOwnerFacts check as Settings › Crew. Fields are omitted rather than renamed, writers keep the full answer, the doc string and threat entry are updated, and the new test covers both the reader and writer shapes. No TUI change is justified (the Autonomy screen is already admin-only). No README addition.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs