AWS IAM for agents: two agents, one role, two identities
Two Amazon Bedrock AgentCore runtimes share one IAM execution role. An S3 bucket policy tells them apart by workload identity (preview).
AWS Cloud
Region us-east-1
VPC
Private subnet
One shared IAM execution role
Operator
make demo
AWS IAM and AWS STS
AgentCore attests each runtime,
STS adds its identity to the role session
AgentCore runtime agentA
identity .../runtime/agentA/...
AgentCore runtime agentB
identity .../runtime/agentB/...
VPC endpoint
for Amazon S3
Amazon S3 bucket
bucket policy conditions on
aws:OriginIdentity/Subject
AWS CloudTrail
trail with S3 data events,
log file validation
agentA allowed
agentB AccessDenied
1
2
3
4
5
6
1
2
3
4
5
6
LINES
Request
Denied by the bucket policy
Identity issued
Audit events
FLOW
The operator invokes agentA and agentB with the same request.
Each runtime gets its own identity on its session of the shared role.
agentA reads the object: its identity matches the bucket policy condition.
agentB gets AccessDenied: same role, different identity.
CloudTrail records which runtime got which role session (GetIAMWorkloadIdentityCredentials).
The trail also records the S3 data events for both calls.