A cloud workspace can read its environment's variable names, and a deploy CLI's token can be one

Merged
SA
1mo ago
+24-3

An agent in a cloud workspace couldn't see which variables its environment gives it, and VERCEL_TOKEN / VERCEL_ORG_ID couldn't be environment variables at all. Both block using vercel, wrangler and eas from a box (binaries land in #7863).

Changes

  • environment.secrets.list joins SANDBOX_ALLOWED_PROCEDURES. It returns names, visibility and timestamps, never values. set and remove stay a person's call.
  • CLI: in a box, environments secrets list is visible; set and delete carry sandbox: false themselves instead of the whole group. A box runs with the internal audience, so environments doesn't vanish there with the next bundle.
  • The reserved secret prefix narrows from VERCEL_ to VERCEL_SANDBOX_, the only Vercel family the provisioner reads. New test pins it.

Verification

  • bun test for shared (new) and cli-framework pass; typecheck passes for cli, trpc and shared; biome clean.
  • Built CLI: with SUPERSET_SANDBOX_WORKSPACE_ID set, environments secrets lists only list, and set is an unknown command. Outside a box without the internal audience, environments stays hidden.
  • Not verified end to end in a box: that needs this deployed plus a bundle with the new CLI.

After merge

Set VERCEL_ORG_ID and a fresh scoped VERCEL_TOKEN on the internal Superset environment (prod rejects VERCEL_ names until this deploys). EXPO_TOKEN is already set; Cloudflare and Neon were already there.


Summary by cubic

Lets a cloud workspace see which variables its environment provides, and lets deploy CLI credentials like VERCEL_TOKEN and VERCEL_ORG_ID live as environment variables so vercel, wrangler, and eas work from a box.

  • environment.secrets.list joins the sandbox allowlist and returns names, visibility, and timestamps, never values.
  • The CLI shows environments secrets list in a box; set and delete are marked sandbox: false individually, and a box runs with the internal audience so environments stays visible.
  • The reserved secret prefix narrows from VERCEL_ to VERCEL_SANDBOX_, the only Vercel family the provisioner reads.

Migration

After deploy, set VERCEL_ORG_ID and a fresh scoped VERCEL_TOKEN on the internal Superset environment (prod currently rejects VERCEL_ names).

Summary by CodeRabbit

  • New Features

    • CLI access now supports both internal and public audiences when running in a sandbox workspace.
    • Sandbox credentials can access the environment secrets list.
    • Environment variable names beginning with VERCEL_ can now be used, except those beginning with VERCEL_SANDBOX_.
  • Bug Fixes

    • Environment secret set and delete commands now work correctly in sandbox contexts.