# AWS IAM Credential Broker keeps OAuth secrets out of agents

- Canonical: https://www.baristalabs.io/blog/aws-iam-credential-broker-agent-oauth
- Published: 2026-11-30
- Author: Sean McLellan
- Excerpt: 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.

AI Development

Sean McLellan

Lead Architect & Founder

November 30, 2026 7 min read

Constructed diagram Illustration: 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker.html) 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](https://aws.amazon.com/about-aws/whats-new/2026/11/aws-iam-credential-broker-preview/) 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.

| Option | Use it when | What your agent handles |
|---|---|---|
| Outbound identity federation | The outside service accepts a JSON Web Token issued by AWS | An 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 key | A short-lived access token or a centrally stored API key |
| AgentCore Identity | The agent is built on Amazon Bedrock AgentCore | AgentCore'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](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_outbound_getting_started.html) 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.](https://www.baristalabs.io/blog/inline/aws-iam-credential-broker-agent-oauth.jpg)

Constructed diagram Constructed 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](https://www.baristalabs.io/blog/aws-nitro-sandboxes-eks-isolated-confidential-pods) 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker.html) lines them up:

Scroll sideways to see all 4 columns.

| Flow | Data it reaches | User interaction | Typical job |
|---|---|---|---|
| Client credentials (machine to machine) | Data owned by the application or organization | None; there is no end user | Background, scheduled or batch work |
| Authorization code | One user's data, with that user's consent | The user approves once in a browser | Interactive apps acting for a user |
| Token exchange | One user's data, for a user already signed in | No new consent prompt | Internal 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker-obo.html) 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker-3lo.html) 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](https://www.baristalabs.io/blog/step-functions-agent-tools-iam-scope) 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.

## Recommended first step: one integration, one role

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](https://www.baristalabs.io/blog/vscode-agent-shell-password-prompts) covers keeping interactive secrets away from a coding agent.

## Sources and scope

- [AWS What's New: AWS announces the public preview of AWS IAM Credential Broker](https://aws.amazon.com/about-aws/whats-new/2026/11/aws-iam-credential-broker-preview/), November 29, 2026
- [IAM User Guide: AWS IAM Credential Broker](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker.html) (prerelease), read November 30, 2026
- [IAM User Guide: Obtain a token on behalf of a user with the authorization code grant](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker-3lo.html) (prerelease), read November 30, 2026
- [IAM User Guide: Obtain a token with the token exchange grant](https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-broker-obo.html) (prerelease), read November 30, 2026
- [IAM User Guide: Getting started with outbound identity federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_outbound_getting_started.html), read November 30, 2026

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](https://www.baristalabs.io/services/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.

[Plan my agent credential setup](https://www.baristalabs.io/contact?service=ai-consulting&placement=end&source=blog&slug=aws-iam-credential-broker-agent-oauth) [Explore AI consulting](https://www.baristalabs.io/services/ai-consulting)

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](https://www.baristalabs.io/assessment)

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.

Email address

Send me the notes

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.

Article-specific next step

Plan my agent credential setup

[Plan my agent credential setup](https://www.baristalabs.io/contact?service=ai-consulting&placement=sidebar&source=blog&slug=aws-iam-credential-broker-agent-oauth)

![Sean McLellan profile photo](https://www.baristalabs.io/profile-sean-mclellan.jpg)

## Sean McLellan

Lead Architect & Founder

Sean McLellan is the founder and lead architect at BaristaLabs. He brings more than two decades of software architecture experience to BaristaLabs products and client work for small teams. Client work starts with an assessment of one workflow. Fixed-scope discovery then defines a bounded pilot, explicit human-review boundaries, and the source-traceable proof needed for the next decision.

[More articles by Sean McLellan](https://www.baristalabs.io/authors/sean-mclellan)

[Twitter](https://twitter.com/seanmclellan) [GitHub](https://github.com/seanmclellan)
