Repository navigation
Description
Summary
engine.auth supports keyless workload identity federation for azure, anthropic and gcp. There is no provider for OpenAI's own API, so a Codex (or other OpenAI-engine) workflow calling api.openai.com still needs a static OPENAI_API_KEY secret. OpenAI now documents workload identity federation with GitHub Actions OIDC as a supported way to authenticate to its API without a long-lived key.
Requesting engine.auth.provider: openai, handled by the AWF API proxy the same way as the existing providers.
What exists today
EngineAuthConfig.Providerinpkg/workflow/engine.gois documented as"azure", "anthropic", or "gcp".provider: azurecovers OpenAI models served through Azure OpenAI only (Supportengine.authfor Azure OpenAI GitHub OIDC workflows #31112, Support Azure Entra OIDC in native Codex #68457).- Provider-based authentication for Claude, Copilot, Codex. #16498 asks for provider-based auth for Claude, Copilot and Codex in general; it does not track OpenAI WIF.
- A search of issues and PRs for OpenAI workload identity, OpenAI WIF and Codex federation found nothing.
OpenAI's flow
Docs:
- https://developers.openai.com/api/docs/guides/workload-identity-federation
- https://developers.openai.com/api/docs/guides/workload-identity-federation/github-actions
- The job has
id-token: writeand requests a GitHub OIDC token for an audience configured in OpenAI (for examplehttps://api.openai.com/v1). - The token is exchanged at
https://auth.openai.com/oauth/token(RFC 8693 token exchange, JSON body). Required fields:grant_type,subject_token_type,subject_token,identity_provider_id,service_account_id. - The response is a short-lived bearer
access_token(at most one hour, no refresh token) used to authenticate API requests. - In OpenAI, an admin creates a Workload Identity Provider (issuer
https://token.actions.githubusercontent.com, audience) and a service account mapping that pins GitHub claims such asrepository,ref,environmentandworkflow_refto a project and service account.
OpenAI's SDKs do the exchange in-process through a workloadIdentity client option (identityProviderId, serviceAccountId, and a token-provider function). The documented GitHub Actions examples read the three non-secret values from workflow variables: OPENAI_IDENTITY_PROVIDER_ID, OPENAI_SERVICE_ACCOUNT_ID, OPENAI_WIF_AUDIENCE.
Proposed shape
engine:
id: codex
auth:
type: github-oidc
provider: openai
identity-provider-id: ${{ vars.OPENAI_IDENTITY_PROVIDER_ID }}
service-account-id: ${{ vars.OPENAI_SERVICE_ACCOUNT_ID }}
audience: https://api.openai.com/v1Field mapping against the existing providers:
| Concept | anthropic | openai |
|---|---|---|
| Trust anchor | federation-rule-id, organization-id, workspace-id |
identity-provider-id |
| Identity | service-account-id |
service-account-id |
| Audience | optional audience: |
audience: (must match the OpenAI provider exactly) |
The proxy would request the GitHub OIDC token, perform the exchange, re-exchange before expiry, and inject the bearer token on upstream requests so the agent container never holds a credential.
Open questions
- Whether the native Codex engine accepts an exchanged access token as its bearer credential. OpenAI's Codex federation path is documented separately (a token file via
OPENAI_IDENTITY_TOKEN_FILE) and is described as beta. - Whether the proxy should support this for non-Codex engines that call api.openai.com directly.
I have not verified that an exchanged token works end to end through the AWF proxy; that needs a trial against a real OpenAI organization.
Activity
benissimo commentedon Nov 9, 2026
Closed by #75927, but OpenAI WIF is not usable end to end yet: the AWF API proxy has no OpenAI WIF provider (github/gh-aw-firewall#11355), no minimum-version check was added, and several review comments on the PR have no visible fix. Remaining work is tracked in #76221.