CloudSecurity

AWS IAM now gives each AI agent and workload its own identity (preview)


This week we introduced a capability to provide each workload, including each AI agent, a unique identity in AWS Identity and Access Management (IAM) with IAM agent and workload identity. You manage these identities centrally across your organization, and AWS Security Token Service (AWS STS) checks facts about each workload before it issues short-lived credentials. For AWS services, IAM adds the identity to the workload’s IAM role session. For non-AWS services, the workload presents short-lived credentials as a JSON Web Token (JWT) or an X.509 certificate. The preview supports workloads and agents on Amazon Elastic Kubernetes Service (Amazon EKS), Amazon Bedrock AgentCore Runtime, and Amazon Bedrock AgentCore Gateway.

With agent and workload identity, you can:

  • Replace long-lived secrets with an identity – Use an identity that’s based on what the workload is rather than one that was created, assigned, and delivered to it.
  • Manage workload identities across your organization – One provider gives your organization a single naming root, such as spiffe://corp.example.com. You decide which accounts can create identities under each part of it, for example spiffe://corp.example.com/payments/, through templates.
  • Control access based on workload and agent identity – Resource-based policies, resource control policies (RCPs), and other IAM policy types can restrict access by workload identifier.
  • Trace activity to a workload – AWS CloudTrail records the workload’s unique identifier alongside the role.

In this post, you learn how agent and workload identity works and walk through three common agent and workload identity architecture examples.

Key components

Agent and workload identity can be viewed in three parts, as shown in Figure 1:

  • A provider that acts as the root of trust
  • Workload identity templates that define how each workload’s identifier is built and which workloads qualify for one
  • The credentials that each workload receives

Figure 1: AWS IAM agent and workload identity overview

  1. A workload or agent starts on Amazon EKS, Amazon Bedrock AgentCore runtime, or AgentCore Gateway, and the service sends its attestation facts to AWS STS.
  2. AWS STS verifies the facts against the workload identity template in your provider. The template builds the workload identifier, for example spiffe://corp.example.com/{PathPrefix}/{PathPattern}.
  3. AWS STS returns a role session for calling AWS services. CloudTrail records the workload identifier in onBehalfOf.subject.
  4. For SaaS applications and peer services, the workload presents a JWT-SVID, signed by AWS STS, or an X.509-SVID, signed by your AWS Private Certificate Authority (AWS Private CA). IAM places the workload identifier in the IAM role session, in the URI subject alternative name (SAN) of the X.509 certificate, and in the sub claim of the JWT.

The provider

The agent and workload identity provider is the top-level resource for your workload identities. You create it in IAM and configure:

  • A trust domain, such as corp.example.com, that begins every identity name.
  • A scheme that sets the identity format. The preview supports the Secure Production Identity Framework for Everyone (SPIFFE), so AWS issues JWTs and X.509 certificates as corresponding SPIFFE Verifiable Identity Documents (SVIDs).
  • Path prefixes that help you organize your identities by assigning accounts or teams to their own part of the identity namespace.
  • JWT signing keys for each provider, created by IAM. To issue X.509-SVIDs, you attach your own AWS Private CA.

AWS STS publishes the provider’s OpenID Connect (OIDC) discovery document, public JWT signing keys, and SPIFFE trust bundle. These let a service outside AWS verify a workload’s credentials without AWS credentials of its own.

Templates

A workload identity template is where you decide how the workload identifiers are built and which workloads get an identity. You write a path pattern that builds each workload identifier from values such as the account, AWS Region, cluster, namespace, and service account. You also set the facts a workload must match to qualify, such as the cluster or namespace it runs in.

You can start with the template definition for your service, which fills in a recommended path pattern. AWS fills in each value in curly braces from the account or the running workload:

  • Amazon EKS: spiffe://corp.example.com/{AccountId}/{aws:RequestedRegion}/eks/{ClusterName}/ns/{Namespace}/sa/{ServiceAccount}
  • Amazon Bedrock AgentCore Runtime: spiffe://corp.example.com/{AccountId}/{aws:RequestedRegion}/agentcore-runtime/{AgentRuntimeName}
  • Amazon Bedrock AgentCore Gateway: spiffe://corp.example.com/{AccountId}/{aws:RequestedRegion}/agentcore-gateway/{GatewayName}

With an organization-level provider, the pattern puts the account ID in the path prefix, so each account has its own namespace. To change the names, write your own path pattern, for example, to drop the Region so a workload keeps one name across Regions, or to add a segment such as an environment name.

For example, a payments AI agent on Amazon EKS in account 111122223333 receives the workload identifier spiffe://corp.example.com/111122223333/us-west-2/eks/payments-cluster/ns/payments/sa/payments-agent.

Attestation policy

Attestation is how AWS checks what a workload is before issuing its identity. You attach an attestation policy to each workload identity template. The policy is a resource-based policy that names the attesting service, such as Amazon EKS, and the facts that the service must report. When a workload starts, Amazon EKS supplies facts that the pod can’t change, and AWS STS evaluates them against the template’s attestation policy. If the facts don’t match, the pod doesn’t get a workload identity. AgentCore Runtime and AgentCore Gateway supply these facts from their own control plane, with no additional configuration.

You don’t have to write an attestation policy to get started. When you create a workload identity template, IAM applies a default attestation policy for each service. You can also write your own attestation policy when the definition admits more workloads than you intend, for example to limit identities to one cluster, to production namespaces, or to one AgentCore Runtime. For more information, see attestation policies.

Organizational resources

Workload identity resources can belong to your organization instead of one account. An organization-level provider, workload identity template, or agent and workload identity carries your organization ID in its Amazon Resource Name (ARN) where the account ID would be. Only the management account or an IAM delegated administrator can create, change, or delete it.

IAM reflects the resource into each member account as a read-only copy, so an update at the organization level reaches the accounts without a sync job. Authorization stays in the account. The principal’s identity policies, service control policies (SCPs), and RCPs still apply, so an organization-level resource grants no new permissions. To learn more, see Create a workload identity provider.

Credentials

AWS attests each agent or workload, which then receives an IAM role session that carries its workload identifier. The AWS SDKs pick up these credentials through the default credential provider chain, so existing AWS SDK code doesn’t change. For external services, the workload gets JWT-SVIDs and X.509-SVIDs that it can present to compatible downstream APIs or services.

JWT-SVIDX.509-SVIDIAM role session
Where the workload identifier goesThe sub claimThe URI subject alternative name (SAN), marked criticalThe session context. CloudTrail shows it as onBehalfOf.subject, and IAM policies match it with the aws:OriginIdentity/Subject condition key
When to use itServices that accept JWT authenticationMutual TLS (mTLS) connectionsCalls to AWS services
How services verify itThe provider’s OIDC Discovery DocumentProvider’s trust bundleAWS verifies the request’s Signature Version 4 (SigV4) signature
LifetimeUp to one hour12 hours by default, configurable for 1–12 hoursThe attesting service can cap it from 15 minutes to 12 hours

Architecture examples

The following examples follow one payments AI agent. It reads payment records from Amazon Simple Storage Service (Amazon S3), signs in to a software as a service (SaaS) API with a JWT-SVID, and connects to an internal ledger service over mTLS.

1. Read payment records from Amazon S3

The first example shows how the payments AI agent connects to AWS services. The bucket policy allows access only for the AI agent’s workload identity.

Figure 2: An AI agent on Amazon EKS calls Amazon S3 with its workload identity

Figure 2: An AI agent on Amazon EKS calls Amazon S3 with its workload identity

As shown in Figure 2:

  1. When the agent’s pod starts, the AWS service sends attestation details of the workload to AWS STS.
  2. AWS STS checks the attested facts against the template rules in the IAM agent and workload identity provider.
  3. AWS STS returns a role session that carries the agent’s workload identity.
  4. The AI agent calls Amazon S3. The bucket policy matches the aws:OriginIdentity/Subject and aws:OriginIdentity/Issuer condition keys together, and allows the request.

Match the subject and the issuer together, because an identifier is unique only within its provider. Amazon S3 Block Public Access treats a policy that uses the subject alone as public, so also include aws:OriginIdentity/Issuer. The following example bucket policy allows only the payments agent to read objects:

2. Connect to a third-party SaaS API

In this example, an AI agent calls a third-party software as a service (SaaS) API. The agent uses its JWT-SVID in place of a client secret.

Figure 3: An AI agent exchanges its JWT-SVID for a SaaS access token

Figure 3: An AI agent exchanges its JWT-SVID for a SaaS access token

As shown in figure 3:

  1. Using its role session, the AI agent requests a JWT-SVID from AWS STS, with the SaaS provider as the audience.
  2. AWS STS returns the JWT-SVID.
  3. The AI agent sends the JWT-SVID to the SaaS token endpoint in place of a client secret.
  4. The SaaS provider verifies the JWT-SVID with the workload identity provider’s published keys and checks the iss, aud, and sub claims against its federation policy.
  5. The SaaS token endpoint returns a short-lived access token. When it expires, the agent repeats the exchange.
  6. The AI agent calls the SaaS API with the SaaS access token.

Note: The request format depends on the SaaS provider. Common choices are OAuth 2.0 token exchange (RFC 8693), where the JWT-SVID is the subject token, and the JWT bearer grant (RFC 7523), where the JWT-SVID is the assertion.

3. Connect to a service using certificates

In this example, workloads call an on-premises service without stored secrets.

Figure 4: Workloads authenticate to services outside AWS with an X.509-SVID

Figure 4: Workloads authenticate to services outside AWS with an X.509-SVID

As shown in Figure 4:

  1. Each workload asks AWS STS for an X.509-SVID with its role session.
  2. For the X.509-SVID, AWS STS calls the AWS Private CA IssueCertificate API on your private certificate authority (CA) with the workload’s role session, so the role needs permission to issue certificates from that CA.
  3. The workload connects to the on-premises service over mutual TLS with its X.509-SVID.
  4. The service verifies the credential with the provider’s trust bundle.

Now available

IAM agent and workload Identity is available in preview at no additional charge in AWS commercial Regions.

Next steps

To try it, follow Getting started with agent and workload identity. You create a workload identity provider and an Amazon EKS workload identity template, turn on workload identity for an Amazon EKS Pod Identity association, and write an Amazon S3 bucket policy that allows only one workload. The pod then gets a JWT-SVID to call a service outside AWS and, optionally, an X.509-SVID for mutual TLS, and you find each call in CloudTrail. Then give a workload of your own an identity—such as an AI agent that calls an API with a stored secret—and present its JWT-SVID to the API in place of the secret.

If you have questions about this post, contact AWS Support or start a new thread on AWS re:Post.


Brendan Paul

Brendan is a Security Services SA Manager at AWS and has been at AWS for more than 7 years. He spends most of his time at work helping customers solve problems in the AI security and workload identity domains. Outside of work, he’s pursuing his master’s degree in data science from UC Berkeley.

Meg Peddada

Meg Peddada

Meg is a Senior FSI Security Solutions Architect specializing in security, risk, and compliance. Her expertise spans governance, security automations, threat management, and architecture. In her spare time, she loves playing volleyball, arts and crafts, and finding new brunch experiences.

Fei Yuan

Fei Yuan

Fei Yuan is a Principal Engineer at AWS. Fei has led different teams through various projects across Amazon and AWS, such as Amazon Lending Marketplace and Amazon Cognito. Most recently, he led the team that launched Amazon Bedrock AgentCore Identity service. Today he focuses on designing and implementing AWS products in the areas of agent identity, workload identity, and customer identity and access management.

Swara Gandhi

Swara is a Senior Solutions Architect on the AWS Identity Solutions team. She works on building secure and scalable end-to-end identity solutions. She is passionate about everything identity, security, and cloud.



Source link