AWS IAM for Agents: First Impressions from the Preview
By Fabio Douek
Human-led, AI-assisted. Research and implementation done with AI tools, led, tested and edited by me. How posts are labeled
EventAWS re:Invent 2026: times, streams and recordings →Nov 30 to Dec 4, 2026
Jump to section
- Overview
- Architecture
- How It Works
- Three objects in IAM
- What happens when a workload starts
- The credentials a workload gets
- What the Preview Can’t Do Yet
- How It Compares
- Verdict
- Overview
- Setup
- The Demo: One Role, Two Names
- Step 1: A provider
- Step 2: A template and its attestation policy
- Step 3: Turn it on for both pods
- Step 4: A bucket only one workload can read
- Step 5: A JWT-SVID for the world outside AWS
- Step 6: CloudTrail names the workload
- Step 7: Take the name away
- Cleanup
- Verdict
Explain (TLDR) like I am...
Imagine two kids wearing the same school uniform. The teacher can see they are from the same class, but not which one ate the cookies. Now each kid also gets a name badge, and the badge is only handed out after the teacher checks who they really are.
That is what this does for computer helpers. Many helpers used to share one uniform, so nobody could tell them apart. Now each one gets its own checked name badge, so a door can open for one helper and stay shut for the other, and the diary says exactly who walked in.
Until now, several automated workloads on AWS often acted under one shared role, so the audit record named the role, not the workload. This preview attaches a verified, named identity to each session, issued only when the hosting service vouches for the workload's attributes.
For due diligence, the gains are attribution and least privilege: the audit log records which named workload acted, and policies can admit one workload and refuse its siblings. Note the preview status, that denied issuances are not logged in your own account, and that live sessions outlast a policy change until they renew.
The condition is a shared identity: many agents and pods act under one role, so when something goes wrong the record cannot say which one did it. The treatment gives each workload its own name, issued only after the platform confirms where it runs.
In my small trial on Amazon EKS it worked as described: two pods with the same role got different names, a bucket admitted only one of them, and the audit log named each. Side effects: an extra add-on setting the docs did not mention, and a revoked pod fails with a misleading error.
Notice the low hum of unease when a team cannot say which of its automated helpers touched something. Everyone shares one badge, so every incident review starts with a shrug and a lot of guessing.
This feature gives each helper its own name, checked before it is handed out. That can turn blame into a simple lookup, and it lets a team grant trust narrowly instead of all at once. The new friction is learning yet another policy type, and accepting that it is still a preview.
Think of a horn section where every player reads from the same part, so the engineer cannot tell who played the wrong note. This preview gives each player their own channel on the desk, assigned only after the stage manager checks who is actually sitting in that chair.
Now you can mute one player without silencing the section, and the recording shows who played what. The arrangement still uses the same charts, the roles and policies you know, with one more line written in.
The story is accountability for AI agents without new credentials to manage. Each agent or pod gets its own verified name on top of the IAM role it already uses, and that name shows up in policies and audit logs.
Positioning: for platform and security teams running agents on Amazon EKS or AgentCore who need to say which agent did what. It is a preview, free while in preview, and on EKS the setup is a provider, a template, one add-on setting and one setting per pod association.
Level 100 · How it works
Level 200 · Walkthrough
Level 100 · How it works
Overview
AWS IAM for agents is a preview AWS announced at re:Invent 2026. Its core feature, agent and workload identity, makes IAM an identity provider for workloads: each agent, pod or sub-agent gets its own name, a SPIFFE ID such as spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement, and AWS issues that name only after the service hosting the workload attests what it is. The name rides on the IAM role session the workload already uses, so policies can match it and CloudTrail records it.
The problem it addresses is familiar to anyone running agents on AWS: ten agents that share one IAM role look alike to policies and logs. The role is the same, and only the session name or, on EKS, a session tag hints at which one acted. AWS’s own wording is “give each workload a dedicated identity”, “trace actions to the workload” and “replace long-lived secrets with short-lived credentials”. The same docs section also groups two related features, Credential Broker (also in preview: outbound OAuth tokens and API keys for systems outside AWS) and enterprise-managed authorization (your identity provider decides which agents reach the AWS MCP Server). This post covers the identity part.
This level is an explainer. The hands-on run is in Level 200.
Architecture
How It Works
Three objects in IAM
Everything lives in the IAM console under IAM for agents → Agent and workload identity, or in the aws iam *-workload-identity-* commands.
| Object | What it holds | Example from my run |
|---|---|---|
| Provider | The issuer: a scheme (SPIFFE or none), a trust domain, a scope (this account or the whole organization) and the signing keys for outbound tokens | payments-demo, trust domain demo.my2cents.internal |
| Template | The rule that builds a name from attested facts, plus its attestation policy | payments-eks: {aws:RequestedRegion}/eks/{ClusterName}/ns/{Namespace}/sa/{ServiceAccount} |
| Attestation policy | Which service may vouch (pods.eks.amazonaws.com, bedrock-agentcore.amazonaws.com) and which facts must match | cluster iamagents-demo, namespace payments |
AWS ships template definitions for the three services that can attest in the preview: Amazon EKS, AgentCore Runtime (with a per-session variant that gives every runtime session its own name) and AgentCore Gateway. The console’s Create provider page offers default templates for all three, and fills in a trust domain of default.<account-id>.aws.internal (the IAM docs say <account-id>.aws.internal). Either way, the default puts your account ID inside every name. Any domain that follows the rules works, and it doesn’t have to be one you own.

What happens when a workload starts
- The hosting service (EKS Pod Identity or AgentCore) collects facts about the workload: for EKS the cluster name and ARN, namespace, service account, pod name and UID, and node name.
- It sends them, with the template reference, to AWS STS (
IssueWorkloadIdentityContext). - STS checks the template’s attestation policy. If the facts don’t match, no identity is issued. Without a policy, nothing is issued at all.
- STS renders the name and the service calls
AssumeRoleon your existing role with that context. The IAM guide says the role’s trust policy doesn’t need to change. The EKS guide says to addsts:SetContextto the statement that lets EKS Pod Identity assume the role. My run worked without it.
The template’s attestation policy is the gate. You can change it at any time; the name format can’t be changed after the template is created.

The credentials a workload gets
| Credential | Used for | Checked by |
|---|---|---|
| IAM role session (SigV4) | AWS API calls | AWS, through aws:OriginIdentity/Subject and aws:OriginIdentity/Issuer |
| JWT-SVID | Bearer tokens for your APIs and SaaS | The receiver, with the provider’s JWKS at an OIDC issuer under workloads.tokens.sts.global.api.aws |
| X.509-SVID | mTLS | The peer, with the provider’s trust bundle; signing needs your own AWS Private CA |
All three are short-lived and renew on their own: a JWT-SVID lasts up to an hour, and an X.509-SVID on EKS is valid for 12 hours in the preview and can’t be revoked.
On EKS, the switch is per Pod Identity association: an IAM for agents and workloads setting on the association, in the console or through aws eks update-pod-identity-association. Once it is on, the association page shows the exact identifier the template renders for that service account.

What the Preview Can’t Do Yet
- Only EKS and AgentCore can attest. EC2, ECS and Lambda aren’t on the list of supported compute in the preview docs. The IAM guide says the feature is available in all commercial AWS Regions; for EKS, the EKS guide excludes Middle East (Bahrain) and Middle East (UAE).
- Revocation isn’t instant. Changing the attestation policy stops new identities; a running pod keeps its credentials until its role session renews (up to six hours, per the docs). The faster levers are a Deny on the role for that subject, which the docs say takes effect within about a minute, or revoking the role’s active sessions, which cuts off every workload on that role. Deleting the template stops session refreshes and new tokens, but doesn’t end a session already issued.
- Failed issuance isn’t logged in your account. The docs say it lands only in the attesting service’s account, and IAM publishes no CloudWatch metrics for the feature.
- Pod Identity target roles are off while it is on. The EKS console says a target IAM role can’t be set while IAM for agents and workloads is enabled, and the EKS guide says assuming a role in a different account through this path is not currently supported. The IAM guide still mentions a 59-minute session renewal for associations with a target role.
- X.509 costs extra. Identities are free in the preview, but X.509-SVIDs need a multi-Region AWS Private CA in service-affiliated mode, billed at AWS Private CA rates: $20 a month for the CA in that mode, plus a charge for each hour of certificate validity.
How It Compares
EKS Pod Identity already tags each role session with the namespace and service account (kubernetes-service-account and friends), so a policy could tell two pods apart before this launch. What IAM for agents adds is a name that an attestation policy you control decides to issue, a standard SPIFFE identity that works outside AWS as a JWT or a certificate, and a CloudTrail entry that records who the session acts on behalf of. Teams who wanted that until now ran SPIRE themselves; here AWS runs the issuer and the signing keys. For agents hosted on AgentCore, AgentCore Identity still handles the outbound OAuth side.
Verdict
IAM for agents fills a real gap: the role says what a workload may do, and now a separate, attested name says which workload is doing it, in policies, in CloudTrail and toward services outside AWS. The design builds on what IAM users already know (roles, trust policies, condition keys), and the console lays it out clearly, down to showing the exact identifier a pod will get.
It is a preview with a narrow reach: EKS and AgentCore only, revocation that waits for sessions to renew, and denied issuance you can’t see from your own account. If you run agents or many workloads on EKS under shared roles, it is worth trying now. Level 200 shows what that took and what I hit.
Level 200 · Walkthrough
Overview
This walkthrough sets up agent and workload identity on Amazon EKS, from the AWS CLI and the console, and checks four things with real runs: two pods that share one IAM role get different names, an S3 bucket policy lets only one of them in, a pod can mint a JWT-SVID for a service outside AWS, and CloudTrail names the workload behind each session. Then it tightens the attestation policy and watches the other pod lose its credentials. For what the feature is, its limits and how it compares, see Level 100.
Setup
I used a new EKS 1.37 cluster in us-east-1 with one t3.medium node and the EKS Pod Identity Agent add-on v1.5.0-eksbuild.3. A namespace payments holds two deployments, settlement and reporting, each with its own service account and its own Pod Identity association, both pointing at the same IAM role, payments-app. That role has no S3 permissions of its own, and one inline permission, sts:GetWebIdentityToken, so pods can mint tokens. The EKS guide also lists sts:SetContext in the role’s trust policy, sts:GetTrustBundles on the node role, AL2023 or Bottlerocket nodes (not Amazon Linux 2) and an IMDS hop limit of 1. My node ran AL2023, but neither STS action was in my setup: payments-app trusted pods.eks.amazonaws.com for sts:AssumeRole and sts:TagSession only, and the node role had only the standard managed policies. The steps below worked, but they get the JWT from STS rather than through the agent’s socket and use no X.509, so they don’t exercise the trust bundles that sts:GetTrustBundles reads. I didn’t check the IMDS hop limit.
Two prerequisites weren’t obvious:
- AWS CLI 2.43.1 or later. My 2.42.7 didn’t have the new commands, and the latest AWS CLI v1 (1.46.3) didn’t either.
- The add-on’s workload identity setting. After I enabled the identity on an association, new pods got stuck in
ContainerCreating, because the add-on doesn’t run the SPIFFE CSI driver until you turn it on. I didn’t find this in the docs pages I read:
MountVolume.SetUp failed for volume "eks-workload-identity-socket" : kubernetes.io/csi: mounter.SetUpAt failed to get CSI client: driver name spiffe.csi.eks.amazonaws.com not found in the list of registered CSI drivers
aws eks update-addon --cluster-name iamagents-demo --addon-name eks-pod-identity-agent \
--configuration-values '{"workloadIdentity":{"enabled":true}}'
Before anything else, both pods are the same role to AWS:
$ kubectl -n payments exec deploy/settlement -- aws sts get-caller-identity --query Arn --output text
arn:aws:sts::111122223333:assumed-role/payments-app/eks-iamagents--settlement-cf381bba-...
$ kubectl -n payments exec deploy/reporting -- aws sts get-caller-identity --query Arn --output text
arn:aws:sts::111122223333:assumed-role/payments-app/eks-iamagents--reporting--df194983-...
I replaced my account ID with AWS’s 111122223333 placeholder in every output below.
The Demo: One Role, Two Names
Step 1: A provider
In the console this is IAM → Agent and workload identity → Create provider. From the CLI, I used my own trust domain instead of the console’s default, so my account ID stays out of every name:
$ export PROVIDER_ARN=$(aws iam create-workload-identity-provider --provider-name payments-demo \
--scheme SPIFFE --workload-identity-domain demo.my2cents.internal --resource-scope ACCOUNT \
--query Arn --output text)
$ aws iam get-workload-identity-provider --workload-identity-provider-arn $PROVIDER_ARN \
--query '{Arn: Arn, Domain: WorkloadIdentityDomain, Signers: OutboundSigners.Jwt[].SigningAlgorithm, Issuer: OutboundSigners.OidcIssuerUri}'
{
"Arn": "arn:aws:iam::111122223333:workload-identity-provider/payments-demo",
"Domain": "demo.my2cents.internal",
"Signers": [
"RS256",
"ES384"
],
"Issuer": "https://a6gb4xxr5vo4lwrdvh.workloads.tokens.sts.global.api.aws"
}
The provider came with two JWT signing keys and its own OIDC issuer URL without any extra step.
Step 2: A template and its attestation policy
The template comes from AWS’s EKS definition. In the console it is Templates → Add templates → Amazon EKS → Add:
$ cat template.json
{
"TemplateDefinitionArn": "arn:aws:iam::aws:workload-identity-template-definition/eks.amazonaws.com/account-provider-default:1",
"ReplacementValues": {
"Name": {"Values": ["payments-eks"]},
"WorkloadIdentityProviderArn": {"Values": ["${PROVIDER_ARN}"]}
}
}
$ export TEMPLATE_ARN=$(aws iam create-workload-identity-template \
--template-definition "$(envsubst < template.json)" --query Arn --output text)
$ aws iam get-workload-identity-template --workload-identity-template-arn $TEMPLATE_ARN --query '{Name: Name, PathPattern: PathPattern}'
{
"Name": "payments-eks",
"PathPattern": "{aws:RequestedRegion}/eks/{aws:WorkloadAttestation/aws/eks/ClusterName}/ns/{aws:WorkloadAttestation/aws/eks/Namespace}/sa/{aws:WorkloadAttestation/aws/eks/ServiceAccount}"
}
The definition also writes a default attestation policy. In my trial run it allowed pods.eks.amazonaws.com with a single condition, aws:SourceAccount, so any EKS cluster in the account could get a name. get-workload-identity-template doesn’t return the policy; it has its own commands. I replaced it with one that pins the cluster and the namespace:
$ jq .Statement[0].Condition attestation-policy.json
{
"StringEquals": {
"aws:SourceAccount": "111122223333",
"aws:WorkloadAttestation/aws/eks/ClusterName": "iamagents-demo",
"aws:WorkloadAttestation/aws/eks/Namespace": "payments"
}
}
$ aws iam put-workload-identity-template-attestation-policy --workload-identity-template-arn $TEMPLATE_ARN \
--attestation-policy file://attestation-policy.json && echo policy saved
policy saved
The template page in the IAM console shows the same policy in a visual view, under its Attestation tab.
Step 3: Turn it on for both pods
In the console, this is the IAM for agents and workloads setting on each Pod Identity association’s Edit page. Both ARNs are required:
$ for a in $SETTLEMENT_ASSOC $REPORTING_ASSOC; do aws eks update-pod-identity-association \
--cluster-name $CLUSTER --association-id $a \
--workload-identity-config "{\"enabled\": true, \"templateArn\": \"$TEMPLATE_ARN\", \"providerArn\": \"$PROVIDER_ARN\"}" \
--query 'association.[serviceAccount, workloadIdentityConfig.enabled]' --output text; done
settlement True
reporting True
$ kubectl -n payments rollout restart deploy/settlement deploy/reporting
$ kubectl -n payments exec deploy/settlement -- printenv SPIFFE_ENDPOINT_SOCKET
unix:///var/run/secrets/pods.eks.amazonaws.com/workloadidentity/agent.sock
Restarted pods get a SPIFFE Workload API socket next to the usual Pod Identity variables. aws sts get-caller-identity inside the pod looks the same as before; the name isn’t in that output.
Step 4: A bucket only one workload can read
The bucket policy allows the shared role only when the session carries the settlement pod’s name, from my provider:
$ jq .Statement[0].Condition bucket-policy.json
{
"StringEquals": {
"aws:OriginIdentity/Subject": "spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement",
"aws:OriginIdentity/Issuer": "arn:aws:iam::111122223333:workload-identity-provider/payments-demo"
}
}
$ aws s3api put-bucket-policy --bucket $BUCKET --policy file://bucket-policy.json && echo bucket policy saved
bucket policy saved
$ kubectl -n payments exec deploy/settlement -- aws s3 cp s3://$BUCKET/ledger.txt -
settlement batch 2026-12-02: 42 payouts
$ kubectl -n payments exec deploy/reporting -- aws s3 cp s3://$BUCKET/ledger.txt -
download failed: s3://iamagents-demo-0907158c/ledger.txt to - An error occurred (403) when calling the HeadObject operation: Forbidden
Same role, same bucket: settlement reads the file, reporting gets a 403.
Step 5: A JWT-SVID for the world outside AWS
$ kubectl -n payments exec deploy/settlement -- aws sts get-web-identity-token --token-type JWT_SVID \
--audience https://ledger.example.com --signing-algorithm RS256 --duration-seconds 300 \
--query WebIdentityToken --output text > settlement.jwt
$ python3 jwt-claims.py settlement.jwt
alg RS256
iss https://a6gb4xxr5vo4lwrdvh.workloads.tokens.sts.global.api.aws
sub spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement
aud https://ledger.example.com
ttl 300 seconds
The reporting pod’s token carries .../ns/payments/sa/reporting as its subject. An API outside AWS can check either token against the issuer’s public keys, with no AWS credentials. jwt-claims.py is a ten-line script that decodes the token’s header and claims. Earlier, before reporting had an identity, the same call failed with a clear message:
An error occurred (AccessDenied) when calling the GetWebIdentityToken operation: The caller's session does not carry a workload identity.
Step 6: CloudTrail names the workload
A few minutes later, CloudTrail’s event history had the AssumeRole calls with the workload behind each:
$ aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=AssumeRole \
--start-time 2026-12-02T13:20:00Z --query 'Events[].CloudTrailEvent' --output json \
| jq -r '.[] | fromjson | select(.userIdentity.onBehalfOf) | [.eventTime, .userIdentity.onBehalfOf.subject] | @tsv'
2026-12-02T13:29:37Z spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement
2026-12-02T13:28:11Z spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/reporting
2026-12-02T13:28:05Z spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement
The same events are in the CloudTrail console under Event history. Filtered on IssueWorkloadIdentityContext, it lists one entry each time a pod got a name: three from this run and three from my trial run. The AssumeRole event at the same second as the newest one carries the name in userIdentity.onBehalfOf, with the template, the subject and the issuing provider:

The IssueWorkloadIdentityContext event: what EKS attested (a jq selection of the event, not its raw shape)
{
"invokedBy": "pods.eks.amazonaws.com",
"facts": {
"aws:WorkloadAttestation/aws/eks/PodUid": "75d8f02a-f23c-4084-b569-d5c3d6480c8c",
"aws:WorkloadAttestation/aws/eks/ServiceAccount": "settlement",
"aws:WorkloadAttestation/aws/eks/ClusterName": "iamagents-demo",
"aws:WorkloadAttestation/aws/eks/ClusterArn": "arn:aws:eks:us-east-1:111122223333:cluster/iamagents-demo",
"aws:WorkloadAttestation/aws/eks/Namespace": "payments",
"aws:WorkloadAttestation/aws/eks/PodName": "settlement-6767d89c5f-cq47b",
"aws:WorkloadAttestation/aws/eks/NodeName": "ip-172-31-8-111.ec2.internal"
},
"subject": "spiffe://demo.my2cents.internal/us-east-1/eks/iamagents-demo/ns/payments/sa/settlement"
}
Step 7: Take the name away
Finally, I narrowed the attestation policy to the settlement service account and restarted both deployments:
$ jq .Statement[0].Condition attestation-settlement-only.json
{
"StringEquals": {
"aws:SourceAccount": "111122223333",
"aws:WorkloadAttestation/aws/eks/ClusterName": "iamagents-demo",
"aws:WorkloadAttestation/aws/eks/Namespace": "payments",
"aws:WorkloadAttestation/aws/eks/ServiceAccount": "settlement"
}
}
$ aws iam put-workload-identity-template-attestation-policy --workload-identity-template-arn $TEMPLATE_ARN \
--attestation-policy file://attestation-settlement-only.json && echo policy saved
policy saved
$ kubectl -n payments rollout restart deploy/settlement deploy/reporting
$ kubectl -n payments exec deploy/settlement -- aws s3 cp s3://$BUCKET/ledger.txt -
settlement batch 2026-12-02: 42 payouts
$ kubectl -n payments exec deploy/reporting -- aws sts get-caller-identity --query Arn --output text
aws: [ERROR]: Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 400 from container metadata: [c2dd0ad2-...]: (AccessDeniedException): Unauthorized Exception! EKS does not have permissions to assume the associated role.
The reporting pod didn’t fall back to the plain role: it got no AWS credentials at all. That is the safe outcome, but the error points at the role, whose trust policy is fine, not at the attestation policy that refused the name. The refusal itself left no IssueWorkloadIdentityContext event in my account, as the docs warn: that event is recorded only in the account of the service that attested the workload. What CloudTrail does show is the pod’s failed credential fetch: an AssumeRoleForPodIdentity event from eks-auth.amazonaws.com, made by the node role, with AccessDenied, the same message and the same request ID as the error above. It names the cluster but gives no reason, pod or template, so it tells you something was refused, not why. To find the why, the IAM docs say to compare the attestation document in the failed event with the policy, but that event isn’t in your account. The EKS guide says to check the Pod Identity Agent logs on the node and compare the pod’s cluster, namespace and service account with the policy. An earlier, successful IssueWorkloadIdentityContext event of that service account shows the attested facts to compare. Before the restart, in my trial run, the running reporting pod kept working.
Cleanup
for a in $SETTLEMENT_ASSOC $REPORTING_ASSOC; do aws eks update-pod-identity-association \
--cluster-name $CLUSTER --association-id $a --workload-identity-config '{"enabled": false}'; done
aws iam delete-workload-identity-template --workload-identity-template-arn $TEMPLATE_ARN
aws iam delete-workload-identity-provider --workload-identity-provider-arn $PROVIDER_ARN
aws s3 rb s3://$BUCKET --force
aws eks delete-nodegroup --cluster-name $CLUSTER --nodegroup-name ng1
aws eks wait nodegroup-deleted --cluster-name $CLUSTER --nodegroup-name ng1
aws eks delete-cluster --name $CLUSTER
Then delete the IAM roles (payments-app, the cluster role and the node role). The identities themselves cost nothing in the preview; the cluster and its node were the whole bill, about 15 cents an hour.
Verdict
It works as described, and the pieces fit what IAM users already know. In about an hour, including the cluster, I had two pods on one role with two different names, a bucket that only one of them could read, a JWT-SVID an outside API could verify, and CloudTrail entries that name the workload behind each session. Narrowing the attestation policy cut the other pod off cleanly at its next start.
The rough edges are those of a preview: the add-on setting the getting-started steps didn’t mention, a revoked pod that fails with a message pointing at the wrong cause, get-caller-identity that doesn’t show the name, and EKS and AgentCore as the only hosts. If you run several agents or services under one role on EKS, start with one namespace: pin the attestation policy to it (the default lets any cluster in the account in), and write your first bucket or API policy against the name.
The my2cents.ai email
AI and cloud tools, tested for real. In your inbox once a week.
The week's hands-on tests and the launches that matter, in one email.