On this page
On 1 December 2026 AWS announced a preview of agent and workload identity in IAM, with Amazon EKS support on the same day. Until now, what AWS knew about a pod was the IAM role it had assumed. Ten agents sharing a role were one principal in every policy and one name in every audit record, so teams that needed to tell them apart created a role per workload. The preview adds a second fact to the session: a SPIFFE identifier that IAM issues to the workload after EKS has attested which pod is asking. The role still decides what the session may do. The identifier says which workload is doing it.
I ran it on an EKS Auto Mode cluster in Ireland with four workloads on one IAM role. A bucket policy that named one workload let that workload read and refused the other three, although all four had the same role. The identity survived a role assumption. A custom template gave each replica of a deployment its own identifier. CloudTrail named the workload on every STS call. The preview has no notion of a sub-agent, and the last third of this article covers what you can build in its place.

Test Setup
One script, run in steps from AWS CloudShell in eu-west-1 with boto3 1.44.18. It creates a VPC, an EKS Auto Mode cluster (Kubernetes 1.37, active 526 seconds after the create call), a workload identity provider, two templates, two IAM roles, a bucket with one object, and four deployments in a namespace called agents. Each pod runs a Python 3.13 image with boto3 and a small probe script that the lab calls through kubectl exec.
| Service account | Pod Identity association | Purpose |
|---|---|---|
agent-a | Shared role, workload identity on, default EKS template | The workload the bucket policy names |
agent-b | Shared role, workload identity on, default EKS template | Same role, different identity |
agent-pod (2 replicas) | Shared role, workload identity on, custom template ending in the pod name | One identity per pod |
agent-plain | Shared role, no workload identity | Pod Identity as it worked before the preview |
The shared role has no S3 permissions. Its only policy allows the calls a workload needs for its own external credentials, plus sts:AssumeRole on a second role used for the chaining test. Whatever S3 access a pod gets in this test comes from the bucket policy.
Provider, Template and Association
Three objects sit between a pod and its identifier. A workload identity provider owns a trust domain and the signing keys. A template holds a path pattern, built from facts the compute service attests, and an attestation policy that says who may ask for an identity from it. The Pod Identity association then points at both.
Creating the provider with the SPIFFE scheme and account scope returned the trust domain 111122223333.aws.internal (the account ID followed by a fixed suffix), two JWT signers, RS256 and ES384, and no X.509 signer. The template came from the EKS template definition that AWS publishes, and its path pattern is {aws:RequestedRegion}/eks/{ClusterName}/ns/{Namespace}/sa/{ServiceAccount}. The association carries the new block:
eks.create_pod_identity_association(
clusterName=name, namespace="agents", serviceAccount="agent-a", roleArn=shared_role_arn,
workloadIdentityConfig={"enabled": True, "templateArn": template_arn, "providerArn": provider_arn},
)Two IAM changes go with it, both from the EKS User Guide. The role trust policy for pods.eks.amazonaws.com needs sts:SetContext next to sts:AssumeRole and sts:TagSession, and the node role needs sts:GetTrustBundles. On Auto Mode there was nothing to install: the node that Auto Mode started ran a recent enough image, and the five pods were ready 58 seconds after the manifest was applied. Outside Auto Mode the guide asks for version v1.5.0-eksbuild.3 or later of the Pod Identity agent add-on.
The attestation policy that the EKS definition generated is worth reading before production use. It allows the principal pods.eks.amazonaws.com to call sts:IssueWorkloadIdentityContext with one condition, aws:SourceAccount equal to my account. Nothing in it names the cluster. Any cluster in the account whose administrator can create an association with this template gets identities from it, and only the cluster name inside the path tells them apart. The cluster ARN is an attested fact that an attestation policy can test, so a stricter policy can admit one cluster only; the IAM guide has a page on admitting specific clusters or namespaces.
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','signalColor':'#0073BB','signalTextColor':'#0F172A','actorBkg':'#FFF3E0','actorBorder':'#FF9900','actorTextColor':'#232F3E','noteBkgColor':'#FFF8E7','noteBorderColor':'#FF9900','noteTextColor':'#232F3E'}}}%%
sequenceDiagram
participant P as Pod (agent-a)
participant E as EKS Pod Identity
participant S as AWS STS
participant B as Amazon S3
P->>E: Credential request with service account token
E->>S: IssueWorkloadIdentityContext with attested facts
S-->>E: Subject and issuer for this pod
E->>S: AssumeRole on the shared role with that context
S-->>E: Role session that carries the identity
E-->>P: Temporary credentials
P->>B: GetObject
Note over B: Bucket policy tests subject and issuer
B-->>P: Object, or AccessDenied
Role Session with an Identity
From inside the pods, GetCallerIdentity shows no sign of the new identity. All three single-replica workloads report the same role, and their ARNs differ only in the session name that Pod Identity generates:
agent-a: arn:aws:sts::111122223333:assumed-role/agent-id-lab-shared/eks-agent-id-l-agent-a-7f-35b6d763-...
agent-b: arn:aws:sts::111122223333:assumed-role/agent-id-lab-shared/eks-agent-id-l-agent-b-7c-1c5bd491-...
agent-plain: arn:aws:sts::111122223333:assumed-role/agent-id-lab-shared/eks-agent-id-l-agent-plai-56b1b42c-...The identifier travels as session context, which is why it appears in policy condition keys and in CloudTrail and nowhere in the principal ARN. The IAM guide puts it plainly: the identity is not an IAM principal, and you name it in the Condition element, never in Principal.
Resource Policy by Workload Identity
The bucket policy allows s3:GetObject to any principal in the account whose session carries agent-a’s subject and my provider as the issuer. The guide asks for both keys in every resource policy, because a subject is unique only within its provider, and for string operators on both, although the issuer is an ARN.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "OnlyAgentA",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*",
"Condition": {
"StringEquals": {
"aws:PrincipalAccount": "111122223333",
"aws:OriginIdentity/Subject": "spiffe://111122223333.aws.internal/eu-west-1/eks/agent-id-lab/ns/agents/sa/agent-a",
"aws:OriginIdentity/Issuer": "arn:aws:iam::111122223333:workload-identity-provider/agent-id-lab"
}
}
}]
}| Workload | Policy names agent-a exactly | Policy uses StringLike on .../ns/agents/sa/* |
|---|---|---|
agent-a | Read the object | Read the object |
agent-b | AccessDenied | Read the object |
agent-pod (either replica) | AccessDenied | Read the object |
agent-plain | AccessDenied | AccessDenied |
The wildcard column took effect within the 15 seconds the script waits after changing a bucket policy. The pod without a workload identity stayed locked out under both policies, which is the behaviour you want from a condition on a key that is absent from its session.
The error that agent-b received reads “is not authorized to perform: s3:GetObject on resource … because no identity-based policy allows the s3:GetObject action”. It names the role session and says nothing about a workload identity or a failed condition. Someone debugging this from the application log will look at the role first. CloudTrail is where the subject is visible.
JWT-SVID for External Services
The same identity can be handed to something outside AWS. A workload calls sts:GetWebIdentityToken with the token type JWT_SVID and receives a signed token whose subject is its SPIFFE ID. The probe requests one, fetches the provider’s published keys from the issuer’s OpenID configuration, and verifies signature, audience and issuer inside the pod. The token is never printed.
token = sts.get_web_identity_token(TokenType="JWT_SVID", Audience=[audience], SigningAlgorithm=algorithm,
DurationSeconds=300)["WebIdentityToken"]
header = jwt.get_unverified_header(token)
issuer = jwt.decode(token, options={"verify_signature": False})["iss"]
discovery = json.load(urllib.request.urlopen(issuer + "/.well-known/openid-configuration", timeout=15))
key = jwt.PyJWKClient(discovery["jwks_uri"]).get_signing_key_from_jwt(token)
claims = jwt.decode(token, key.key, algorithms=[header["alg"]], audience=audience, issuer=issuer) # raises on any mismatch| Workload | Algorithm | Result |
|---|---|---|
agent-a | RS256 | Verified; 828 characters; subject ends /sa/agent-a |
agent-a | ES384 | Verified; 614 characters; same subject |
agent-b | RS256 | Verified; subject ends /sa/agent-b |
agent-plain | RS256 | AccessDenied on sts:GetWebIdentityToken |
Each token carried six claims: sub, aud, iss, iat, exp and jti, with the 300-second lifetime I asked for. The issuer is an HTTPS address under workloads.tokens.sts.global.api.aws that is specific to the provider. There are no claims for the namespace, pod or role: a relying party gets the subject string and has to parse the path if it wants the parts. The denial for agent-plain comes from my role policy, which allows the call only where aws:OriginIdentity/Subject matches the cluster’s prefix, as the EKS guide recommends.
Role Chaining
Agents commonly assume a second role for a task. The probe has each pod assume a role named chained, which trusts the shared role, and read the object with the new credentials. agent-a read it. agent-b assumed the role and was refused. The bucket policy saw agent-a’s subject on a session of a different role, which matches the documented rule: the identity stays on the session when the workload assumes another role in the same account or the same organization, and STS drops it when the role is in a different organization.
This has a design consequence. A resource policy written against a subject follows the workload through every role it can assume inside the organization. That is the point of the feature, and it also means a broad sts:AssumeRole permission no longer changes who the caller is in those policies.
Per-Pod Identity from a Custom Template
The second template adds the pod name to the path: .../sa/{ServiceAccount}/pod/{PodName}. With it, the two replicas of agent-pod received different subjects, each ending in its own pod name, from one service account, one association and one role. The exact-match bucket policy refused both, and the namespace wildcard admitted both.
One detail cost me a run. get_workload_identity_template_attestation_policy in boto3 1.44.18 returns the policy as a parsed document, while create_workload_identity_template accepts AttestationPolicy only as a JSON string, so copying one template’s policy into another needs a json.dumps in between.
A subject that contains a pod name changes at every rollout. Policies should match such identities by prefix, and the EKS guide warns that policies naming a pod exactly stop matching after a replacement. The pod UID and node name are available as path facts too. The container image is not an attested fact, so an identity cannot be tied to an image digest.
Sub-Agent Identity
I set out to give a sub-agent its own identity derived from its parent’s. The preview has no way to express that. A workload cannot mint a child identifier, narrow its own, or record that it acts for another workload. Every identity comes from a template evaluated against facts that the compute service attests, so a sub-agent is identified by where it runs. In the announcement and in the pages I read there is no delegation chain and no “on behalf of a user” for a workload identity; the onBehalfOf block in CloudTrail has one level, the workload itself.
Three patterns are available with what exists today:
- A sub-agent in its own pod. Give it a service account, or use the per-pod template. It gets a distinct subject and distinct audit records. The parent relationship is yours to encode, for example in the namespace or service account name, because the path is the only place it can live.
- A sub-agent as a thread or process inside the parent’s pod. It shares the pod’s credentials and is the parent to AWS. Nothing in the preview separates them.
- A parent that narrows a sub-agent by role. The parent assumes a smaller role and passes those credentials on. Permissions shrink, but the subject stays the parent’s, as the chaining test showed.
For agent platforms where one process plans and several short-lived workers act, the first pattern with a path convention such as ns/<team>/sa/<agent>-worker and a StringLike condition is the closest fit. Amazon Bedrock AgentCore Runtime and Gateway are the other supported hosts, and I did not test them.
Identity Removal on a Running Workload
Setting enabled to false on agent-a’s association is the off switch, and it does not act on running pods. Thirty seconds after the change, the existing pod still read the object. A pod created after the change assumed the same role, was refused by the bucket, and was refused a JWT-SVID. The guide says identity is applied when a pod is created, and the IssueWorkloadIdentityContext record for each pod asks for a session of 21,600 seconds, so a pod that is left alone holds an identity-bearing session for some time.
Disabling workload identity on an association stops new pods from getting one. A running pod keeps its identity until it is replaced. To cut off a workload now, delete its pods, or change the resource policies that name it. I did not measure how long an untouched pod would keep the identity.
CloudTrail Records
The STS events were in CloudTrail event history within five minutes. Three event types matter.
| Event | Count | Content |
|---|---|---|
IssueWorkloadIdentityContext | 4 | Called by pods.eks.amazonaws.com once per pod with an identity. Request parameters hold the attested facts (cluster name and ARN, namespace, service account, pod name, pod UID, node name), the template ARN, the target role and the session duration. |
AssumeRole | 31 for the whole lab | For pods with an identity, userIdentity.onBehalfOf holds subject, issuer, workloadIdentityTemplateArn and subjectType “workload”. The chained assumption carries the same block, with the role session as the caller. |
GetWebIdentityToken | 7 | Carries onBehalfOf for agent-a and agent-b. The refused call from agent-plain is recorded with AccessDenied and no onBehalfOf. |
"userIdentity": {
"type": "AssumedRole",
"invokedBy": "pods.eks.amazonaws.com",
"onBehalfOf": {
"subject": "spiffe://111122223333.aws.internal/eu-west-1/eks/agent-id-lab/ns/agents/sa/agent-a",
"issuer": "arn:aws:iam::111122223333:workload-identity-provider/agent-id-lab",
"workloadIdentityTemplateArn": "arn:aws:iam::111122223333:workload-identity-template/agent-id-lab-sa",
"subjectType": "workload"
}
}The block above is assembled from the fields the lab printed, with the account ID replaced and the lab’s name suffix removed. Because the per-pod identity puts the pod name in the subject, an auditor can go from an API call to a pod, and from the issue event to its UID and node, without joining against Kubernetes audit logs. S3 object reads are data events, which my account does not record, so I did not confirm that the block appears on the GetObject records themselves.
Design Guidance
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','clusterBkg':'#F8FAFC','clusterBorder':'#CBD5E1','edgeLabelBackground':'#FFFFFF','nodeTextColor':'#232F3E'}}}%%
flowchart TD
A["Workload needs access
to an AWS resource"] --> B{"Does the resource support
resource-based policies?"}
B -->|Yes| C["Keep a shared role per trust tier;
name subject and issuer
in the resource policy"]
B -->|No| D["Keep a dedicated role,
or condition identity policies
on the subject"]
C --> E{"Replicas need
separate audit trails?"}
D --> E
E -->|Yes| F["Custom template with pod name;
match by prefix"]
E -->|No| G["Default template:
one identity per service account"]
F --> H["Pin the attestation policy
to the cluster ARN"]
G --> H
classDef compute fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E
classDef db fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74
classDef store fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202
classDef mesh fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#4C1D95
class A,B,E compute
class C,D db
class F,G store
class H mesh
- Path design is the access model. Region, cluster, namespace and service account become the hierarchy that every
StringLikecondition matches against. Namespaces and service account names now carry security meaning, so who may create them matters more than before. - One service account per workload. The default template stops at the service account. Two deployments sharing one are one identity.
- Subject and issuer together, with an account or organization key. A policy with
"Principal": "*"and only a subject condition trusts any provider that can produce that string. - Role count can fall, policy count rises. The shared role in this test had no data permissions at all. The access decisions moved into resource policies, which need the same review and testing that role policies had.
- Plan removal around pod lifetime. Offboarding a workload means deleting its pods and its association, and removing its subject from resource policies.
Recommendation
Try it now on a non-production cluster if you run many agents or services on shared roles and your audit findings say “which pod did this?”. The model is small, the EKS setup is one block on an association, and the CloudTrail records alone justify the effort. Hold production use for general availability: this is a preview, the API shapes can change, and immediate revocation and sub-agent delegation are absent. Design the namespace and service account naming you would want as an identity path now, because that part will carry over.
A note on testing: I ran one script from AWS CloudShell in eu-west-1, with boto3 1.44.18, against an EKS Auto Mode cluster on Kubernetes 1.37 with one node. Every result is from a single run. The first setup run stopped at the attestation policy type difference described above, and I resumed it from that step. My first reading after disabling workload identity came from the old pod while it was terminating, because the script picked it by mistake; I corrected the script and the result reported here is from a pod created after the change. I did not test X.509-SVIDs (they need AWS Private CA), mutual TLS between workloads, Amazon Bedrock AgentCore, organization-scoped providers, role assumption across accounts or organizations, identity-based policies conditioned on the subject, S3 data events in CloudTrail, the Pod Identity agent add-on on self-managed nodes, or how long a running pod keeps an identity after it is disabled. The account ID, bucket name and lab name suffix are replaced in everything shown. The cluster, VPC, roles, provider, templates and bucket were deleted afterwards.
The complete sample for this article is on GitHub: nithinmohantk/blog-samples-working-repo/iam-agent-workload-identity-eks-tested. Clone it with git clone https://github.com/nithinmohantk/blog-samples-working-repo.git and open the iam-agent-workload-identity-eks-tested folder. Its README says how to run it and what has been verified.
References & Further Reading
- → AWS IAM announces support for agent and workload identity (preview)— The AWS announcement, 1 December 2026
- → Amazon EKS announces support for agent and workload identity (Preview)— The EKS announcement, with Regions and pricing
- → Give agents and workloads in EKS a verifiable identity— EKS User Guide: prerequisites, trust policy, attested facts and limits
- → Getting started with agent and workload identity— IAM User Guide: providers and templates
- → Control access with agent and workload identity— IAM User Guide: condition keys, subject with issuer, and role chaining
- → Sample code for this article— The lab script and its recorded output
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.