Can Claude Code in the guest hold only a placeholder while the proxy adds the real subscription token?
Answered 2026-10-12: yes for a long-lived token. Decided 2026-10-12: A2, the model only with the event log denied by the host, and the long-lived token as a supported mode for V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.. The decisions and their reasons are in the I60I60 (closed): X01-model-credential: API key mode via the proxySplit from #15 (X01-model-credential) during triage on 2026-10-04. comment that starts Decision (2026-10-12): the four decisions. Source: I60I60 (closed): X01-model-credential: API key mode via the proxySplit from #15 (X01-model-credential) during triage on 2026-10-04., X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?. Changes S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host., S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded., S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does., S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…, S15-least-privilegeS15-least-privilege: Least Privilege on the HostThe security design for SEC12-least-privilege: which rights Wraith Box takes on the host, where credentials are held, and how each host process gets only the credentials it needs, for only as long as it needs them. and FR00-indexFR00-index: Functional requirementsWhat Wraith Box must do for the user. (FR01-drop-inFR01-drop-in: Drop-in for claudewb is the single entry point for everything, structured as wb [wb flags] <command> [command args].), in I215I215 (closed): Model API profile and token binding from X01-model-credentialThe X01-model-credential result for a long-lived subscription token (#60, docs/spikes/X01-model-credential.md) changes the specs below.. Follow-up: I220I220 (closed): Cheap image rebuild for a new Claude Code version- Which stage a Claude Code-only rebuild starts from (a sealed earlier stage, a clone of the image before sealing, or another layer), and how that fits sealing and "never updated in place".. API key mode and the browser login are in I15I15 (closed): X01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?.
Figure 1. What Claude Code reached in the spike, drawn as it would be in a guest. Solid: the model API on api.anthropic.com, which needs the token, and a reachability check that doesn’t. Red: the three hosts the open decisions are about. In the spike every host was reachable. With SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable., a host outside the profile is an unknown destination, and the user is asked about it.
The hosts outside the model API
Section titled “The hosts outside the model API”| Decision | Host and what it does | Recommended |
|---|---|---|
| 1. Telemetry | http-intake.logs.us5.datadoghq.com: Datadog log intake, with a key built into Claude Code and without the user’s token. 5 requests. Anthropic’s own event log on api.anthropic.com (/api/event_logging/v2/batch) carries the user’s token, 10 requests |
Datadog outside the profile, as S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. says today, and telemetry off in the guest. Whether that also stops the event log is assumed, so the event log path is left out of the profile too (A2 below) |
| 2. Updates | downloads.claude.ai: the auto-updater fetched the 2.1.296 build in each interactive session, and the plugin marketplace one plugin archive |
Outside the profile, updater off in the guest. The image sets the version |
| 3. Changelog | raw.githubusercontent.com: one GET of Claude Code’s CHANGELOG.md at interactive start |
Outside the profile |
Options
Section titled “Options”Impact
Section titled “Impact”Decision 4: the long-lived token as a supported mode
Section titled “Decision 4: the long-lived token as a supported mode”Whether Wraith Box supports a token from claude setup-token as the way a subscription user signs Claude Code in, until I15I15 (closed): X01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh? settles the browser login. Recommended: yes, for V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there., bound to api.anthropic.com alone, with these costs written into S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded.:
- Lifetime unknown.
setup-tokencalls the token long-lived, without a lifetime, and the run didn’t see it expire or refresh. When it expires, the user runsclaude setup-tokenon the host again and stores the new token withwb cred set. - Rotation after a leak. The token is kept in the host’s secret store. If that store leaks, the token works from anywhere until someone revokes it, and the user makes a new one. Where a user revokes it wasn’t checked. The spike stored one token and no refresh token, so nothing in Wraith Box renews or replaces it by itself.
- Bound to one host. The spike injected on
api.anthropic.com,console.anthropic.com,platform.claude.comandclaude.ai, and onlyapi.anthropic.comreceived the token. The binding names that host alone, and a placeholder anywhere else gets a403(S07-09-placeholder-bindingS07-09-placeholder-binding: Placeholder BindingWhere a credential placeholder may go in a request, how wb-proxyd scans for it, and what it refuses.). - Not chosen: no subscription mode in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there., which leaves an SSO user with no API key unable to use Wraith Box until I15I15 (closed): X01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh? is decided.
Evidence
Section titled “Evidence”- verified
-pansweredpong,-p --resumeansweredI replied with "pong".in the same session, and the interactive session answered one question, all with a placeholderCLAUDE_CODE_OAUTH_TOKEN. Source: X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?, “Answer”, and the run’sp.json,resume.jsonand proxy log. - verified All 36 requests with a credential sent it as
Authorization: Bearertoapi.anthropic.com, withanthropic-beta: oauth-2025-04-20. The proxy replaced the placeholder in each. Source: the proxy log, X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?, “Hosts”. - inferred That the placeholder went to no host but
api.anthropic.com. Verified for theAuthorizationandx-api-keyheaders only. The proxy didn’t scan other headers, query strings or bodies, which is where S07-09-placeholder-bindingS07-09-placeholder-binding: Placeholder BindingWhere a credential placeholder may go in a request, how wb-proxyd scans for it, and what it refuses., also looks for a leak. A full-request scan is still to do, in the next run or in the conformance tests ofwb-proxyd. - inferred That the real token wasn’t in any file of the test user’s home, and that Claude Code didn’t make a Keychain item for it. Both searches found nothing, but this run couldn’t tell nothing found from a failed read of the token, or a failed Keychain listing. The proxy read the same item at start, so a failed read is unlikely.
run.shnow fails in both cases. Source: X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?, “What Claude Code stored”. - verified The updater, the plugin marketplace, the changelog and the reachability checks ran only in interactive sessions. Source: the proxy log’s timestamps.
- verified The variables
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,DISABLE_TELEMETRYandDISABLE_AUTOUPDATERappear in the Claude Code 2.1.289 binary. Source: a string search of the binary. - assumed That those variables stop the Datadog, event log, update and changelog requests, and that Claude Code works when those hosts are denied. The spike didn’t run either. The model API profile work (I215I215 (closed): Model API profile and token binding from X01-model-credentialThe X01-model-credential result for a long-lived subscription token (#60, docs/spikes/X01-model-credential.md) changes the specs below.) or a rerun of the spike with the variable set would show it.
- assumed That a
setup-tokentoken is valid for longer than a session, and the guest doesn’t need to refresh it. The spike didn’t see a refresh, andclaude setup-token --help(Claude Code 2.1.289) calls the token long-lived without giving a lifetime. Source: X01-model-credentialX01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh?, “Measurements”. - assumed That API key mode works the same way, from OpenShell’s Claude Code provider (X00-indexX00-index: SpikesThe open questions that must be answered by a throwaway prototype before work builds on them, in the order they are taken up.). The spike saw only that the placeholder goes out as
x-api-keyand is replaced. - inferred That the host’s Claude Code and the guest’s don’t race on a refresh:
setup-tokenmakes a token of its own, separate from the host’s login.
What this unblocks
Section titled “What this unblocks”- I215I215 (closed): Model API profile and token binding from X01-model-credentialThe X01-model-credential result for a long-lived subscription token (#60, docs/spikes/X01-model-credential.md) changes the specs below.: the model API profile in S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host. and the model credential in S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded..
- I15I15 (closed): X01-model-credential: Model credential via the proxyDoes Claude Code work with a placeholder credential while wb-proxyd injects the real one, for each supported authentication mode, including token refresh? keeps the browser login and API key mode. This answer narrows it: a subscription user has a mode that works without them.
Details and glossary
The token stays in the proxy, out of the guest. Claude Code only needs a string that looks like a token. The proxy, which runs on the host, sees each request in clear because it inspects TLS, and swaps the placeholder for the token just before it leaves the Mac. A guest that leaks its placeholder leaks nothing that works anywhere else.
What api.anthropic.com serves besides the model. The organization’s limits, remote managed settings (404 here: none set), feature flags, Anthropic’s event log, a bootstrap call that refused this token every time without harm, and the public MCP server registry. Requests to every one of these paths but the MCP registry hold the token. The profile would allow these paths and no others.
Glossary
claude setup-token: a Claude Code command that signs in with a subscription once and prints a long-lived token, for use where no browser login is possible.CLAUDE_CODE_OAUTH_TOKEN: the environment variable from which Claude Code reads such a token.- Placeholder: a fake value with the token’s prefix and length, which the guest holds instead of it.
- Profile: the built-in list of hosts and paths
wb-proxydallows for one purpose, here the model API.