The ant CLI supports identity federation via JWT-bearer token exchange. This allows you to mint credentials for an Anthropic organization using an external identity provider (like Kubernetes or GitHub Actions) via an OidcFederationRule.
To perform an exchange, you must provide a signed JWT (the assertion) and the governing rule details. You can provide the assertion either as a literal string or by pointing to a file. If you use a file, the CLI re-reads it on every request, allowing for seamless token rotation.
Required Inputs
- Identity Token: A signed JWT. Use either
--identity-token or --identity-token-file (mutually exclusive). - Federation Rule: The tagged-ID of the
OidcFederationRule (must have the fdrl_ prefix). - Organization ID: The UUID of the Anthropic organization.
Optional Inputs
- Service Account ID: An optional
svac_... tagged-ID used when the federation rule targets a service account (target_type=SERVICE_ACCOUNT). Leave empty for user-target rules.
# Example using a literal token
ant <command> --identity-token "<JWT_STRING>" --federation-rule "fdrl_..." --organization-id "<ORG_UUID>"
# Example using a token file (recommended for rotating tokens like K8s/GitHub OIDC)
ant <command> --identity-token-file "/path/to/token.jwt" --federation-rule "fdrl_..." --organization-id "<ORG_UUID>"