Skip to main content

Overview

Anthropic Tenant Restrictions let a proxy allowlist organization IDs. Your proxy injects anthropic-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 . 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 SettingsAccount, or Organization settingsOrganization. For Console orgs, go to SettingsOrganization.
2

Copy the Organization ID

Copy the UUID. It looks like 000a0000-a00a-00a0-a000-000000000000.
See Anthropic’s Tenant Restrictions article for where the ID appears in each plan.

Route Anthropic traffic through Formal

The Formal Endpoint must intercept Anthropic requests so the rewrite can run.
1

Enable the transparent proxy

On macOS, install and start the transparent proxy:
Verify: the status command reports that the proxy is running.
2

Connect the Anthropic resource

Replace anthropic with your resource name from formal ls.
Apps can keep using api.anthropic.com. The Endpoint intercepts that hostname and applies policies.

Create the rewrite policy

The policy merges anthropic-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.
  1. Navigate to Policies
  2. Click Create Policy
  3. In Choose a Template, select Restrict Anthropic Sign-Ins To One Org
  4. Replace <YOUR_ORG_ID> with the UUID you copied
  5. Click Create Policy to save
You can also paste this Rego if you skip the template:
Header values must be arrays of strings. For more than one org, use a comma-separated list in a single value. Do not put spaces between IDs:
Anthropic rejects duplicate anthropic-allowed-org-ids headers. Keep one header value. Do not list each org as a separate array element.
This policy matches every LLM resource. If you also proxy other providers, scope the rule to Anthropic hostnames:
Create the policy in Draft or Dry-run first. Then set it to Active.

Verify

Verify an allowed org:
  1. Sign in to Claude with an account in your Anthropic org.
  2. Send a Messages API request, or use Claude Code as usual.
  3. Open Logs and confirm the rewrite ran.
Look for 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:
You can also probe the API with your org key after the header is in place:
Expected: HTTP 200 when the key belongs to <YOUR_ORG_ID>. HTTP 403 tenant_restriction_violation otherwise.

Troubleshooting

Possible causes:
  • Transparent proxy or formal connect is not active
  • Policy is Draft or Dry-run, not Active
  • Traffic uses a host you do not intercept (claude.ai vs api.anthropic.com)
Fix:
  1. Run formal transparent-proxy status
  2. Set the policy to Active
  3. Confirm Formal intercepts the Anthropic hostname the app uses
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)
Fix:
  1. Re-copy the Organization ID from Anthropic settings
  2. Keep a single UUID string in the header array
  3. Sign in with an account in that org
Possible causes:
  • More than one anthropic-allowed-org-ids header on the request
  • Multiple array elements instead of a comma-separated string
Fix:
  1. Use object.union so Formal overwrites the header
  2. 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 the transparent proxy