Overview
Anthropic does not support third-party OAuth, so Claude can’t use Formal linked accounts. You can still keep each user on their own Claude account without leaving usable tokens on their laptop. Each user signs in to Claude Code with their own claude.ai account. Formal then seals the OAuth tokens Anthropic returns:- An encrypt encrypts
access_tokenandrefresh_tokenin the response fromplatform.claude.com. - Claude Code stores
formalsealed:...values instead of plaintext tokens. - A decrypt policy decrypts the
Authorizationheader before the request reaches Anthropic. It also decrypts the refresh token when Claude Code refreshes or revokes it.
Endpoint
encrypt is macOS-only. On other platforms, forward this traffic to a with a token encryption key. See Encrypt on the Connector.Intercept Anthropic traffic
Claude Code signs in throughplatform.claude.com and calls api.anthropic.com and mcp-proxy.anthropic.com. A network rule sends all three through the Endpoint.
1
Enable Transparent Mode
2
Create the network rule
- Control Plane
- Terraform
- Navigate to Network Rules
- Create a rule named
claude-oauth - Paste the CEL below
- Leave Forward to Connector unset
- Save the rule and set it to Active
claude -p "test" and confirm the request appears in Logs.Encrypt the OAuth tokens
This policy encrypts the tokens in every OAuth response fromplatform.claude.com.
- Control Plane
- Terraform
- Navigate to Policies
- Click Create Policy
- Set name to
claude-encrypt-oauthand add a description - Paste the Rego below into the editor
- Click Create Policy to save, then set the policy to Active
Decrypt the tokens for Anthropic
This policy has two rules. The first decryptsAuthorization on API and MCP proxy requests. The second decrypts the refresh token when Claude Code refreshes or revokes it.
- Control Plane
- Terraform
- Navigate to Policies
- Click Create Policy
- Set name to
claude-decrypt-oauthand add a description - Paste the Rego below into the editor
- Click Create Policy to save, then set the policy to Active
Verify end to end
Tokens issued before the policies were active are still plaintext. Sign out and sign in again with Transparent Mode running:Troubleshooting
Claude Code stores plaintext sk-ant tokens
Claude Code stores plaintext sk-ant tokens
Possible causes:
- Transparent Mode or the network rule is inactive
- The device is not macOS, so the Endpoint can’t encrypt
- You signed in before the encrypt policy was active
- Run
formal transparent-proxy status - Set the network rule and both policies to Active
- On Linux or Windows, forward the traffic to a Connector with a token encryption key
- Run
claude auth logoutandclaude auth loginagain
Next Steps
Restrict Anthropic Sign-Ins
Allow only your Anthropic organization
Encrypt MCP OAuth Tokens
Apply the same pattern to MCP servers
Encrypt & Decrypt
Full action reference
Token Encryption
Encrypt on the Connector with a KMS key