A cloud workspace ignores an environment's provider keys; the agent's credential is the person's sign-in
Replaces #7841, which GitHub closed when #7840 merged and its base branch was deleted. #7840 (the org-key fallback removal) is already on main as ef8f2bdafd.
An environment variable named ANTHROPIC_API_KEY, OPENAI_API_KEY or CLAUDE_CODE_OAUTH_TOKEN was doing two jobs: the app's key, and the agent's credential for anyone without a sign-in. A teammate without a sign-in billed Claude to the team's dev key, and anyone with a sign-in had the variable stripped from their box.
Now a cloud workspace ignores those names, the way Conductor does. They never reach the box. The agent's credential is the person's sign-in (Settings › Agents), brokered at the firewall by a rule that fires only on the placeholder the agent presents (the Vercel policy supports header matchers). Measured on Claude Code 2.1.282: with a key beside an OAuth token it takes the key, so any real key on the box would be picked up by a hand-typed claude, a headless claude -p or codex and billed with nobody looking. Leaving it out is the only way a box stays on the person's subscription, and it removes the overlay, the host-service changes and the prompt-answer write from earlier revisions of this branch: no host-service release needed.
Where it's said: the environment sheet marks such a name amber as it is typed with "Cloud workspaces ignore this variable. Agents sign in under Settings › Agents instead." (translated into all 16 locales), and superset environments secrets set prints the same after saving and returns it as warnings in JSON so an agent reads it without being stopped. Nothing blocks.
What it costs, documented in docs/cloud-sandbox-considerations.md: an app that needs a provider key can't get it from the environment in a cloud workspace. With an API-key sign-in the app's requests carry the placeholder and run on the person's key; with a subscription they fail. Our own API reads SERVER_ANTHROPIC_API_KEY instead (api, web, admin, trpc schemas; the deploy workflows pass the same GitHub secret under the new name), so it carries its key into a box like any other variable. The Superset environment needs that variable set for our API to boot in a box.
Also: the release probe signs in with the env file's Anthropic key and checks that a non-placeholder key gets a 401 through the firewall.
Verified: credentials tests (8), typecheck across shared/trpc/api/desktop/cli/sandbox/host-service, lint, check:i18n clean; the sheet warning driven over CDP on the real dialog; the CLI run from source against prod. The firewall match semantics are not yet proven on a real box; that needs the API deployed, then a box probe, which I'll run after merge.
https://claude.ai/code/session_01RL946q6aRucLVJs659sW24
Summary by cubic
Cloud workspaces no longer pass an environment's provider keys into a box. The agent's credential is now always the person's sign-in (Settings › Agents), brokered at the firewall by a rule that swaps the placeholder the agent presents.
Migration
ANTHROPIC_API_KEY,OPENAI_API_KEY, andCLAUDE_CODE_OAUTH_TOKENset on an environment are ignored and never reach the box.- Our own Anthropic key is renamed to
SERVER_ANTHROPIC_API_KEY; env schemas (web, marketing, admin, api, trpc) and deploy workflows are updated, and the Superset environment needs that variable set for the API to boot in a box.
Warnings and behavior
- The environment sheet flags such names amber as typed;
superset environments secrets setprints the same warning after saving and returns it aswarnings. - The release probe signs in with the env file's key and checks that a non-placeholder key gets a 401 through the firewall.
Summary by CodeRabbit
- New Features
- Secret settings and the CLI now warn when a cloud workspace ignores a provider credential. Agents sign in through Settings › Agents instead.
- Changes
- Cloud workspaces use signed-in agent credentials for supported provider requests. Credentials supplied through ignored environment variables are not passed into the workspace.
- Server-side Anthropic configuration now uses the
SERVER_ANTHROPIC_API_KEYenvironment variable.