Skip to content

Cloud · Analysis

AWS IAM Credential Broker: Where It Fits for Agents

AWS IAM Credential Broker (preview since Nov 29) fetches OAuth tokens and API keys for Lambda, ECS, EKS and EC2 workloads. Where it fits, and what migrating an agent changes.

Nalini Groves · Nov 30, 2026 · 8 min read

Share

AWS IAM Credential Broker product page illustration: a padlock beside identity cards and a database
Amazon Web Services, AWS IAM Credential Broker (preview) product page graphic, accessed Nov 30, 2026. Source: https://aws.amazon.com/iam/credential-broker/
On this page

AWS put IAM Credential Broker into public preview on Nov 29, 2026. It fetches, caches and refreshes the OAuth tokens and API keys that a workload on AWS needs for systems outside AWS, so the client secret stops living in your agent's environment variables (AWS announcement).

The catch is that AWS now has four answers to "how does my workload get a non-AWS credential", and the routing rules are spread across separate documentation sets. This piece puts them on one map, then shows what actually changes when you move an existing Lambda or ECS agent onto the broker, including the IAM policy line that decides whether the migration buys you anything.

What AWS shipped on Nov 29

Credential Broker sits inside IAM. Your workload signs a request with its own role, and the broker returns a credential it obtained from the external system: a short-lived OAuth access token, or a stored API key. The documentation is explicit that the broker does not issue tokens. Okta, Entra ID, Salesforce or whoever runs the authorization server still does that.

The pieces you configure:

  • Credential provider pool. The top-level resource. The setup guide says you create one per account; it holds the encryption setting for cached tokens.
  • Credential provider. One external system, one fixed type: OAuth or API key. OAuth providers start from a vendor template or a custom OAuth 2.0 configuration.
  • Three OAuth grants. Client credentials for machine-to-machine work, authorization code for one user's data with a one-time browser consent, and token exchange for a user who is already signed in.
  • Two runtime calls you will use most. GetOAuthToken and GetApiKey, each gated by an IAM action of the same name on the provider's ARN.

Constraints, as of 30 Nov 2026: public preview, all commercial AWS Regions, no additional cost during the preview. AWS has not published a price for general availability. The docs carry a prerelease notice and say details may change.

Four ways to hand a workload a non-AWS credential

Credential Broker is not the only path, and AWS's own docs send some readers elsewhere. Two notes on the main documentation page do most of the routing. If the external service can accept a JSON Web Token signed by AWS, use IAM outbound identity federation, where there is no client secret to store at all. If the agent runs on Amazon Bedrock AgentCore, keep using AgentCore Identity. Everything else on Lambda, ECS, EKS or EC2 is the broker's territory, or stays do-it-yourself in Secrets Manager.

Decision map: outbound identity federation if the service trusts AWS JWTs, AgentCore Identity for AgentCore agents, otherwise IAM Credential Broker with four provider types
How the four paths divide up, built from AWS IAM and AgentCore documentation checked 30 Nov 2026. Metarix editorial diagram, not a product screenshot.

Scroll the table horizontally on smaller screens.

AWS paths for reaching a non-AWS system, as documented on 30 Nov 2026
PathWho issues the credentialSecret you storeFits
IAM outbound identity federationAWS STS signs a JWT (60 to 3,600 seconds, default 300)NoneExternal services that can trust your account's issuer URL
AgentCore IdentityExternal provider, via AgentCore's token vaultHeld by AgentCore IdentityAgents on AgentCore Runtime or Gateway
IAM Credential Broker (preview)External provider; the broker fetches and cachesClient secret or API key in Secrets Manager, in your accountLambda, ECS, EKS and EC2 calling OAuth or API-key services
Do it yourselfExternal provider; your code runs the OAuth flowWhatever your code reads from Secrets Manager or configAnything the managed paths do not cover
Sources: [Credential Broker](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker.html), [outbound identity federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_outbound_getting_started.html) and [AgentCore Identity](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html) documentation, checked 30 Nov 2026. This compares mechanisms, not prices.

Read the first row before anything else. A service that accepts an AWS-signed JWT removes the secret entirely, which beats vaulting it more neatly. If your target service only takes its own OAuth client or an API key, row three is where you land.

What changes in an existing Lambda or ECS agent

Take the common setup: an agent on Lambda reads a Salesforce or Okta client secret from an environment variable or from Secrets Manager, runs the client-credentials request itself, and caches the token in memory. On the broker, the token code shrinks to one call. This is the shape of the Python example in AWS's getting-started guide, with a placeholder ARN:

broker = boto3.client("credential-broker")
token = broker.get_oauth_token(
credentialProviderArn=PROVIDER_ARN,
scopes=["reports.read"],
)["accessToken"]
requests.get(API_URL, headers={"Authorization": f"Bearer {token}"})

Repeat that call whenever you need a token. The broker returns its cached copy for up to an hour, or until the token expires if that is sooner, then fetches a new one. Your own refresh logic and token cache can go.

The policy line that decides whether you gained anything

Here is the part that is easy to get wrong. The broker reads the client secret from Secrets Manager using your agent's own identity, through a forward access session. So the agent's role still needs secretsmanager:GetSecretValue on that secret. AWS's security page says to grant it only with an aws:CalledVia condition for credentialbroker.amazonaws.com. Without the condition, the agent can still read the long-lived secret directly with a plain SDK call, and you have added a broker without removing the exposure.

Other things that change:

  • Two IAM grants, not one. credentialbroker:GetOAuthToken on the provider ARN, plus the conditioned Secrets Manager read. User flows add StartOAuthSession, CompleteOAuthSessionBinding and GetCredentialProvider.
  • Managed secrets are named for you. When the broker creates the secret, it is called credentialbroker! plus the provider ID, and deleting the provider deletes it. Bring your own secret instead if you need your existing rotation and tags.
  • CloudTrail gets a new event source. Each GetOAuthToken call is logged under credentialbroker.amazonaws.com with the calling role, which is a cleaner audit trail than a secret read followed by an unlogged token request.

Where user-delegated flows get harder

Machine-to-machine is the easy case. Acting for a user is where the broker's design shows its constraints. For the authorization code and token exchange grants, your application must call the broker with a per-user IAM session that carries that user's identity, created through IAM federation (AssumeRoleWithWebIdentity or AssumeRoleWithSAML) or through IAM Identity Center trusted identity propagation. A shared app role does not work. The docs also tell you not to cache tokens across users in your own code.

That ties the broker to identity work many agent teams have not done. AWS widened trusted identity propagation to IAM federation the same day, which helps teams whose users sign in through Okta, Entra ID or Ping. If your users sign in to your agent with an app-specific login that never reaches IAM, budget time for that before the user flows.

The preview documentation lists these limits:

  • No DPoP. The setup guide tells Okta users to switch off the DPoP requirement, because the broker does not support it yet. If your security team mandates proof-of-possession tokens, stay where you are.
  • No hosted consent page. Your app sends the user to the authorization URL and must host a session-binding handler; AWS allows up to 10 binding URLs per provider.
  • Headless callers stop at consent. A token-exchange call with no subject token fails with SUBJECT_TOKEN_MISSING. A background job that never meets a user needs an Identity Center subject source or the client-credentials grant.
  • Token exchange vendors. Microsoft, Okta, Salesforce and custom OAuth 2.0 servers, per the token exchange page.

Who should move now, and who can wait

Teams with a handful of client-credentials integrations on Lambda or ECS get the clearest win: less token code, secrets that the agent cannot read directly, and per-call audit. That is a small change you can try on one integration in a non-production account.

Teams on AgentCore should not switch; AWS says so on the first page of the docs. Teams whose external service can trust an AWS-signed JWT should look at outbound federation first. Anyone who needs a price commitment, DPoP, or a GA service for production should wait, since the preview has no published GA pricing and the API is marked as subject to change. One cost detail to check yourself: managed secrets are ordinary Secrets Manager secrets in your account, and AWS's announcement only says the broker itself costs nothing during the preview.

If you are still choosing where the agent runs at all, our guide to deploying an agent on AWS covers the Lambda, ECS and Fargate side. For the code-level habits that keep keys out of agent sessions, see how to stop AI coding agents leaking secrets.

A short trial plan

  1. Pick one machine-to-machine integration whose secret sits in an environment variable today.
  2. Create the pool and one provider in a sandbox account; keep the default AWS owned key unless policy requires your own KMS key.
  3. Grant the agent role credentialbroker:GetOAuthToken on that provider ARN and the Secrets Manager read with the aws:CalledVia condition.
  4. Replace the token code with get_oauth_token, then remove the environment variable and confirm a direct GetSecretValue from the agent is denied.
  5. Check CloudTrail for GetOAuthToken events from the right role before you touch a second integration.

Our take

Credential Broker is a sensible default for one specific job: agents on Lambda, ECS, EKS or EC2 that call OAuth services as themselves. For that job, start a sandbox trial this week, and write the aws:CalledVia condition in on day one, because that line is what takes the secret away from the agent. Hold off on user-delegated flows until your users' identity reaches IAM, and keep production integrations where they are until AWS publishes GA pricing. If the target service can trust an AWS-signed JWT, skip the broker and store nothing.

Sources

Tools covered in this article

Share

Related on Metarix