Skip to content

Can Claude Code in the guest run on a browser login while the host keeps the real tokens?

Answered 2026-10-15: yes, with conditions. Decided 2026-10-15: 1A, not in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there., and 2A, the warning stays. The decisions are in the 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? comment that starts Decision (2026-10-15). Spec changes in I256I256 (closed): S14-claude-in-guest, S09-policy-credentials-audit: browser login decisions from B15-browser-loginSpec changes from the B15-browser-login decisions on #15 (2026-10-15)., the deferred design in I257I257 (open): Host-side browser login for the model credential (after V1)A host-side browser login for the model credential, deferred past V1 by the B15-browser-login decision on #15 (2026-10-15, option B not chosen for V1).. Source: 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?, 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?, “Browser login (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?)”. Touches 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., S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow Claude Code gets into the guest image, which of the user's Claude Code configuration goes with it, how it starts, and the agent interface that keeps Claude Code's specifics in one place (V1-02-claude-only). and 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.. API key mode moved to I253I253 (open): X01-model-credential: API key mode end to end via the proxyDoes Claude Code work end to end in API key mode with a placeholder API key while wb-proxyd injects the real key in x-api-key?.

guest, untrustedClaude Codeplaceholder accessand refresh tokenshostwb-proxydswaps both ways,keeps rotated tokenssecret storebrowser, sign-ininternetmodel APIreal access tokenplatform.claude.com token endpointreal refresh token, rotatesclaude.com authorize pageshows a login codecode pasted

Figure 1. The measured mode, drawn as it would be with a guest. Claude Code holds only placeholders. wb-proxyd adds the real access token on the model API, and on a refresh sends the real refresh token and hands Claude Code placeholders for the new tokens. The sign-in happens in a browser on the host. Red: a login code pasted into the guest, which decision 2 is about.

The long-lived token from claude setup-token stays the subscription mode (S09-05-credentialsS09-05-credentials: CredentialsHow credentials are stored and bound to requests, and how the model credential reaches the model API without entering the guest., “Model credential”). A /login in the guest can’t finish. The profile doesn’t allow the token endpoint, and wb-proxyd refuses the code exchange. An issue keeps the measured design for after V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there..

wb signs the user in on the host, either with its own login flow under Claude Code’s public client ID, or by running the host’s Claude Code and moving the login out of its store, as the spike did. The refresh token goes in the secret store. wb-proxyd answers the guest’s refresh as in Figure 1, and writes each rotated token back.

The guest’s Claude Code signs in itself, and the profile allows the login hosts. Not viable: the guest’s Claude Code stores the real pair in its Keychain, or in plaintext in ~/.claude/.credentials.json when no Keychain is unlocked, which the spike saw. It needs a spec change that weakens a control, so it isn’t recommended.

RequirementA. Not in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.B. Host-side loginC. In the guest
SEC04-no-guest-secretsSEC04-no-guest-secrets: No secrets in the guestThis includes the model credential. no secrets in the guestplaceholder onlyplaceholders onlyreal tokens
SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable. only allowed hosts and paths are reachableprofile unchangedtoken endpoint, organization pathslogin hosts
FR01-drop-inFR01-drop-in: Drop-in for claudewb is the single entry point for everything, structured as wb [wb flags] <command> [command args]. Claude Code works as on the hostno /login, a token insteadno /login in the guestas on the host

/login in a guest prints a real authorize URL, and refusing /v1/oauth/hello doesn’t stop it. A user who opens it and pastes the code into the guest gives the guest a code it can’t redeem through wb-proxyd, but can send out. S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow Claude Code gets into the guest image, which of the user's Claude Code configuration goes with it, how it starts, and the agent interface that keeps Claude Code's specifics in one place (V1-02-claude-only). has wb warn against it.

S16-terminal-streamS16-terminal-stream: Terminal StreamHow wb guards boundary 6 of T00-index, the guest output that wb writes to the user's terminal. removes claude.com/cai/oauth/authorize URLs from the guest’s output.

Details and glossary

Why the host must own the refresh. Each refresh returns a new refresh token. If the guest held the real one, and the host’s Claude Code or a second VM had the same login, whichever refreshed second would send a token the other had already used. With the proxy answering every refresh, there is one holder, and Claude Code in the guest only ever sees placeholders.

A leaked refresh token works for up to 30 days. Rotation doesn’t revoke the old refresh token, at least not within five minutes. A refresh token copied out of the secret store keeps working until the login’s deadline, about 30 days, or until someone revokes the login. /logout revokes through platform.claude.com/v1/oauth/token/revoke.

What the long-lived token lacks. The long-lived token from 2026-10-12 reached none of the organization’s plugin and skill paths that the browser login reached, so organization plugins and skills aren’t in the guest in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. either way, as S14-claude-in-guestS14-claude-in-guest: Claude Code in the GuestHow Claude Code gets into the guest image, which of the user's Claude Code configuration goes with it, how it starts, and the agent interface that keeps Claude Code's specifics in one place (V1-02-claude-only). already says for the plugin marketplace.

Glossary

  • Access token: what Claude Code sends with each model request. It lasts 8 hours.
  • Refresh token: what Claude Code trades for a new access token when the old one expires. It is the long-lived secret of a login.
  • Rotation: a refresh returns a new refresh token as well.
  • Authorize URL: the page where the user signs in. It ends with a code that the user pastes back into Claude Code.
  • PKCE: a check that ties the code to the program that asked for it. Whoever holds both the code and the program’s secret verifier can redeem it.