View a markdown version of this page

Give agents and workloads in EKS a verifiable identity with IAM for agents - Amazon EKS

Help improve this page

To contribute to this user guide, choose the Edit this page on GitHub link that is located in the right pane of every page.

Give agents and workloads in EKS a verifiable identity with IAM for agents

Note

IAM for agents is in preview release for Amazon EKS and is subject to change. It is available in all commercial AWS Regions except Middle East (Bahrain) (me-south-1) and Middle East (UAE) (me-central-1).

Amazon EKS is a platform where customers run a diverse set of workloads, often as microservices in a widely distributed environment. These workloads rarely operate in isolation. They communicate with one another and integrate with other services, both within AWS and beyond the boundaries of AWS. Consider agents that communicate with each other or reach external Model Context Protocol (MCP) servers, or workloads running in a service mesh. For many businesses, the pace of innovation keeps pushing these environments toward greater distribution. As they expand in this way, it becomes increasingly important to preserve a security posture in which workloads remain identifiable as they interact with each other and with external components.

Giving each workload a verifiable identity allows teams to establish a domain of trust made up only of workloads that have first been proven based on a set of characteristics that can be verified. Once proven, a workload receives an identity along with an accompanying digital document (for example, an X.509 certificate or a JWT token) that carries that identity into its communications, whether with other workloads in the trust domain or with external components and systems that expect some form of identification before they process a request. Because the identity is granular and verifiable, and tied to a specific workload, the actions that workload takes can be attributed back to it, which strengthens a team’s security posture and supports auditability. These actions already surface in AWS CloudTrail today when workloads use EKS Pod Identity. With workload identity, the workload’s SPIFFE ID also appears, so what you see in CloudTrail is tied to the specific workload that acted.

The same identity strengthens authorization. Access control is most effective when it answers two questions together: who is making a request and what they are allowed to do. A policy on its own answers what can be accessed, but it is more effective when the who it applies to is a specific workload whose identity has been verified, rather than a coarser or less certain notion of the caller. Workload identity supplies that granular, verified who, so a policy can be written and enforced against a specific workload. Pairing the two, a proven identity and a policy scoped to it, gives a defense-in-depth model where access to a resource depends both on who the workload is and on what that identity is permitted to do.

This model is defined by an open standard called the Secure Production Identity Framework for Everyone (SPIFFE). SPIFFE establishes how a workload is given a verifiable identity and the form that identity takes. That form is known as a SPIFFE ID, and it is expressed as a string such as spiffe://<trust domain>/<workload path pattern>. The identity itself is this SPIFFE ID, and it is carried in a credential such as an X.509 certificate or a JWT token. SPIFFE and its reference implementation SPIRE are both graduated projects of the Cloud Native Computing Foundation (CNCF), a status that reflects their maturity and broad adoption across the industry.

IAM for agents is the AWS managed implementation of this model. It gives workloads a verifiable SPIFFE identity without requiring you to operate the underlying identity infrastructure yourself. AWS manages the control plane that issues identities, and your workloads receive their credentials through a mechanism they already have on the cluster.

On Amazon EKS, workload identity is delivered through the EKS Pod Identity agent. EKS attests each workload against the facts the cluster can prove about it, and the Pod Identity agent then delivers the workload its identity and credentials at runtime. The sections that follow describe how this works in more detail, how to enable it on your cluster, and how to use the identity it provides.

Use cases

Workload identity is useful whenever a workload needs a verifiable identity of its own, whether it is calling AWS, talking to another workload, or reaching a system outside the cluster. The following are the main scenarios it supports.

Per-workload attribution and a single portable identity

You can already attribute actions to a workload within AWS today using EKS Pod Identity. What workload identity adds is a single, portable identity for the workload that works the same way inside and outside AWS. An IAM role is scoped to within AWS, while a SPIFFE identity is an open standard that the workload also carries beyond AWS. Without workload identity, a workload effectively has one identity model inside AWS (its IAM role) and separate arrangements for its interactions outside AWS, and you are left correlating the two. Workload identity gives the workload one verifiable identity that unifies both, so you can trace what a workload does holistically, inside AWS and out, against a single identifier. Agents are a live example: what an agent is allowed to access inside AWS and what it accesses outside can be tied to one identity. The identity is also externally verifiable through standard OIDC and X.509 mechanisms.

Workload-to-workload authentication

Let workloads prove their identity to one another before they communicate. Each workload can verify who it is talking to, so that only trusted workloads within your domain of trust establish a connection. Because each workload has a verifiable identity, this also enables mutual authentication between them, where both sides prove their identity to each other. That mutual authentication can in turn establish an encrypted channel, so the communication is not only trusted on both ends but can also be kept confidential as it crosses the network.

Authentication to external systems

Give a workload an identity that systems outside the cluster can recognize and verify. A workload can present its identity to an external system that is configured to trust it, and be authenticated without a shared secret or a long-lived credential.

End-to-end auditability

In a distributed environment with many workloads and many points of interaction, a key part of security is not only configuring beforehand which workloads are allowed to communicate, but also auditing afterward to confirm that only the right parties did. Accurate auditing depends on being able to tie activity back to who took part, which is difficult when workloads are not distinct and individually identifiable and their actions blur together under shared identities. With a verifiable identity unique to each workload, every action can be traced back to the specific workload that performed it. This gives security and audit teams a clear and accurate view of which workload did what, across the whole environment.

How it works

IAM for agents brings together three things: proving who a workload is, giving it an identity, and delivering that identity to the workload so it can use it. This section walks through each part.

The following diagram shows how a pod gets its identity.

A workload in a pod asks the EKS Pod Identity agent on its node for credentials over a node-local socket. The Pod Identity agent proves the pod to Amazon EKS, which attests the pod’s facts to IAM for agents, where a provider and a template issue the identity.

Attestation: proving who a workload is

Amazon EKS is the attestation authority for the workloads in your cluster. Before a workload is given an identity, EKS first establishes who that workload is, a step called attestation. Rather than letting a workload claim an identity for itself, EKS proves who the workload is using facts it can verify about the workload from the cluster, so a workload cannot claim to be something it is not. EKS then presents those attested facts to IAM for agents, which issues the identity.

EKS attests the following facts about a workload: the cluster name, the cluster ARN, the namespace, the service account, the pod name, the pod UID, and the name of the node that the pod runs on. EKS attests these facts on all Kubernetes versions that EKS supports.

You can use any of these facts in a template’s attestation policy, which decides which workloads are issued an identity. All of them except the cluster ARN can also appear in the identity itself, through the template’s path pattern. The default templates build the identity from the Region, the cluster name, the namespace, and the service account. To include the pod name, the pod UID, or the node name in the identity, use a custom template. For more information, see Template.

Once a workload has been attested, these verified facts are used to issue its identity. AWS issues an identity for the workload based on the attested facts, and the EKS Pod Identity agent delivers that identity to the workload.

A workload identity template is applied at the service account level by default. Every workload that runs under a given service account receives the same templated identity, so to get the full benefit of workload identity, give each workload its own dedicated service account. If you need an identity finer than the service account, you can use a custom template that includes the pod name, the pod UID, or the node name. With a dedicated service account, each workload has an identity that is truly its own, and the attribution and access control you build on top of it apply to that specific workload rather than to a group of workloads sharing a service account.

The identity: the SPIFFE ID

The identity a workload receives is a SPIFFE ID. It takes the form of a URI:

spiffe://<trust domain>/<workload path pattern>

The trust domain is the root of the identity. It identifies the authority that the identity belongs to, and every identity issued under the same provider shares it. The workload path pattern distinguishes one workload from another within that trust domain. The path pattern is defined by the template and is built from the workload’s attested facts, its namespace and service account, and, depending on the template, the cluster. Because the path pattern is defined by the template, the shape of the identity is configurable, and a custom template can include finer facts, such as the pod name.

For example, a workload in the payments namespace running under the checkout-sa service account might receive:

spiffe://acme.prod/111122223333/us-west-2/eks/cluster-1/ns/payments/sa/checkout-sa

In this example, the template builds the path from the account ID, the Region, the cluster name, the namespace, and the service account, under an organization-level provider. Other templates build it differently. The same workload under an account-level provider, where the trust domain already identifies the account, might receive:

spiffe://default.111122223333.aws.internal/us-west-2/eks/cluster-1/ns/payments/sa/checkout-sa

Neither shape is fixed. The template you choose decides which facts appear in the path.

The exact shape of the path is determined by the template you choose, which is covered later in this guide. What stays constant is that the SPIFFE ID is a single, verifiable name for the workload that is recognized both within AWS and outside it.

The credentials: how the identity is delivered

A workload does not present its SPIFFE ID as a bare string. It presents it through a credential that carries the identity in a verifiable form. Because IAM for agents builds on the open SPIFFE standard, these credentials are portable and not restricted to use within AWS, so an identity issued here can be consumed by any system that supports the standard. IAM for agents delivers the identity in three credential forms, so a workload can use whichever one fits how it needs to authenticate.

Note

A receiving system must be configured to trust the identity before it can verify a credential. For example, it needs to trust the issuer and recognize the specific workload. An identity is not accepted automatically simply because it is presented.

Decorated SigV4

This is the default, and it is how a workload’s identity reaches AWS. SigV4 is the signing mechanism the AWS SDKs already use to call AWS. A decorated SigV4 credential is the same credential the workload uses today, with the workload’s identity context added to it. Because the identity travels on the calls the workload already makes, per-workload attribution and access control in AWS work with no change to the application and no external integration.

X.509-SVID

A SPIFFE Verifiable Identity Document (SVID) is the document a workload presents to prove its SPIFFE ID. An X.509-SVID carries the identity as an X.509 certificate, which makes it suited to mutual TLS, where two workloads present certificates to authenticate to each other and establish an encrypted connection.

JWT-SVID

A JWT-SVID carries the identity as a signed JSON Web Token. It suits authentication at the application layer, where a workload presents a token to a service, and is the form used to authenticate to systems outside the cluster that are configured to trust the identity.

A JWT-SVID carries these claims: sub (the SPIFFE ID), aud (the audience the workload requested), iss (the issuer), iat (the time the token was issued), exp (the expiration time), and jti (a unique token ID). Attested facts such as the cluster, namespace, and service account are not carried as separate claims.

How a workload obtains each credential. The decorated SigV4 credential is delivered automatically. It is the credential the workload’s AWS SDK already uses, so no action is needed to obtain it. For an X.509-SVID or a JWT-SVID, the workload requests the credential from the EKS Pod Identity agent at runtime over a node-local socket, the SPIFFE Workload API. An application can call that socket directly with a SPIFFE library, or, more commonly, a proxy does it on the application’s behalf, for example an Envoy sidecar fetching an X.509-SVID over the Secret Discovery Service (SDS). The Pod Identity agent keeps whichever credential a workload uses current, renewing it before it expires. For how workloads use these credentials to authenticate to one another, see Use the identity.

A workload can obtain a JWT-SVID in two ways, and which one to use depends on the system it presents the token to.

  • From the EKS Pod Identity agent. The workload requests the JWT-SVID over the SPIFFE Workload API, typically through a SPIFFE client. The Pod Identity agent caches JWT-SVIDs for each audience and returns the cached token until it is renewed. Use this path for SPIFFE-aware destinations, such as other workloads that validate JWT-SVIDs.

  • From AWS STS through the AWS SDK. The workload calls the GetWebIdentityToken operation of AWS STS through the AWS SDK, with the token type set to JWT_SVID, the audience set to the system that the workload presents the token to, and a signing algorithm, RS256 or ES384, that the system accepts. It receives a new JWT-SVID on every call. The SDK uses the workload’s credentials from the Pod Identity agent automatically, so there is nothing else to configure. The workload’s IAM role must allow sts:GetWebIdentityToken. Use this path for identity providers and SaaS applications that accept each token only once.

Each JWT-SVID includes a unique token ID in the jti claim. A relying party can use it to detect a replayed token, and you can use it to trace a specific token through your logs.

The deliverer: the EKS Pod Identity agent

The component that brings this together on the cluster is the EKS Pod Identity agent. It runs on each node and is responsible for delivering a workload its identity and credentials at runtime.

When a workload needs its identity, the Pod Identity agent attests the workload, obtains the credential for it, and makes that credential available to the workload on the node. The Pod Identity agent also keeps the credentials current, renewing them before they expire, so the workload always has a valid identity without managing any long-lived secrets itself.

Because the Pod Identity agent is the same mechanism EKS already uses to deliver AWS credentials to workloads, enabling workload identity builds on something your cluster already has rather than introducing a separate identity component to run.

How this relates to EKS Pod Identity and IRSA

If you already use EKS Pod Identity or IAM roles for service accounts (IRSA), workload identity does not replace them, it adds to them.

Who versus what. EKS Pod Identity and IRSA give a workload an IAM role, which is the what: the permissions the workload has in AWS. Workload identity gives the workload its own verifiable SPIFFE identity, which is the who: a name that proves which workload is acting, inside AWS and beyond it. The two are complementary. The role decides what a workload may do, and the workload identity establishes who the workload is.

Additive and coexisting. Workload identity builds on EKS Pod Identity rather than alongside a separate system. It uses the same EKS Pod Identity agent and the same Pod Identity association, with workload identity enabled on top. Enabling it is additive: an association keeps providing AWS credentials exactly as before. Pods that use only Pod Identity and pods that also have workload identity enabled can run side by side in the same cluster.

For more information about EKS Pod Identity, see Learn how EKS Pod Identity grants pods access to AWS services. For a comparison of EKS Pod Identity and IRSA, see Comparing EKS Pod Identity and IRSA.

Prerequisites

Before you enable workload identity on a cluster, make sure the following are in place.

The EKS Pod Identity agent. Workload identity is delivered through the EKS Pod Identity agent, so the Pod Identity agent must be present on the nodes where your workloads run. How you get it depends on your node type:

  • EKS Auto Mode nodes. The Pod Identity agent is built into the Bottlerocket AMI that Auto Mode uses, so it is already present and there is nothing to install. Workload identity requires the Auto Mode AMI released on November 18, 2026 or later. To move to a newer agent version, roll or recycle your nodes so they come up on the latest AMI. For more information, see Automate cluster infrastructure with EKS Auto Mode.

  • Non-Auto-Mode nodes (managed node groups, self-managed nodes, and Karpenter). Install the EKS Pod Identity agent add-on yourself. Workload identity requires version v1.5.0-eksbuild.3 or later of the EKS Pod Identity agent add-on. Run the latest version. For more information, see Set up the Amazon EKS Pod Identity Agent.

Workload identity builds on the same Pod Identity setup you use for AWS credentials today.

Supported AMIs. Workload identity is supported on the AL2023-based EKS-optimized AMIs and on Bottlerocket (used by EKS Auto Mode, with the Pod Identity agent built in). Amazon Linux 2 (AL2) is not supported.

A provider and a template. Workload identity requires a workload identity provider and a template. The provider establishes the trust domain and is the authority for the identities issued under it. The template defines the shape of the SPIFFE ID and the facts a workload must prove to receive one. You reference both when you enable workload identity on a Pod Identity association.

A signer for the provider. The provider signs the credentials it issues, and how signing works differs by credential form:

  • For X.509-SVIDs, you bring an AWS Private Certificate Authority (AWS Private CA) resource, and the provider uses it to sign the certificates.

  • For JWT-SVIDs, there is nothing for you to set up. AWS signs the tokens for you.

Permissions to create the association. The IAM principal that creates or updates the Pod Identity association needs permission to read and pass the role, the template, and the provider. These permissions are iam:GetRole and iam:PassRole on the role, iam:PassWorkloadIdentityTemplate, iam:GetWorkloadIdentityTemplate, and iam:GetWorkloadIdentityTemplateAttestationPolicy on the template, and iam:GetWorkloadIdentityProvider on the provider. For example:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["iam:GetRole", "iam:PassRole"], "Resource": "arn:aws:iam::111122223333:role/checkout-role" }, { "Effect": "Allow", "Action": [ "iam:PassWorkloadIdentityTemplate", "iam:GetWorkloadIdentityTemplate", "iam:GetWorkloadIdentityTemplateAttestationPolicy", "iam:GetWorkloadIdentityProvider" ], "Resource": "*" } ] }

Trust policy on the workload’s role. Add sts:SetContext to the statement in the role’s trust policy that lets the EKS Pod Identity service assume the role, so that AWS STS can attach the workload identity to the role session. Keep the existing actions in the statement. For example:

{ "Effect": "Allow", "Principal": { "Service": "pods.eks.amazonaws.com" }, "Action": ["sts:AssumeRole", "sts:TagSession", "sts:SetContext"] }

Permission for the node role. Add sts:GetTrustBundles to the IAM role for your nodes, alongside the permissions from AmazonEKSWorkerNodePolicy. For example:

{ "Effect": "Allow", "Action": "sts:GetTrustBundles", "Resource": "*" }

Permissions for the workload’s role. To get X.509-SVIDs or JWT-SVIDs, the IAM role on the workload’s Pod Identity association must allow sts:GetCertificate and sts:GetWebIdentityToken. For example:

{ "Effect": "Allow", "Action": ["sts:GetWebIdentityToken", "sts:GetCertificate"], "Resource": "*", "Condition": { "StringLike": { "aws:OriginIdentity/Subject": "spiffe://acme.prod/111122223333/us-west-2/eks/cluster-1/*" } } }

The role also needs permission to retrieve trust bundles. This statement has no condition, because the sts:GetTrustBundles action doesn’t support resource-level permissions:

{ "Effect": "Allow", "Action": "sts:GetTrustBundles", "Resource": "*" }

To get X.509-SVIDs, the role also needs permission to use your AWS Private CA. Add these actions in a separate statement, without the aws:OriginIdentity/Subject condition:

{ "Effect": "Allow", "Action": ["acm-pca:IssueCertificate", "acm-pca:GetCertificate"], "Resource": "arn:aws:acm-pca:us-west-2:111122223333:certificate-authority/<ca-id>" }

IMDS configured so that pods use workload identity rather than the node role. Set the instance metadata service (IMDS) hop limit to 1 on your nodes. This prevents pods on the pod network from reaching IMDS and assuming the node’s IAM role instead of their own workload identity. The rationale is the same as for EKS Pod Identity today: workloads use their own identity, and access follows least privilege.

Private DNS for VPC endpoints, if you use them. If your cluster reaches AWS through interface VPC endpoints, enable private DNS for both the AWS STS endpoint and the Amazon EKS Auth endpoint. For more information, see Configure an interface endpoint in the AWS PrivateLink Guide.

Get started

To give a workload an identity and use that identity to scope access to an Amazon S3 bucket, complete the following steps. The example uses the checkout-sa service account in the payments namespace of the cluster prod-cluster-1, the IAM role checkout-role in account 111122223333, and the bucket amzn-s3-demo-bucket. Replace these with your own values. Before you start, make sure the Prerequisites are in place.

  1. Create a provider and a template. The provider establishes your trust domain and signs the identities issued under it. The template defines the shape of each identity. In the IAM console, choose Agent and workload identity, and then choose Create provider. For Name, enter payments-prod. Under Identity format and scope, keep the default scheme and trust domain, and choose This account for the scope. For Templates, choose Customize templates. On the Amazon EKS card, choose Add, enter eks-prod-1 for the name, and keep the default identity path and attestation policy. Then choose Create provider and templates. AWS creates the provider with signing keys, so your workloads can get JWT-SVIDs right away. To get X.509-SVIDs, you also attach an AWS Private CA to the provider.

  2. Allow the role to accept the identity. In the trust policy of checkout-role, add sts:SetContext to the statement that lets the EKS Pod Identity service assume the role. Keep the existing actions in the statement, or pods that use the role stop receiving credentials.

  3. Turn on workload identity for the Pod Identity association. Set workloadIdentityConfig on the association for checkout-sa, with the ARNs of the template and the provider from the first step. You can also set it in the Amazon EKS console. For more information, see Enable workload identity.

    aws eks update-pod-identity-association \ --cluster-name prod-cluster-1 \ --association-id <association-id> \ --workload-identity-config '{ "enabled": true, "templateArn": "arn:aws:iam::111122223333:workload-identity-template/eks-prod-1", "providerArn": "arn:aws:iam::111122223333:workload-identity-provider/payments-prod" }'
  4. Restart the pods. Workload identity is applied when a pod is created, so restart the pods of the workload to pick it up. For example, run kubectl rollout restart deployment checkout -n payments.

  5. Scope a bucket to the workload. Add the following policy to amzn-s3-demo-bucket. It allows read access only to this workload, and it matches both condition keys because an identity is unique only within its provider.

    { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowCheckoutWorkload", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*", "Condition": { "StringEquals": { "aws:PrincipalAccount": "111122223333", "aws:OriginIdentity/Subject": "spiffe://payments-prod.111122223333.aws.internal/us-east-1/eks/prod-cluster-1/ns/payments/sa/checkout-sa", "aws:OriginIdentity/Issuer": "arn:aws:iam::111122223333:workload-identity-provider/payments-prod" } } } ] }

    The aws:PrincipalAccount condition limits the statement to principals in your account. Without it, Amazon S3 Block Public Access treats a policy with "Principal": "*" as public and rejects it.

  6. Test access. From a pod that runs as checkout-sa, read the object with aws s3 cp s3://amzn-s3-demo-bucket/orders/hello.txt -. The command prints the contents of the object. From a pod that uses a different service account but the same role, the same command fails with AccessDenied, as long as the role doesn’t grant access to the bucket on its own. That pod’s identity doesn’t match the bucket policy, even though both pods use the same role.

If a pod doesn’t receive an identity, check the EKS Pod Identity agent logs on the node. Confirm that the cluster, namespace, and service account of the pod match the conditions in the template’s attestation policy.

To remove the example, delete the bucket policy and set enabled to false on the association. The association keeps its ARNs and continues to provide AWS credentials, and it stops issuing identities to new pods.

To use the identity in other ways, see the following topics:

Enable workload identity

You configure workload identity on a Pod Identity association by setting a workloadIdentityConfig on it. You can do this when you create a new association, or add it to an association you already have. In both cases, the association provides AWS credentials as it normally does, and workload identity is added on top. A Pod Identity association is the unit of configuration, so workload identity is scoped to the namespace and service account that the association targets.

To enable it, set enabled to true and provide the provider and template ARNs:

"workloadIdentityConfig": { "enabled": true, "templateArn": "arn:aws:iam::111122223333:workload-identity-template/my-template", "providerArn": "arn:aws:iam::111122223333:workload-identity-provider/my-provider" }

Both the template ARN and the provider ARN are required to enable workload identity. To change either one later, provide both ARNs in the update.

To turn workload identity off, set enabled to false. The association keeps the provider and template ARNs and continues to provide AWS credentials, and it stops issuing workload identities for new pods. Setting enabled back to true turns it on again without re-entering the ARNs.

A Pod Identity association that has never had a workloadIdentityConfig set behaves exactly as a standard Pod Identity association. Adding the configuration is additive, and it does not change the existing AWS credential behavior.

Note

Workload identity is applied to a pod when the pod is created. Enabling workload identity on an association, or changing its configuration, affects pods created after the change. Existing pods continue to run as they are until they are recreated.

The following image shows the IAM for agents settings on a Pod Identity association in the Amazon EKS console.

IAM for agents settings on a Pod Identity association, with fields for the provider and template and the identifier and issuer they produce.

Trust domains, providers, and templates

Three things work together to define the identities your workloads receive. The trust domain is the security boundary that identities belong to. The provider is the authority that establishes a trust domain and signs the identities issued under it. The template defines the shape each identity takes within that trust domain. The sections that follow describe each one.

Trust domain

The trust domain is the security and administrative boundary that your workloads' identities belong to. It defines the scope within which those identities are trusted, within an organization or between organizations, and its name is embedded in every SPIFFE ID issued under it, as the authority component of the identity.

You define the trust domain, and you set it to a domain you own, for example acme.prod or payments-mesh.acme.corp. This keeps the boundary of trust under a name you control rather than one assigned to you.

Provider

The provider is the authority for a trust domain. It establishes the trust domain and signs the identities issued under it. A provider can be scoped to suit your use case and how you want to establish your trust domain. The way identities are issued stays the same across these choices: EKS presents the workload’s attested facts, and the identity is issued under the provider you reference. What changes is the boundary of trust each provider defines.

Account-level

A provider lives in a single account and issues identities for clusters in that account. How you use it is your choice. You might dedicate a provider to a single cluster when you want that cluster’s identities under their own trust domain, or use one provider across several clusters in the account when you want them to share a trust domain.

Organization-level

A provider is shared across the accounts in an organization, so workloads in many member accounts receive identities under one organization-wide trust domain. This suits cases where a central security or identity team wants to govern how identities are issued across many accounts in one place, rather than each account managing its own.

Template

The template defines how a workload’s attested facts become its SPIFFE ID, and the conditions a workload must satisfy to be issued one. Where the provider establishes and signs under the trust domain, the template sets the shape of the identity within it.

The EKS console offers a set of default templates that suit most workloads, producing an identity at the service-account level. The default path pattern is:

{aws:RequestedRegion}/eks/{ClusterName}/ns/{Namespace}/sa/{ServiceAccount}

Default templates are not the only option. You can create a fully custom template with any path pattern you choose, through the IAM console, the AWS CLI, or AWS CloudFormation. A custom template is how you render an identity finer than the service account. In a custom path pattern, you can use the cluster name, the namespace, the service account, the pod name, the pod UID, and the node name. The cluster ARN is available in the attestation policy only, not in the path pattern.

For example, the following path pattern gives each pod its own identity, built from the cluster name, the namespace, and the pod name:

{ClusterName}/{Namespace}/{PodName}

In a stored template, each key is written in full, for example {aws:WorkloadAttestation/aws/eks/PodName}.

Identities built from the pod name or the pod UID change when the pod is replaced. A pod receives a new UID every time it is created, and pods in a Deployment receive new names when they are replaced, so a policy that names one of these identities exactly stops matching after a rollout. Pods in a StatefulSet keep stable names, which makes the pod name a better fit there.

After you customize the pattern, keeping identifiers unique becomes your responsibility. The EKS console offers the default templates only. You create custom templates on the IAM side (console, CLI, or CloudFormation).

Different templates produce different identity shapes for different needs. The following examples show what each default setup renders for a workload in the payments namespace running under the checkout-sa service account.

An organization-level provider carries the account and Region in the path, so identities stay unique across every account in the organization:

spiffe://acme.prod/111122223333/us-west-2/eks/cluster-1/ns/payments/sa/checkout-sa

An account-level provider is the same shape without the account in the path, because a per-account provider already implies the account:

spiffe://default.111122223333.aws.internal/us-west-2/eks/cluster-1/ns/payments/sa/checkout-sa

A mesh (Kubernetes-style) template puts the distinguishing facts into the trust domain and keeps the path to the ns/<namespace>/sa/<service account> convention that service meshes expect:

spiffe://eks-cluster-1.us-west-2.111122223333.aws.internal/ns/payments/sa/checkout-sa

For the mesh template, the trust domain defaults to an AWS-generated name (eks-<cluster>.<region>.<account>.aws.internal for a single cluster, or <provider>.<account>.aws.internal for a mesh spanning several clusters), but you can set it to a trust domain you choose. For example, a mesh commonly uses a domain such as cluster.local, which would render the identity as spiffe://cluster.local/ns/payments/sa/checkout-sa. The namespace-and-service-account path stays the same, and only the trust domain changes.

If your workloads run in a service mesh, see the service mesh guidance under Use the identity for how to set up and use this.

Use the identity

Once a workload has its identity, how it uses that identity depends on what it is authenticating to. This section covers using the identity within AWS, with systems outside the cluster, and between workloads, including in a service mesh and directly from application code.

Use the identity in AWS

Within AWS, the workload’s identity is carried automatically on the calls it already makes. A decorated SigV4 credential is the same credential the workload’s AWS SDK uses today, with the workload’s identity context added to it, so there is no change to the application and no additional setup.

The following diagram shows a workload using its identity to call an AWS service.

A workload in a pod gets credentials from the EKS Pod Identity agent and calls Amazon S3 with decorated SigV4. The bucket policy matches the workload’s identity.

Because the identity travels on those calls, you can write an IAM policy that is scoped to a specific workload. The SPIFFE ID appears in the policy as a condition key, aws:OriginIdentity/Subject, so access is granted only when the request carries that workload’s identity.

For example, this policy allows read access to a bucket prefix only for the checkout-sa workload:

{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/checkout-role" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::payments-data/ledger/*", "Condition": { "StringEquals": { "aws:OriginIdentity/Subject": "spiffe://acme.prod/111122223333/us-west-2/eks/cluster-1/ns/payments/sa/checkout-sa", "aws:OriginIdentity/Issuer": "arn:aws:iam::111122223333:workload-identity-provider/my-provider" } } }

Match both keys. aws:OriginIdentity/Subject is the workload’s SPIFFE ID, and aws:OriginIdentity/Issuer is the ARN of the provider that issued it. A SPIFFE ID is unique only within its provider.

The principal remains the IAM role. The workload identity adds the condition, so even if another workload could assume the same role, only the workload carrying this SPIFFE ID satisfies the policy and is granted access.

Use the identity with systems outside the cluster

A workload can use its identity to authenticate to a system outside the cluster, without a shared secret or a long-lived API key. For this, the workload uses its identity as a JWT-SVID, a signed token that carries its SPIFFE ID, and presents that token to the external system.

The following diagram shows a workload authenticating to a system outside the cluster.

A workload in a pod presents a JWT-SVID to an external system that trusts your provider. The external system fetches the provider’s public signing keys from IAM for agents to verify the token.

The external system verifies the token through standard OIDC federation. It is configured once to trust your provider, by trusting the provider’s issuer and recognizing the specific workload identity that is allowed. When the workload presents its token, the external system checks three things: that the token was signed by the trusted issuer, that its subject is the workload identity the rule allows, and that its audience is the external system itself. Only then is the workload authenticated.

The workload’s JWT-SVID carries its SPIFFE ID as the subject and names the external system as the audience:

{ "iss": "https://<issuer-id>.workloads.tokens.sts.global.api.aws", "sub": "spiffe://eks-cluster-1.us-west-2.111122223333.aws.internal/ns/inference/sa/agent-worker", "aud": "https://api.example.com", "iat": 1790000000, "exp": 1790003600 }

A workload running in EKS requests a JWT-SVID scoped to the external system as its audience and presents it to authenticate, in place of a long-lived API key stored in the cluster. For the full walkthrough, see Authenticate to an external system from Amazon EKS with IAM for agents.

Note

An external system must support this kind of identity federation and be configured to trust your provider before it can accept the workload’s identity. A workload’s identity is not accepted automatically simply because it is presented.

Use the identity between workloads

Workloads can use their identities to authenticate to one another. There are a few ways to consume the identity for this, depending on how your workloads are set up. Each is covered in detail on its own page. The summaries below point you to the right one.

The following diagram shows two workloads authenticating to each other.

Two workloads in pods on the same node authenticate to each other with mutual TLS. The EKS Pod Identity agent delivers each workload its X.509-SVID.

In a service mesh

A service mesh manages how workloads communicate and commonly secures that communication with mutual authentication. With workload identity, the mesh’s proxies present the AWS-issued SPIFFE identity instead of a mesh-only one, so a workload carries the same identity inside the mesh and everywhere else. Use the mesh (Kubernetes-style) template for these workloads. For more information, see Use IAM for agents with Istio in Amazon EKS.

With self-managed Envoy sidecars

If you run Envoy sidecars yourself rather than a full mesh product, each Envoy fetches the workload’s X.509-SVID and trust bundle from the EKS Pod Identity agent over the Secret Discovery Service (SDS) and uses them for mutual TLS. For more information, see Use IAM for agents with self-managed Envoy sidecars in Amazon EKS.

Directly from application code (library or SDK)

The EKS Pod Identity agent exposes the SPIFFE Workload API over a unix socket (for example FetchX509SVID, FetchX509Bundles, FetchJWTSVID, FetchJWTBundles, and ValidateJWTSVID). A workload can consume these directly using a SPIFFE SDK such as go-spiffe, doing mutual TLS in its own code with no sidecar. This is one of the ways to consume workload identity. It is not the preferred path for most Kubernetes customers, who are better served by the mesh and sidecar models above, but it is fully supported. For more information, see Use IAM for agents in Amazon EKS from application code with a SPIFFE library.

Considerations and limitations

Keep the following in mind when you plan how to use workload identity. Each item states something to be aware of as you design around it.

IAM for agents is available only in commercial AWS Regions, except Middle East (Bahrain) (me-south-1) and Middle East (UAE) (me-central-1). It isn’t available in the AWS GovCloud (US) Regions or the China Regions.

Workload identity requires a minimum version of the Pod Identity agent. Workload identity is delivered through the EKS Pod Identity agent, and it requires version v1.5.0-eksbuild.3 or later of the EKS Pod Identity agent add-on. Run the latest version. A cluster running an earlier version of the Pod Identity agent cannot deliver workload identities until the Pod Identity agent is upgraded. For the full setup requirements, see Prerequisites.

Identity is scoped by the facts that EKS attests, not by container image. A workload’s identity is rendered from the facts EKS attests about it, which are the cluster name, cluster ARN, namespace, service account, pod name, pod UID, and node name. The container image a pod runs is not among these facts, so you cannot scope an identity or an attestation condition to a specific container image.

Identities are scoped to the account of the Pod Identity association. A workload receives an identity and credentials within the account its Pod Identity association belongs to. Assuming an IAM role in a different account through the workload identity path is not currently supported, so cross-account patterns that depend on it are not available.

Identities are usable within AWS and with systems that federate to AWS, not across other cloud providers. A workload’s identity is issued under an AWS trust domain. It can be used within AWS and presented to external systems that are configured to trust your provider, as described earlier in this guide. Federating the identity directly into another cloud provider’s identity system is not currently supported.

Workload identity applies to a pod when the pod is created. Enabling workload identity on a Pod Identity association, or changing its configuration, affects pods created after the change. Existing pods continue to run as they are until they are recreated.

Istio ambient mode is not currently supported. Workload identity integrates with Istio in sidecar mode, where each workload runs an Envoy sidecar that obtains its identity from the EKS Pod Identity agent over SDS. Istio ambient mode, where the per-node ztunnel proxy handles workload traffic, is not currently supported. To use workload identity with Istio, run the mesh in sidecar mode.

JWT-SVIDs from the Pod Identity agent are cached, so use the AWS SDK for systems that accept a token only once. The EKS Pod Identity agent caches JWT-SVIDs for each audience and returns the same token to repeated requests until it is renewed. A cached token can have been issued up to an hour before you receive it, so a relying party that requires a recently issued token, for example by checking iat against a short time window, can reject it. Some identity providers and SaaS applications, such as Okta, treat a token with a jti claim as single use and reject it if it is presented again. For these systems, get the JWT-SVID through the AWS SDK, which requests a new token from AWS STS on every call. Continue to use the Pod Identity agent for SPIFFE-aware destinations. Caching cannot be turned off, including on EKS Auto Mode.

JWT-SVIDs from the Pod Identity agent are valid for 1 hour. A JWT-SVID from the EKS Pod Identity agent has a fixed lifetime of 1 hour. Relying parties should accept tokens for that duration, and workloads should request a new token rather than reuse one past its expiry. An X.509-SVID has a default lifetime of 12 hours.

Workload identity is available on EKS Auto Mode nodes, but stays inactive until you enable it. The EKS Pod Identity agent in EKS Auto Mode supports workload identity starting with the Auto Mode AMI released on November 18, 2026. Workload identity stays inactive until you create a provider and a template and enable workload identity on a Pod Identity association. Until then, the Pod Identity agent behaves as it does without workload identity.

Workload identity is not currently supported with Nitro Sandbox. For more information about sandboxes, see Sandboxing on Amazon EKS with isolated and confidential pods.

Workload identity can’t be enabled through the add-ons API. The podIdentityAssociations setting on an add-on doesn’t support workload identity. To use workload identity with an add-on’s service account, enable it on the Pod Identity association directly, using the Pod Identity association APIs through the AWS CLI or an AWS SDK.

The node role needs sts:GetTrustBundles. Workload identity requires the IAM role for your nodes to allow sts:GetTrustBundles, in addition to the permissions in AmazonEKSWorkerNodePolicy. Add the permission to the role before you enable workload identity.

Restarting the Pod Identity agent can cause X.509-SVIDs to be issued again. When the Pod Identity agent restarts, for example during a rolling version upgrade, the X.509-SVIDs for running workloads can be issued again. AWS Private CA charges apply to the certificates it issues. For more information, see AWS Private CA pricing.

Frequently asked questions

What is a workload identity?

A workload identity is a verifiable identity issued to a specific Kubernetes workload in EKS that proves who that workload is. It takes the form of a SPIFFE ID and is carried in a credential the workload presents when it communicates. An IAM role grants a workload permissions to act on AWS, and can be used by any workload that assumes it. A workload identity is different in purpose. It establishes who a workload is, it is tied to a single workload, and it is recognized both within AWS and outside it. The two work together: a workload proves its identity, and a policy decides what that identity is allowed to do.

How much does IAM for agents cost in Amazon EKS?

There is no additional charge to use IAM for agents with Amazon EKS during the preview. Standard Amazon EKS charges for your cluster still apply. If you issue X.509-SVIDs, you attach an AWS Private CA to your provider, and 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.

What’s the difference between workload identity and EKS Pod Identity or IRSA?

EKS Pod Identity and IRSA give a workload an IAM role, which is the what: the permissions it has in AWS. You can already attribute actions to a workload within AWS with Pod Identity today. What workload identity adds is a single, portable who: the workload’s own verifiable SPIFFE identity, which works the same way inside and outside AWS. An IAM role is scoped to within AWS, while a SPIFFE identity is an open standard the workload also carries beyond AWS. So instead of one identity model inside AWS and separate arrangements outside it, the workload has one identity that unifies both. They are complementary and used together. The role decides what the workload may do, and the workload identity establishes who it is.

Can I use workload identity and a normal IAM role identity in the same cluster with the same EKS Pod Identity agent?

Yes. Workload identity is additive to EKS Pod Identity. It uses the same Pod Identity agent and the same Pod Identity association, with workload identity enabled on top. Pods that use only Pod Identity and pods that also have workload identity enabled can run side by side in the same cluster, and an association with workload identity enabled keeps providing AWS credentials exactly as before.

Do I need the Pod Identity agent, and does this change how Pod Identity works today?

On Amazon EKS, workload identity is delivered to your workloads through the EKS Pod Identity agent, so the Pod Identity agent must be installed on your cluster. The Pod Identity agent is how a Kubernetes workload in EKS receives its identity. It is the EKS delivery mechanism rather than a requirement of IAM for agents everywhere it is used. It builds on the same Pod Identity setup you use for AWS credentials today. Enabling workload identity on a Pod Identity association is additive. The association continues to provide AWS credentials exactly as before, and workload identity is added on top. A Pod Identity association that does not have workload identity enabled behaves as a standard Pod Identity association.

Do my applications need to change to use workload identity in AWS?

No. Within AWS, the workload’s identity is carried on the calls it already makes. The decorated SigV4 credential is the same credential the AWS SDK uses today, with the workload’s identity context added to it, so there is no change to your application code and no additional integration. You write an IAM policy that references the workload’s identity as a condition, and access is granted only when the request carries that identity.

Can I use workload identity for mutual authentication between my workloads?

Yes. Workload identity gives each workload a verifiable identity that it can present to another workload so that both sides prove who they are before they communicate. How you establish that mutual authentication is your choice. A workload can use its identity as an X.509-SVID for mutual TLS, or as a JWT-SVID for token-based authentication, depending on what fits your environment. What workload identity provides is the identity itself, a verifiable, short-lived credential delivered to each workload.

Can I integrate Istio or Envoy with this?

Yes. If you run Istio in sidecar mode, or run Envoy sidecars yourself, the proxy fetches its certificate from the EKS Pod Identity agent over the Secret Discovery Service (SDS) and uses it for mutual TLS. The workloads in your mesh then authenticate with the same AWS-issued identity they use elsewhere. For how to configure this, see Use IAM for agents with Istio in Amazon EKS and Use IAM for agents with self-managed Envoy sidecars in Amazon EKS.

Does workload identity work across accounts or across clouds?

A workload receives an identity and credentials within the account its Pod Identity association belongs to. The identity can be used within AWS and presented to external systems that are configured to trust your provider, including systems outside AWS that federate to it. Assuming an IAM role in a different account through the workload identity path, and federating the identity directly into another cloud provider’s identity system, are not currently supported.

Is SPIFFE the only supported identity standard?

Yes. Workload identity issues identities using the Secure Production Identity Framework for Everyone (SPIFFE), an open, vendor-neutral standard for workload identity. Because SPIFFE is an open standard, an identity issued here can be consumed by any system that supports it, within AWS and beyond.