Skip to content

Anthropic Workload Identity Federation

Workload Identity Federation (WIF) lets AI Sessions reach Claude without a long-lived Anthropic API key. LimaCharlie acts as an OpenID Connect (OIDC) identity provider: for every session it signs a short-lived identity token, and Claude exchanges that token with Anthropic for an access token. You register LimaCharlie as a trusted issuer in your Claude Console once, and there is no API key to store, rotate or leak.

WIF works for both kinds of session:

  • User sessions: the AI Terminal and other user-owned chats in Grid.
  • Organization agents: sessions launched by the start ai agent D&R action, by ai_agent Hive records, or through the org-scoped API.

Eligibility

WIF is available to unified-billing customers. The issuer is tied to your company's email domain. A user belongs to the domain of their verified LimaCharlie email; an organization belongs to the domain of the verified email of the user who created it. If the setup screen reports that federation is unavailable for your account, contact LimaCharlie support.

How it works

Setting Value
Issuer URL https://ai.limacharlie.io/oidc/d/<your-domain> (for example https://ai.limacharlie.io/oidc/d/example.com)
JWKS Published through OIDC discovery at <issuer URL>/.well-known/openid-configuration
Audience (aud) https://api.anthropic.com
Subject (sub), user sessions uid:<LimaCharlie user ID>
Subject (sub), organization agents oid:<LimaCharlie organization ID>
Signing algorithm ES256
Token lifetime 10 minutes, replaced every 3 minutes while the session runs

Besides iss, aud, sub, iat, nbf and exp, each token carries session_id, domain, uid (user sessions) or oid (organization agents), and agent_name when the session comes from a named agent. You can use any of these in a federation rule's CEL condition.

The tokens deliberately carry no jti claim. Several processes inside one session read the same token during its rotation window, and a jti would make Anthropic reject the second exchange. Leave the issuer's check_jti setting at its default.

The token is only ever handed to the session that it was minted for. When a session ends, LimaCharlie stops issuing tokens for it, and access lapses within the 10-minute token lifetime. For user sessions, removing or replacing the user's federation credential has the same effect on sessions already running. For organization agents, see Revoking access.

Step 1: Get your issuer values from LimaCharlie

The values depend on where the sessions will run, so read them from the screen you will configure:

  • AI Terminal: open User Settings → AI Terminal, connect Claude, and pick Workload Identity Federation (short-lived tokens). If a Claude credential is already connected, the screen only offers Remove credentials: remove it first, then connect again and pick federation.
  • Organization agents: open the organization's AI Agents page, create or edit an agent, keep the provider on Anthropic and set the authentication method to Workload Identity Federation (short-lived tokens).

Both screens show the issuer URL, audience, recommended subject prefix, the exact subject Grid will present, and a CEL condition you can use to restrict trust. Each value has a copy button.

You can get the same values from the API with your LimaCharlie JWT:

# For your own user sessions
curl https://ai.limacharlie.io/v1/federation/issuer \
  -H "Authorization: Bearer $LC_JWT"

# For an organization's agents (requires the ai_agent.get permission on that org)
curl "https://ai.limacharlie.io/v1/federation/issuer?oid=$OID" \
  -H "Authorization: Bearer $LC_JWT"
{
  "eligible": true,
  "domain": "example.com",
  "issuer_url": "https://ai.limacharlie.io/oidc/d/example.com",
  "audience": "https://api.anthropic.com",
  "subject": "oid:11111111-2222-3333-4444-555555555555",
  "subject_prefix_hint": "oid:*",
  "strict_condition_example": "claims.oid in [\"11111111-2222-3333-4444-555555555555\"]",
  "subject_prefix_warning": "...",
  "reason": ""
}

If eligible is false, reason says why. Federation cannot be used until that is resolved.

Step 2: Trust LimaCharlie in the Claude Console

Anthropic's Workload Identity Federation guide covers the Console in detail. The LimaCharlie-specific parts are:

  1. In the Claude Console, open Settings → Workload identity and select Connect workload.
  2. Choose Custom OIDC.
  3. Issuer: paste the issuer URL from Step 1 exactly as shown: lowercase domain, no trailing slash. Anthropic compares it byte for byte with the tokens LimaCharlie signs. Use discovery as the JWKS source and leave the discovery base empty. Keep the issuer defaults (maximum token lifetime of one hour, replay check on): LimaCharlie tokens last 10 minutes and carry no jti. Verify issuer should succeed straight away.
  4. Service account: create one and add it to the workspace your sessions should bill to.
  5. Federation rule: target that service account and set:
    • audience: exactly https://api.anthropic.com, with no trailing slash
    • a subject match, chosen as described in Choosing what to trust. A subject_prefix without a trailing * matches only that exact subject, so oid: on its own matches nothing; use oid:*.
    • scope: workspace:developer
    • token lifetime: the wizard's default of 600 seconds is fine; AI Sessions requests a new access token whenever it needs one.
  6. Note the organization ID (a UUID, shown on the Console's Organization settings page), the federation rule ID (fdrl_...) and the service account ID (svac_...). If the rule covers more than one workspace, also note the workspace ID (wrkspc_...) the sessions should use.

None of these IDs are secrets. They tell Anthropic which rule to evaluate; the signed token is what proves the session's identity.

Choosing what to trust

The rule decides which LimaCharlie identities may use your Anthropic service account. From broadest to narrowest:

Rule match Trusts
subject_prefix: "oid:*" Every LimaCharlie organization created by a user whose verified email is on your domain, including organizations created later.
subject_prefix: "uid:*" Every LimaCharlie user whose verified email is on your domain.
subject_prefix: "oid:<oid>" or "uid:<uid>" (no *) Exactly one organization or one user.
condition: claims.oid in ["<oid1>", "<oid2>"] An explicit list of organizations. Use claims.uid for users.

The broad oid:* prefix means you register one issuer and one rule for all your organizations, current and future, which suits MSSPs that manage thousands of tenants. An organization counts as yours when the user who created it has a verified email on your domain. That is fixed when the organization is created and does not change afterwards, so an organization created from someone else's account is not covered, and an organization you later hand to another company stays attributed to your domain. Exclude such organizations with a CEL condition, for example !(claims.oid in ["<oid>"]). If you would rather not trust every organization on your domain automatically, use exact subjects or a CEL condition.

User sessions and organization agents present different subjects, so a rule written for one does not match the other. To use WIF for both, create two rules, or one rule whose condition covers both.

Step 3a: Use WIF for the AI Terminal

On the User Settings → AI Terminal screen from Step 1, enter the Anthropic organization ID, federation rule ID, service account ID and, if needed, the workspace ID, then select Save federation credentials. New AI Terminal sessions, resumes and forks use federation from then on.

The equivalent API call:

curl -X POST https://ai.limacharlie.io/v1/credentials/federation \
  -H "Authorization: Bearer $LC_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_id": "00000000-0000-0000-0000-000000000001",
    "federation_rule_id": "fdrl_xxxxx",
    "service_account_id": "svac_xxxxx",
    "workspace_id": "wrkspc_xxxxx"
  }'

workspace_id is optional. The response is {"stored": true, "type": "federation"}, and GET /v1/auth/claude/status then reports credential_type: federation.

You have one Claude credential at a time. Through the API, POST /v1/credentials/federation replaces whichever Claude credential you had before (API key, Claude Max OAuth, Bedrock or Vertex); in the console, remove the existing credential first, as described in Step 1. Switching to another credential, or removing it with DELETE /v1/auth/claude, stops token issuance for your running sessions immediately.

Step 3b: Use WIF for D&R-triggered and organization agents

Organization agents take the same four IDs in the generic provider / credentials envelope, with auth: federation. In the web app, choose Workload Identity Federation (short-lived tokens) as the authentication method on the agent and fill in the fields. As infrastructure as code, the ai_agent Hive record looks like this:

hives:
  ai_agent:
    triage-agent:
      data:
        prompt: "Triage this detection and summarize the findings."
        lc_api_key_secret: hive://secret/lc-api-key
        provider: anthropic
        credentials:
          auth: federation
          organization_id: 00000000-0000-0000-0000-000000000001
          federation_rule_id: fdrl_xxxxx
          service_account_id: svac_xxxxx
          workspace_id: wrkspc_xxxxx   # optional
      usr_mtd:
        enabled: true

A D&R rule then starts it in definition mode:

respond:
  - action: start ai agent
    definition: hive://ai_agent/triage-agent

The inline form of the action takes the same provider and credentials keys in place of anthropic_secret.

The credential envelope replaces anthropic_secret, bedrock: and vertex: on the record; a record carries exactly one credential source. Hive validates the IDs when you save the record: the organization ID must be a UUID, and the other IDs must start with fdrl_, svac_ and wrkspc_. Values may also be hive://secret/<name> references if you prefer to keep them in Hive Secrets, but since the IDs are not secret, literals are fine.

Because the record holds no secret, the same record can be deployed to every tenant through Git Sync or other infrastructure as code. Each organization presents its own oid:<oid> subject, so the federation rule from Step 2 decides which tenants may use the service account.

Revoking access

Changing or deleting the ai_agent record only affects new sessions. A session that is already running keeps getting fresh tokens until it ends. To stop it, terminate the running sessions from LimaCharlie; that ends their access at once. To stop new token exchanges for every session, disable the federation rule or the service account in the Claude Console. Sessions that already exchanged a token keep it until it expires, which is at most the rule's token lifetime (600 seconds with the wizard default).

Verifying and troubleshooting

Start a session and check that it answers. On the Anthropic side, the Claude Console's authentication history (Settings → Workload identity, History tab) lists every token exchange and, for rejected ones, the reason. Anthropic returns the same generic 401 authentication_error to the session for every rejected exchange, so the history page is where to look.

Symptom Likely cause
The setup screen says federation is unavailable, or the issuer API returns eligible: false The account or organization is not attributed to a unified-billing domain. Contact support.
Session fails with federation_ineligible Same as above, for the session's owner. For an organization, this also happens when LimaCharlie has no record of who created it (some older organizations) or the creator's account has no verified email. Contact support.
Session fails with federation_domain_unavailable or federation_unavailable LimaCharlie could not resolve the billing domain or sign the token at that moment. Retry, and contact support if it persists.
Anthropic rejects the exchange: issuer mismatch The issuer URL in the Console must match the one from Step 1 exactly, including the lowercase domain and with no trailing slash.
Anthropic rejects the exchange: no rule matched The rule's subject match or condition does not cover this session. Compare it with the subject the setup screen shows. Remember that user sessions use uid: and organization agents use oid:, and that a prefix needs a trailing * to match more than one subject.
Anthropic rejects the exchange: audience mismatch The rule's audience must be https://api.anthropic.com.
Anthropic rejects the exchange: workspace (workspace_id_required or similar) The rule covers several workspaces, or all of them, and no workspace ID was configured; or the service account is not a member of the configured workspace.