Overview
Anthropic Tenant Restrictions let a proxy allowlist organization IDs. Your proxy injectsanthropic-allowed-org-ids on Claude traffic. Anthropic then allows only those orgs for sign-in and API use.
Formal adds that header with a request-stage rewrite . A network rule selects the Anthropic traffic that the policy runs on. Users on the Formal Endpoint can sign in only with your Anthropic org. Personal Claude accounts and other orgs receive a 403 from Anthropic.
This guide uses the Formal Endpoint on macOS.
Find your Anthropic organization ID
You need the UUID Anthropic shows for your org.1
Open Anthropic settings
For Enterprise, go to Settings → Account, or Organization settings → Organization. For Console orgs, go to Settings → Organization.
2
Copy the Organization ID
Copy the UUID. It looks like
000a0000-a00a-00a0-a000-000000000000.Route Anthropic traffic through Formal
The Formal Endpoint must intercept Anthropic requests so the rewrite can run. A network rule selects that traffic.1
Enable Transparent Mode
On macOS, install and start Transparent Mode:Verify: the status command reports that Transparent Mode is running.
2
Create the network rule
Intercept Anthropic hostnames and classify them as LLM traffic.Verify: send an Anthropic request and confirm it appears in Logs.
- Control Plane
- Terraform
- Navigate to Network Rules
- Create a rule named
anthropic-llm - Paste the CEL below
- Leave Forward to Connector unset
- Save the rule and set it to Active
api.anthropic.com. The Endpoint intercepts that hostname and applies policies.
Create the rewrite policy
The policy mergesanthropic-allowed-org-ids into outgoing LLM request headers. object.union puts your value second, so it overwrites a client-supplied header.
Replace <YOUR_ORG_ID> with the UUID you copied.
- Control Plane
- Terraform
- Navigate to Policies
- Click Create Policy
- In Choose a Template, select Restrict Anthropic Sign-Ins To One Org
- Replace
<YOUR_ORG_ID>with the UUID you copied - Click Create Policy to save
Verify
Verify an allowed org:- Sign in to Claude with an account in your Anthropic org.
- Send a Messages API request, or use Claude Code as usual.
- Open Logs and confirm the rewrite ran.
triggered_policies.type:rewrite on LLM requests. Sent headers should include anthropic-allowed-org-ids with your UUID.
Verify a blocked org:
Sign in with a personal Claude account, or call the API with a key from another org. Anthropic should return HTTP 403:
<YOUR_ORG_ID>. HTTP 403 tenant_restriction_violation otherwise.
Troubleshooting
Personal accounts still sign in
Personal accounts still sign in
Possible causes:
- Transparent Mode is not running
- The network rule or the policy is Draft or Dry-run, not Active
- Traffic uses a host the network rule does not match (
claude.aivsapi.anthropic.com)
- Run
formal transparent-proxy status - Set the network rule and the policy to Active
- Add the Anthropic hostname the app uses to the network rule
Requests return 403 tenant_restriction_violation
Requests return 403 tenant_restriction_violation
Possible causes:
- The UUID is not the org that owns the account or API key
- Extra spaces or quotes in the header value
- You are testing with a personal account (this is expected)
- Re-copy the Organization ID from Anthropic settings
- Keep a single UUID string in the header array
- Sign in with an account in that org
Requests return 400 for the header
Requests return 400 for the header
Possible causes:
- More than one
anthropic-allowed-org-idsheader on the request - Multiple array elements instead of a comma-separated string
- Use
object.unionso Formal overwrites the header - Put every org ID in one comma-separated value
Next Steps
LLM Resources
Proxy Anthropic and other LLM APIs
Rewrite Action
Header rewrite reference
LLM Policy Inputs
Request-stage LLM fields and examples
Formal Endpoint
Enable Transparent Mode
Network Rules
Select which Endpoint traffic Formal intercepts