Anthropic's current public guidance draws a hard line:
- Native Anthropic apps, including Claude Code, may use Claude subscription authentication.
- Third-party tools should prefer API key authentication through Claude Console or a supported cloud provider.
- Apps that misrepresent their identity, route third-party traffic against subscription limits, or otherwise violate Anthropic terms are explicitly prohibited.
For GSD2, the safe path is:
1. Treat local Claude Code as an external authenticated runtime.
2. Never ask GSD users to sign into Claude subscriptions through GSD-managed Anthropic OAuth.
3. Never exchange Claude.ai subscription OAuth into a bearer token and call Anthropic APIs as if GSD were Claude Code.
4. If GSD needs direct Anthropic API access, require a Claude Console API key, Bedrock, Vertex, or another explicitly supported provider path.
## What Anthropic Explicitly Allows
### 1. Claude Code itself can use Claude subscription auth
Anthropic's help center says Claude Pro/Max users should install Claude Code, run `claude`, and "log in with the same credentials you use for Claude." It also says this connects the subscription directly to Claude Code, and that `/login` is the way to switch account types. The Team/Enterprise article gives the same flow for org accounts.
Implication for GSD2:
- Letting users authenticate inside the real `claude` CLI is aligned with Anthropic's documented flow.
- Detecting `claude auth status` and routing work through the local CLI or official Claude Code SDK is the lowest-risk pattern.
### 2. Claude Code supports both subscription OAuth and API credentials
Anthropic's Claude Code docs say supported auth types include Claude.ai credentials, Claude API credentials, Azure Auth, Bedrock Auth, and Vertex Auth. The docs also define auth precedence:
1. cloud provider credentials
2.`ANTHROPIC_AUTH_TOKEN`
3.`ANTHROPIC_API_KEY`
4.`apiKeyHelper`
5. subscription OAuth from `/login`
Implication for GSD2:
- If GSD2 shells out to or embeds Claude Code, it should respect Claude Code's own credential selection instead of inventing a parallel Anthropic OAuth flow.
-`apiKeyHelper` is the clean enterprise escape hatch when an org wants dynamic short-lived keys without handing raw API keys to the tool.
### 3. Anthropic commercial usage is available through API keys and supported cloud providers
Anthropic's commercial terms govern API keys and related Anthropic services for customer-built products, including products made available to end users. The authentication docs for teams recommend Claude for Teams/Enterprise, Claude Console, Bedrock, Vertex, or Microsoft Foundry.
Implication for GSD2:
- If GSD2 is acting as a product for users, direct Anthropic access should be through commercial auth paths, not subscription-token reuse.
## What Anthropic Explicitly Warns Against
Anthropic's current "Logging in to your Claude account" article is the clearest statement:
- Subscription plans are for ordinary use of native Anthropic apps, including Claude web, desktop, mobile, and Claude Code.
- "The preferred way" for third-party tools, including open-source projects, is API key auth through Claude Console or a supported cloud provider.
- If you're building a product, application, or tool for others, use API key auth through Claude Console or a supported cloud provider.
- Tools that misrepresent identity, route third-party traffic against subscription limits, or otherwise violate terms are prohibited.
Anthropic's consumer terms add two more constraints:
- Users may not share account login info, API keys, or account credentials with anyone else.
- Except when accessing services via an Anthropic API key or where Anthropic explicitly permits it, users may not access the services through automated or non-human means.
Implication for GSD2:
- A GSD-managed Anthropic OAuth flow for subscription accounts is high risk.
- Reusing user Claude subscription credentials inside GSD's own API client is high risk.
- Any flow that makes Anthropic believe requests come from Claude Code when they actually come from GSD infrastructure is out of bounds.
1.~~Delete or disable `packages/pi-ai/src/utils/oauth/anthropic.ts`.~~**Done** — file deleted.
2.~~Remove `anthropicOAuthProvider` from `packages/pi-ai/src/utils/oauth/index.ts`.~~**Done.**
3.~~Change `src/web/onboarding-service.ts` so Anthropic does not claim OAuth support.~~**Done.**
4.~~Audit `packages/daemon/src/orchestrator.ts` and any other callers that treat Anthropic OAuth access tokens as API credentials.~~**Done** — daemon now requires `ANTHROPIC_API_KEY`.
5.~~Update docs/UI labels to prefer `anthropic-api` for direct API usage and `claude-code` for subscription usage.~~**Done** — providers.md and getting-started.md updated.
6. Add tests that fail if Anthropic subscription OAuth is reintroduced through the onboarding/provider registry. — **TODO.**