Skip to content

Board: start Claude on labeled tasks from trusted accounts, behind Privy sign-in #2408

Open

Description

@sweetmantech

Tracking issue for making the Recoup Vercel Board start Claude when a trusted teammate hands it a task. Today nothing answers: on 2026-11-19 Sid's Codex posted a task in #general mentioning @sweetmantech/claude, and it stayed ready with 0 replies. recoupable/board is a read-and-post viewer only, with no access control.

Goal

A task on the team board labeled agent=claude, owned by a trusted account, starts Claude within seconds of being posted. Claude claims the task by ID, replies in the thread as claude via api, and completes or fails it. The wake-up route and watcher live in recoupable/api (app/api/board/[[...path]]/route.ts, lib/board/), not in the new client repo. recoupable/board keeps only the viewer, now behind Privy sign-in that matches Music Nerd's pattern and Recoup's existing GET /api/admins check.

PRs (updated 2026-11-20)

PR Item State
api#1295 /api/board wake-up route + production-only claude watcher (label agent=claude, trusted owners) starting Claude in a Vercel Sandbox open (draft) -- 39 unit tests pass; preview checked: /api/board answers as the board handler; wake-up and Claude run provable only in production
board#3 Privy sign-in on /board; inspector proxied only for Recoup admins open (draft) -- 30 unit tests and build pass; preview checked: /board redirects to sign-in; admin/non-admin untested until NEXT_PUBLIC_PRIVY_APP_ID is set
docs#TBD Refresh operation-inventory.json to classify /api/board/{path} as an internal callback route not started (after api merges)

Merge order: api → board → docs inventory refresh. The wake-up route is an internal callback like /api/coding-agent/callback, so it gets no public reference page; the docs change is the inventory refresh, which needs the merged api commit to pin. Board auth can merge independently, but should land before anyone advertises the agent=claude label.

Open: next up (in merge order)

  • api: wake-up route and claude watcher.
    • Why: a mention doesn't wake anything. Vercel's board watchers can't match --mentions yet ("Vercel's boards can't match mentions yet"), and a task owned by another principal must be claimed by ID.
    • Fix: board({ watch }) registered only when VERCEL_ENV === "production" (previews register watchers too, which would start duplicate runs). Tail --label agent=claude; run acts on task.created, task.ready, task.reopened, and labels.changed setting agent=claude, only for a root task that is ready, unclaimed, and owned by a principal in BOARD_TRUSTED_PRINCIPALS. It starts a Vercel Sandbox with team.as({ name: "claude" }).sandboxPolicy() (board credential injected by the sandbox proxy, never inside), npm, and AI Gateway with the gateway credential injected the same way. Claude Code in the sandbox claims the task by ID, replies, then completes or fails it.
    • Done when: unit tests cover the event filter and the trust check; a production-only watcher registers; on the preview, POST /api/board/wake answers without registering preview watchers; after merge, a labeled task from a trusted owner gets a Claude reply and settles.
  • board: Privy sign-in.
    • Why: the viewer reads and posts as the project for anyone with the URL, and labeled tasks will start agents.
    • Fix: Privy email login like MusicNerdWeb's PrivyProviderWrapper, sending the access token as a cookie (the inspector page's own fetches can't add an Authorization header). The /board route checks it against Recoup's GET /api/admins (Privy Bearer via validateAuthContext): no or bad token is 401 (page requests redirect to sign-in), non-admin is 403. No new api endpoint.
    • Done when: on the preview, signed-out /board redirects to sign-in, a non-admin gets 403, an admin sees the board.

Architecture decisions

  • Route by label, not mention. Vercel's board refuses mention filters on watchers; agent=claude is set with vb tasks create general "..." --label agent=claude.
  • Trust is the task owner's principal. A task's text is instructions for whoever claims it, so only owners listed in BOARD_TRUSTED_PRINCIPALS start Claude. An empty list starts nothing.
  • No credential enters the sandbox. Board access comes from sandboxPolicy(); the AI Gateway key is added by a network-policy header transform, as buildGitHubCredentialBrokeringPolicy does for GitHub.
  • Board sandboxes use @vercel/sandbox 3.9.1 (aliased vercel-sandbox-3). The api's pinned 2.0.0-beta.11 drops the board policy's per-route match and response: 403 rules, which would put the board credential on every path of its host.
  • Board auth reuses Recoup's admin check. Music Nerd verifies the Privy token server-side and checks is_admin; Recoup already does both in GET /api/admins, so the board calls it instead of adding an endpoint.

Settings someone with access must set (names only)

  • api (production): BOARD_TRUSTED_PRINCIPALS, comma-separated principal IDs (from vb actors). AI_GATEWAY_API_KEY or the project's OIDC token must reach AI Gateway (already used by release packs).
  • board: NEXT_PUBLIC_PRIVY_APP_ID for preview and production (Recoup's Privy app), optional RECOUP_API_URL; add board.recoupable.dev and its preview domain to the Privy app's allowed origins.

Source references

  • @vercel/board 0.52.0 docs: 01-board/06-watchers.md, 01-board/11-tasks.md, 03-guides/06-sandboxed-agents.md, 03-guides/02-inspector.md.
  • Music Nerd: xdjs/MusicNerdWeb src/app/_components/PrivyProviderWrapper.tsx; xdjs/MusicNerdAPI lib/auth/verifyPrivyAccessToken.ts, authenticateAdmin.ts.
  • Recoup: api lib/admins/checkAdminHandler.ts, lib/sandbox/vercel/sandbox/buildGitHubCredentialBrokeringPolicy.ts; chat providers/PrivyProvider.tsx.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions