<AWS just opened a brand-new front door into your account for AI agents — and almost nobody has tested what is actually behind it.
At re:Invent 2026, AWS announced three things aimed squarely at the "agents running loose in an AWS account" problem: IAM for Agents (preview), a new way to scope what an autonomous agent can do, separate from the human or service role it acts on behalf of; AWS Greenlight, a governance layer meant to approve or deny agent actions before they execute; and AWS Context (general availability), plumbing for agents to carry structured context — who asked, why, under what constraints — through a call chain.
That is the pitch. This post is not a feature tour. It is the findings part: what can you actually verify, today, in a sandbox account, before anyone lets an agent near production?
The problem IAM for Agents is trying to solve
Right now, most "AI agent" setups in AWS do not have their own identity. An agent calls the AWS SDK using whatever role its host process already has: a Lambda execution role, an EC2 instance profile, a human's assumed role via a long-lived credential. That means an agent's blast radius is identical to its host's blast radius. If the agent hallucinates a destructive call, or a prompt injection convinces it to run something it should not, IAM has no way to tell "the agent did this" apart from "the application did this." There is no scoping hook that says: this specific agent, this specific run, this specific task, gets this specific set of permissions and nothing else.
That is the real gap. Whatever AWS ships under the "IAM for Agents" name, the question worth testing is whether it gives you a genuinely separate, revocable, least-privilege identity per agent run — or whether it is a thin label on top of the same role-assumption mechanics that already exist.
What you can test today without waiting for the preview
You do not need access to a brand-new preview feature to start answering that question. The underlying primitives — STS session tags, session policies, and the IAM policy simulator — already exist in every AWS account and are exactly what a well-built "agent identity" layer would have to be built on. Here is a concrete way to sandbox-test an agent-scoped identity right now, so when the preview lands you already know what to compare it against.
Step 1: give the agent a scoped, tagged session instead of a bare role
Instead of handing an agent process the same long-lived role your application uses, assume a dedicated role per agent run and tag the session with the specifics of that run — which agent, which task, which ticket or workflow triggered it. Session tags become condition keys you can enforce in the policy itself.
import boto3
import uuid
sts = boto3.client("sts")
def assume_agent_session(agent_name: str, task_id: str, duration_seconds: int = 900):
"""Create a short-lived, tagged session for one agent run.
The session tags are not just metadata -- they become
aws:PrincipalTag/* condition keys that the role's trust
policy and any attached permission policies can check.
"""
response = sts.assume_role(
RoleArn="arn:aws:iam::111122223333:role/agent-sandbox-role",
RoleSessionName=f"agent-{agent_name}-{uuid.uuid4().hex[:8]}",
DurationSeconds=duration_seconds,
Tags=[
{"Key": "AgentName", "Value": agent_name},
{"Key": "TaskId", "Value": task_id},
{"Key": "Scope", "Value": "sandbox-readonly"},
],
)
creds = response["Credentials"]
return boto3.Session(
aws_access_key_id=creds["AccessKeyId"],
aws_secret_access_key=creds["SecretAccessKey"],
aws_session_token=creds["SessionToken"],
)
agent_session = assume_agent_session(agent_name="triage-bot", task_id="JIRA-4821")
s3 = agent_session.client("s3")
print(s3.list_buckets()["Buckets"])Step 2: write the permission boundary around the session tags, not the role name
This is the part teams skip. A role is only as scoped as the policy attached to it. The policy below only allows S3 reads, and only when the caller's session carries a Scope=sandbox-readonly tag and the request stays inside a specific prefix tied to the TaskId tag. Change the task, change the prefix you can touch.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AgentScopedReadOnly",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:ListBucket"],
"Resource": [
"arn:aws:s3:::agent-workspace-bucket",
"arn:aws:s3:::agent-workspace-bucket/${aws:PrincipalTag/TaskId}/*"
],
"Condition": {
"StringEquals": {
"aws:PrincipalTag/Scope": "sandbox-readonly"
}
}
},
{
"Sid": "DenyEverythingElseExplicitly",
"Effect": "Deny",
"NotAction": ["s3:GetObject", "s3:ListBucket"],
"Resource": "*"
}
]
}Step 3: prove the boundary holds before an agent ever calls the real API
Use the IAM policy simulator to test the policy against the actions you are worried about — destructive ones especially — before the agent gets anywhere near live credentials. This catches the common mistake of an explicit allow somewhere else in the account quietly overriding your scoped deny.
import boto3
iam = boto3.client("iam")
def check_agent_cannot_delete(role_arn: str, resource_arns: list[str]):
"""Fail loudly if the agent role can run destructive S3 actions
against anything, including resources outside its intended scope.
"""
risky_actions = [
"s3:DeleteObject",
"s3:DeleteBucket",
"s3:PutBucketPolicy",
"iam:PassRole",
]
result = iam.simulate_principal_policy(
PolicySourceArn=role_arn,
ActionNames=risky_actions,
ResourceArns=resource_arns,
)
denied = [
r for r in result["EvaluationResults"]
if r["EvalDecision"] != "explicitDeny" and r["EvalDecision"] != "implicitDeny"
]
if denied:
raise AssertionError(f"Agent role has unexpected access: {denied}")
print("OK: agent role cannot perform any of", risky_actions)
check_agent_cannot_delete(
role_arn="arn:aws:iam::111122223333:role/agent-sandbox-role",
resource_arns=["arn:aws:s3:::agent-workspace-bucket/*", "*"],
)Run that before wiring the agent framework to real credentials, and again after any policy change. It takes seconds and it is the cheapest insurance against "the agent could technically delete the bucket" turning into "the agent deleted the bucket."
What to actually check once IAM for Agents is in front of you
- Is the agent identity separately revocable? If you cannot kill one agent's access without touching the human or service role behind it, it is not a separate identity — it is a label.
- Does it scope by run, or just by agent? A per-agent role is better than nothing, but a per-task, per-run identity (like the session-tag pattern above) is what actually bounds a single bad decision.
- Can Greenlight's approval step be bypassed by calling the underlying AWS API directly? A governance layer that sits beside IAM, rather than being enforced inside IAM policy evaluation, is advisory, not a control. Test whether a denied-by-Greenlight action still succeeds via a raw SDK call.
- What does AWS Context actually carry, and is it trusted input? If "who asked and why" travels as a header or tag an agent itself can set, it is not an audit trail — it is agent-supplied metadata, and policies should never condition on it as if it were verified.
- What is the default when the preview feature is unavailable or misconfigured? Fail-open defaults on a brand-new access-control surface are the single most common way a new security feature makes things worse, not better, in its first few months.
The takeaway
A new access-control surface for autonomous agents is a genuinely good problem for AWS to be working on — the gap it is aimed at is real. But "new IAM surface" and "trustworthy IAM surface" are not the same claim, and the second one only gets answered by testing, not by reading the launch blog. The session-tag and policy-simulator pattern above is not a workaround to use until the preview arrives; it is the baseline every agent identity scheme, AWS-native or not, should be measured against.
Check IAM for Agents in a sandbox account before trusting it in prod.

Experienced DevOps Engineer proficient in Python, Docker, Kubernetes, CI/CD, and cloud technologies. Specialized in automating processes and building scalable infrastructure for seamless development and deployment.


