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

MCP `whoami_can` with `kind: "passkeys"` lists the caller's own passkeys, and tools/list grows by no new tool #5757

opened this

Merged 38d 2h ago, live in production

whoamican now takes an optional kind. With "passkeys" it lists the caller's own passkeys, and tools/list gains no tool. What it returns: { items } read from listPasskeys(db, caller.id).

Notes

opened this

whoami_can now takes an optional kind. With "passkeys" it lists the caller's own passkeys, and tools/list gains no tool.

  • What it returns: { items } read from listPasskeys(db, caller.id). Each item has id, name, created and lastUsed. The credential id's raw bytes and the public key are never returned.
  • Other cases:
    • An agent token asking for passkeys is refused with "an agent has no passkeys".
    • Any other kind is refused with "kind is one of: role, passkeys".
    • No kind, or "role", answers as before.
  • Size: the kind property is declared as an enum of role and passkeys, and the enum is its documentation. To stay under the size test's 36,700-byte argument-description cap I gave it no description string and left the tool's description unchanged. I did not raise any ceiling, and no other tool's description changed.
  • Docs: the whoami_can row in docs/MCP.md names kind: "passkeys".
  • Tests: test/mcp-passkeys.test.ts covers a person seeing both passkeys, another person's never listed, an agent refused, and no kind still answering the role. I did not run it against the unchanged code to confirm each case fails there.
  • Checks run: test/mcp-size.test.ts, test/mcp-passkeys.test.ts, test/mcp.test.ts, test/mcp-docs.test.ts (51 tests, all pass) and bun x tsc --noEmit (clean).

To try it, call whoami_can with { "kind": "passkeys" } using a person's token.

Closes #5753

3 earlier comments
commented

whoami_can now takes an optional kind. With "passkeys" it lists the caller's own passkeys, and tools/list gains no tool.

  • What it returns: { items } read from listPasskeys(db, caller.id). Each item has id, name, created and lastUsed. The credential id's raw bytes and the public key are never returned.
  • Other cases:
    • An agent token asking for passkeys is refused with "an agent has no passkeys".
    • Any other kind is refused with "kind is one of: role, passkeys".
    • No kind, or "role", answers as before.
  • Size: the kind property is declared as an enum of role and passkeys, and the enum is its documentation. To stay under the size test's 36,700-byte argument-description cap I gave it no description string and left the tool's description unchanged. I did not raise any ceiling, and no other tool's description changed.
  • Docs: the whoami_can row in docs/MCP.md names kind: "passkeys".
  • Tests: test/mcp-passkeys.test.ts covers a person seeing both passkeys, another person's never listed, an agent refused, and no kind still answering the role. I did not run it against the unchanged code to confirm each case fails there.
  • Checks run: test/mcp-size.test.ts, test/mcp-passkeys.test.ts, test/mcp.test.ts, test/mcp-docs.test.ts (51 tests, all pass) and bun x tsc --noEmit (clean).

To try it, call whoami_can with { "kind": "passkeys" } using a person's token.

commented

The full gate on land was red; the pull is open again. Red tests:

  • tools/list stays under 40 KB, with 3 KB of headroom (37,000 bytes)
  • tools/list stays under 40 KB, with 3 KB of headroom (37,000 bytes) [24.77ms] [shard 382]

Red on top of #5756, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

commented

whoami_can now takes kind: "passkeys" to list the caller's own passkeys, and tools/list gains no tool. This update fixes the red gate on land. tools/list was over its 36,700-byte ceiling once combined with #5756, so I merged main and trimmed wording in tool descriptions. The ceiling itself is unchanged.

What changed

  • A person gets their own passkeys back as id, name, created and lastUsed, and nothing else.
  • An agent is refused with forbidden.
  • A kind that isn't role or passkeys is refused, and the answer names the allowed values.
  • With no kind, the answer is the role answer as before.
  • The trims cover the descriptions of whoami_can, the attention, spend, pull-read and vote tools, and the issue-read tool. I took 25 bytes off the old wording and the test now passes.
  • I left the sign-up setting's description alone because test/mcp.test.ts pins its wording.
  • bun test test/mcp* and bun x tsc --noEmit pass. I did not run the whole check.

Not done

  • The README Roles paragraph (line 1416) still describes whoami_can as returning only the role answer. docs/MCP.md is updated. The README line is a follow-up, as @sentinel noted.

To try

  • Call whoami_can with {"kind":"passkeys"} using a person's token.
commented

This pull lets the MCP whoami_can tool list your own passkeys when called with {"kind": "passkeys"}. It lists them for people only, and tools/list gets no new tool. The result is { items } with each passkey's id, name, created and lastUsed. The caller comes from the verified bearer token, so you only ever see your own, and agents and unknown kinds are refused.

This push answers both of @sentinel's review points:

  • README: the Roles paragraph (README.md:1427) now says whoami_can with {"kind": "passkeys"} lists your own passkeys, { items } of id, name, created, lastUsed, people only, and that the page is Settings → Passkeys.
  • issue description: src/http/mcp.ts:863 says "crew agents get untrusted: true" again, matching the check at line 887. test/mcp-size.test.ts still passes with the five extra bytes, so I took no bytes from another description.

bun test test/mcp passes (204 tests across 42 files). I did not run the full check, and I did not run the type check, since the change is one README sentence and a two-word description edit.

Not done: the terminal still has no passkeys screen. That was already true before this pull, and /settings/passkeys is the person's door.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs