Skip to main content
AI Development

AWS IAM Credential Broker keeps OAuth secrets out of agents

AWS IAM Credential Broker, in preview since Nov 29, gives agents on Lambda, ECS, EKS or EC2 short-lived OAuth tokens so client secrets stay out of their code.

Sean McLellan profile photo

Sean McLellan

Lead Architect & Founder

7 min read
Flat illustration on a dark navy background: a small hourglass at far left, an open-top teal tool tray with a carry handle, an ivory dish holding one copper token, and a closed steel-blue safe with a round dial on the right, with a dashed copper arc tracing the token's path from the dish into the tool tray
Constructed diagramIllustration: the safe stays shut while one short-lived token goes to the tool tray. Not product UI.

AWS released AWS IAM Credential Broker in public preview on November 29, 2026. It gets OAuth access tokens and API keys for agents and workloads on AWS that call services outside AWS, such as Salesforce, Snowflake or Databricks. For OAuth, the agent's code receives a short-lived token instead of holding a client secret. For a team wiring agents into SaaS tools, it changes which AWS option should handle those outside credentials.

The catch is scope. AWS's own documentation sends agents built on Amazon Bedrock AgentCore back to AgentCore Identity, and sends services that accept an AWS-issued token to outbound identity federation. Credential Broker covers the case in between: code on Lambda, ECS, EKS or EC2 that calls an OAuth or API-key service. It is a preview with prerelease documentation, at no additional cost during the preview.

What is AWS IAM Credential Broker?

Credential Broker is an IAM feature that fetches, caches and refreshes credentials for outside services, so your agent doesn't run the OAuth flow itself. The IAM User Guide says it "obtains, refreshes, and vaults the credentials that an agent or workload on AWS needs to call systems outside AWS," including OAuth access tokens, data-platform tokens and static API keys.

It does not mint tokens. The same page says "Your identity provider, the external authorization server, or the SaaS platform issues every token." Credential Broker obtains them on your behalf, caches them and hands them back.

The mechanics, according to the documentation:

  • Setup: you create a credential provider pool and, inside it, a credential provider for one outside service. A provider holds one type of credential, OAuth token or API key, and the type is fixed when you create it.
  • Secrets: Credential Broker keeps client secrets and API keys in AWS Secrets Manager, not in your agent's code or environment.
  • Runtime: the agent calls GetOAuthToken or GetApiKey, signed with SigV4 under its own IAM role. The caller needs IAM permission for the matching credentialbroker: action on that provider's ARN.
  • Caching: tokens are cached "for up to one hour, or until it expires if sooner," and encrypted at rest with an AWS owned key by default or a customer managed key you choose.

The AWS announcement says it works with identity providers such as Okta, Microsoft Entra ID and Auth0, offers provider templates that "account for each vendor's OAuth requirements," and is in preview "in all commercial AWS Regions."

Credential Broker vs AgentCore Identity vs outbound federation

AWS now offers three ways for an agent to get a credential for something outside AWS, and its documentation says which one to use. The deciding questions are what the outside service accepts and where the agent runs.

Scroll sideways to see all 3 columns.

OptionUse it whenWhat your agent handles
Outbound identity federationThe outside service accepts a JSON Web Token issued by AWSAn AWS-issued JWT from GetWebIdentityToken; no client secret to store
IAM Credential Broker (preview)Code on Lambda, ECS, EKS or EC2 calls a service that needs OAuth tokens or an API keyA short-lived access token or a centrally stored API key
AgentCore IdentityThe agent is built on Amazon Bedrock AgentCoreAgentCore's own credential providers and token vault

The IAM guide is direct about the first and third rows. If the external service "can accept a JSON Web Token (JWT) issued by AWS, use IAM outbound identity federation instead," because then "AWS issues the token and there's no client secret to store." And for AgentCore: "Keep using AgentCore Identity, including its credential providers and token vault." Outbound federation has its own setup: the getting-started guide says you must enable it for the account first, and GetWebIdentityToken isn't available on the STS global endpoint.

Constructed decision diagram with three columns. Outbound identity federation: use when the outside service accepts a JWT issued by AWS; AWS issues the token; no client secret to store. IAM Credential Broker (preview): use when Lambda, ECS, EKS or EC2 calls an OAuth or API-key service; three flows, for the app (client credentials), user consent once (authorization code) and a signed-in user (token exchange); secrets stay in Secrets Manager and the agent gets a short-lived token. AgentCore Identity: use when the agent runs on Amazon Bedrock AgentCore; AWS says keep using it there; credential providers and token vault.
Constructed diagramConstructed from the AWS announcement and IAM User Guide prerelease docs, November 2026. Not product UI.

If your agents run in pods, the isolation question is separate from the credential question; the BaristaLabs post on AWS Nitro Sandboxes on EKS covers that choice.

Which OAuth flow does your agent need?

Pick the flow by whose data the agent touches. Credential Broker supports three, and the IAM guide's comparison table lines them up:

Scroll sideways to see all 4 columns.

FlowData it reachesUser interactionTypical job
Client credentials (machine to machine)Data owned by the application or organizationNone; there is no end userBackground, scheduled or batch work
Authorization codeOne user's data, with that user's consentThe user approves once in a browserInteractive apps acting for a user
Token exchangeOne user's data, for a user already signed inNo new consent promptInternal apps where the user's identity is already established

With client credentials, permissions are fixed at the application level. With the two user flows, the token represents the person. The token exchange page lists Microsoft, Okta, Salesforce and custom OAuth 2.0 authorization servers as supported vendors, and notes that for Microsoft Entra ID the broker uses the JWT bearer grant instead of RFC 8693 token exchange.

How Credential Broker keeps one user's token away from another

For the user flows, the agent must call the broker as that user, not as itself. The authorization code guide says your application "must call the broker with a per-user session that carries the end user's identity, not with the application's own role session." You build that session with IAM federation (AssumeRoleWithWebIdentity or AssumeRoleWithSAML) or with IAM Identity Center and trusted identity propagation. The same guide says not to share one session across users or cache tokens across users in your application.

Three details matter for the authorization code flow:

  • No consent page is provided. "There is no broker-hosted consent portal in this release," so your application sends the user to the authorization URL and handles the return.
  • Session binding. Credential Broker exchanges the authorization code only when the user who finishes consent is the user who started it. It redirects only to session binding URLs you allow on the provider, up to 10.
  • Your code never sees the authorization code or long-lived secrets. The guide says your application "never receives the authorization code, the client secret, or the refresh token."

The announcement describes the result: "When an agent acts for a user, it uses only that user's access," so the external system can enforce and audit that user's own permissions.

Why it matters for teams connecting agents to SaaS

BaristaLabs' interpretation: the main gain is fewer places a long-lived secret can leak. An agent that keeps a Salesforce client secret in an environment variable exposes it to anything that can read that environment, including the agent's own tool calls. With Credential Broker, the agent holds an IAM role and a short-lived token that the broker caches for an hour at most, and the client secret stays in Secrets Manager behind an IAM permission you can scope to one provider.

The second gain is review. A credential audit becomes a list of providers in a pool and the roles allowed to call each one, instead of a search through every function's configuration. The BaristaLabs post on Step Functions agent tools makes a related point about scoping IAM to what an agent can actually run.

The limit is the preview itself. The documentation is labeled prerelease and "subject to change," and the sources don't say what Secrets Manager or KMS charges apply, when it reaches general availability, or what it will cost then.

BaristaLabs recommends a small pilot before any production move:

  1. Check outbound federation first. If the outside service accepts an AWS-issued JWT, use that and skip storing a secret at all.
  2. Leave AgentCore agents where they are. AWS says to keep using AgentCore Identity for them.
  3. Pick one non-production job on Lambda or ECS that uses a client-credentials secret today. Create one pool and one provider from the vendor's template, and grant only that job's role permission on that provider's ARN.
  4. Delete the secret from the job's environment once the job gets tokens from GetOAuthToken, and confirm it still runs after the cached token expires.
  5. Hold user-delegated flows until you have a per-user session design you can test, because sharing one session across users is exactly what the guide warns against.

The same discipline applies on developer machines: the BaristaLabs post on VS Code's in-chat password prompts covers keeping interactive secrets away from a coding agent.

Sources and scope

These sources describe the preview as AWS documents it. They don't cover general-availability timing, pricing after the preview, or service quotas, and BaristaLabs did not run Credential Broker for this post. For help deciding how your agents should reach outside systems, see AI consulting.

Agent credentials on AWS

Map how each agent reaches outside systems

Bring a list of the SaaS tools and APIs your agents call and where each agent runs. BaristaLabs can help sort them into outbound federation, Credential Broker or AgentCore Identity, and scope the first pilot.

A list of the services your agents call is enough to start.

Turn this idea into a pilot

Which workflow should go first?

Use the readiness check to compare impact, effort, risk, owner, and next step before requesting a review.

  • 3-5 minutes
  • Deterministic score
  • No sensitive data
Check workflow readiness

Practical AI Workflow Notes

Enjoyed this? Get our plain-English workflow notes.

We send occasional short notes on putting AI to work in everyday operations, from taming messy documents and customer follow-ups to simple reporting and safety guardrails.

A relaxed way to stay in touch if you're still exploring and aren't ready to chat yet.

Occasional emails with practical ideas only. Unsubscribe anytime.