

# Agent and workload identity (Preview)

**Preview release**  
Agent and workload identity is in preview release for AWS Identity and Access Management (IAM) and is subject to change.

With agent and workload identity, AWS Identity and Access Management (IAM) acts as an identity provider for your AI agents and workloads. A workload is software that takes actions and accesses data for you, such as a container, a microservice, a pipeline, or an AI agent. Each one gets a verifiable identity: a name that you choose, in a name space that you own. No password or API key backs it. AWS issues it only after the service that runs the workload attests where it runs, which version of it runs, and which instance or session it is.

The identity adds to an IAM role session. It doesn't replace the role. The role defines what the workload can do, and the identity says which workload is using the role. Outside AWS, the workload presents the same identity as a JSON Web Token (JWT) or an X.509 certificate. Any service that supports the Secure Production Identity Framework for Everyone (SPIFFE) or OpenID Connect (OIDC) can verify it without AWS credentials.

With an identity for each agent and workload, you can:
+ Attribute actions to a specific agent. AWS CloudTrail records the agent and workload identity when the role session is created, so you can trace each call that the session makes, even when many agents share one role.
+ Scope access to a named agent. Resource-based policies and the policies on the agent's role can allow or deny access by the agent's identity, not only by the role.
+ Grant access before an agent exists. Data owners can grant access to an agent before you deploy it. This works when the identifier comes from facts known before the workload runs, such as its cluster, namespace, and service account. If the identifier ends with a value known only at runtime, such as a session ID, grant access to the part before it with a trailing wildcard.
+ Authenticate outside AWS without long-lived secrets. An agent can present its identity as a short-lived JSON Web Token (JWT) or X.509 certificate to a service mesh, your own APIs, or a third-party service. Both follow the Secure Production Identity Framework for Everyone (SPIFFE) standard.
+ Manage names centrally. One organization-level provider gives every account the same naming structure.
+ Choose how fine-grained. An identity can cover a service account, an agent runtime, or a single runtime session.

**Topics**
+ [How agent and workload identity works](#how-agent-and-workload-identity-works)
+ [Terminology](#awi-terminology)
+ [Credentials that a workload receives](#awi-credentials)
+ [Agent and workload identity, IAM roles, and trusted identity propagation](#awi-roles-and-tip)
+ [Supported compute](#awi-supported-compute)
+ [Availability](#awi-availability)
+ [Pricing](#awi-pricing)
+ [Getting started with agent and workload identity](workload-identity-getting-started.md)
+ [Manage workload identity providers](workload-identity-manage-providers.md)
+ [Define agent and workload identities](workload-identity-define.md)
+ [Use agent and workload identity with AWS services](workload-identity-use-aws-services.md)
+ [Control access with agent and workload identity](workload-identity-control-access.md)
+ [Authenticate to services outside AWS](workload-identity-authenticate-external.md)
+ [Logging and monitoring agent and workload identity](workload-identity-logging-monitoring.md)

## How agent and workload identity works
<a name="how-agent-and-workload-identity-works"></a>

The following diagram shows how an agent or workload receives its identity and what it can use the identity for.

![Agents and workloads, such as agents and pods, are verified at runtime. Each one receives a single agent and workload identity generated by a template. The identity gives fine-grained access to AWS resources, for example through IAM policies and CloudTrail, and signed JWT and X.509 credentials for service meshes and apps outside AWS.](https://docs.aws.amazon.com/IAM/latest/UserGuide/images/wi_how_it_works_light.png)


You set up a provider and templates once, ahead of time. After that, AWS Security Token Service (AWS STS) adds the identity to the workload's role session each time the workload starts. The workload requests JSON Web Token SPIFFE Verifiable Identity Documents (JWT-SVIDs) and X.509 SPIFFE Verifiable Identity Documents (X.509-SVIDs) when it needs them. On Amazon Elastic Kubernetes Service (Amazon EKS), the Pod Identity Agent requests them for you. On AgentCore runtime, your agent calls AWS STS from its own code. AgentCore Gateway calls AWS STS with the execution role that you provide.

### Setup (you do this once)
<a name="awi-setup"></a>

1. Create a workload identity provider. The provider is the issuer for all of your agent and workload identities. It sets the naming scheme and the trust domain, for example `corp.example.com`. You can create it in one account or for your whole organization.

1. Create a template. A template builds a name for each workload from facts about it. Its attestation policy says which AWS service can vouch for the workload and which facts it must present. Start from a template definition, which writes both for you.

1. Write an attestation policy. The attestation policy says which AWS service can vouch for the workload, and which facts about the workload it must present. Without an attestation policy, no agent and workload identity is issued.

1. Use the workload's existing IAM role. The role's trust policy doesn't change. AWS STS adds the identity to the session of the role that the service already assumes. To control which workloads can reach a resource, name the identity in the resource's policy.

1. Point your compute resource at the template. For example, set the template on an Amazon EKS Pod Identity association, as shown in [Getting started with agent and workload identity](workload-identity-getting-started.md). Or select it when you create an AgentCore runtime, a capability of Amazon Bedrock AgentCore, or an AgentCore Gateway, a capability of Amazon Bedrock AgentCore. For more information, see Amazon Bedrock AgentCore.

### At runtime (AWS does this each time the workload needs a new role session)
<a name="awi-at-runtime"></a>

1. The AWS service that runs the workload collects facts about it: where it runs, which version of it runs, and which instance or session it is. This is called attestation. The facts depend on the service, as shown in the table after these steps.

1. The service sends those facts to AWS STS with the template reference.

1. AWS STS evaluates the facts against the attestation policy. If they match, it builds the workload's name and returns a signed context for one IAM role.

1. The service calls AssumeRole with that context. The resulting role session carries the role's permissions and the agent and workload identity.

1. The workload calls AWS services with that session as usual. Policies and CloudTrail see the agent or workload identity.

1. When the workload needs to authenticate outside AWS, it requests a JWT-SVID or an X.509-SVID for the same identity.


| Service | Facts it reports | 
| --- | --- | 
| Amazon EKS | Cluster name and ARN, namespace, service account, pod name and UID, and node name | 
| AgentCore runtime | Runtime name, ID, version, and session ID | 
| AgentCore Gateway | Gateway name and ID | 

For the condition keys for each fact, see [Write attestation policies](workload-identity-attestation-policies.md).

Your application doesn't attest itself or attach its identity to a role. The service that runs the workload, or the EKS Pod Identity Agent, does that and renews credentials for you. To use credentials that carry the identity, your application uses the method that its compute service provides. On Amazon EKS, the standard EKS Pod Identity credentials carry the identity, so the AWS SDKs use them with no change to your code. On AgentCore runtime, agents get these credentials through the AgentCore SDK, and request JWT-SVIDs and X.509-SVIDs from AWS STS directly. AgentCore Gateway gets JWT-SVIDs only.

## Terminology
<a name="awi-terminology"></a>

Workload identity provider  
The issuer and trust boundary for agent and workload identities. A provider has a scheme, SPIFFE or NONE. A SPIFFE provider also has a trust domain, such as `corp.example.com`. You create a provider at account scope or organization scope. Its ARN is `arn:aws:iam::111122223333:workload-identity-provider/name` for an account, or `arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/name` for an organization.

Scheme  
The naming style of the provider. SPIFFE produces identifiers that start with `spiffe://` and a domain. NONE produces identifiers with no marker and no domain, and its workloads receive only AWS role sessions, not JWT-SVIDs or X.509-SVIDs. You choose the scheme when you create the provider and can't change it.

Trust domain  
The naming root of every identifier under a SPIFFE provider, such as `corp.example.com`.

Path prefix  
The part of the name space that a template sits in, such as `retail/payments`. In an organization, the provider's resource policy assigns path prefixes to member accounts.

Workload identity template  
A rule that builds a name for every workload in a group, such as every pod in a cluster, from attested facts. Templates are the only way to name agents and workloads.

Template definition  
An AWS-owned, read-only shape for a template, published by an AWS service. You create a template from a definition by giving its ARN and a few values, without writing a path pattern or a policy.

Attestation  
The process in which the platform that runs a workload, not the workload itself, reports facts about it to AWS STS. The facts describe where the workload runs, which version of it runs, and which instance or session it is.

Attestation policy  
The policy on a template that decides which service can attest for it and which facts must match. AWS STS evaluates it every time a workload starts.

Outbound signer  
The keys that sign credentials that a workload presents outside AWS. Each SPIFFE provider has two IAM-managed JWT signing keys. For X.509 certificates, you attach your own AWS Private Certificate Authority (AWS Private CA).

Trust bundle  
The public keys and certificates that a relying party uses to verify credentials issued under your provider.

## Credentials that a workload receives
<a name="awi-credentials"></a>

A workload with an identity can hold three kinds of credentials. All are short-lived and renewed automatically.


| Credential | Use it for | Verified by | 
| --- | --- | --- | 
| IAM role session (AWS Signature Version 4) | Calls to AWS services | AWS. Policies match the identity with the condition keys `aws:OriginIdentity/Subject` and `aws:OriginIdentity/Issuer`. | 
| JWT-SVID | Bearer-token calls to APIs and third-party services | The relying party, using your provider's JSON Web Key Set (JWKS) | 
| X.509-SVID | Mutual TLS (mTLS) in a service mesh or between services | The peer, using your provider's trust bundle | 

Credentials change and the name does not. AWS issues new credentials on each refresh, and each one carries the same identifier for as long as the template and the facts its path uses stay the same. Write your policies against the identifier, not against a credential.

## Agent and workload identity, IAM roles, and trusted identity propagation
<a name="awi-roles-and-tip"></a>
+ IAM roles define permissions. A role says what a caller can do, not who the caller is. Several workloads can share a role, and one workload can use several roles.
+ Agent and workload identity names each agent and workload. The identity is added to the role session. The role still governs permissions, and the identity governs attribution and fine-grained access.
+ Trusted identity propagation carries the identity of a person or workload that federates through an external identity provider. It's a separate feature, but agent and workload identity sessions use the same `aws:OriginIdentity` condition keys and the same rules for carrying the identity to other role sessions. A role session carries one or the other, not both. For more information, see Trusted identity propagation with IAM.

You don't need to change existing workloads. A compute resource with no agent and workload identity association continues to assume roles exactly as it does today.

## Supported compute
<a name="awi-supported-compute"></a>

At preview, the following AWS services can attest workloads and deliver agent and workload identities:


| Service | How it attests | What you set up | 
| --- | --- | --- | 
| Amazon EKS | The EKS control plane reports the cluster name and ARN, namespace, service account, pod name and UID, and node name. The EKS Pod Identity Agent delivers credentials. | The EKS Pod Identity Agent add-on, version v1.5.0-eksbuild.3 or later | 
| AgentCore runtime, a capability of Amazon Bedrock AgentCore | The AgentCore control plane reports the runtime name, ID, version, and session ID. | Nothing to install. Turn on agent and workload identity when you create the runtime. | 
| AgentCore Gateway, a capability of Amazon Bedrock AgentCore | The AgentCore control plane reports the gateway ID and name. | Nothing to install. Turn on agent and workload identity when you create the gateway. | 

For the facts that each service reports, and the condition keys that match them, see [Attestation keys and tiers](workload-identity-attestation-policies.md#attestation-keys-and-tiers).

## Availability
<a name="awi-availability"></a>

During the preview, IAM agent and workload identity is available in all commercial AWS Regions. You can use it with Amazon EKS and AgentCore in the Regions where those services are available.

## Pricing
<a name="awi-pricing"></a>

Identities for agents and workloads are offered at no additional charge during the preview. If you attach an AWS Private CA to issue X.509-SVIDs, AWS Private CA charges for the certificate authority and the certificates it issues apply to your account. For more information, see AWS Private CA pricing.