c5.4 Grant agents least-privilege roles with no escalation path
Scope each agent's IAM role to only the tools, resources, and secrets it needs, so a compromised or manipulated agent cannot escalate through unintended tool combinations.
Implementation guidance
How to implement on AWS
Assign AgentCore Runtime agents IAM roles with minimum permissions, scoped to specific tools/resources/secrets. Centralize tool access through AgentCore Gateway with a separate identity store for agents (OAuth Client Credentials), store client IDs/secrets in Secrets Manager, and scope outbound authorization (SigV4/OAuth scopes) to only the tools each agent may invoke. Authorize each tool call with AgentCore Policy (Cedar) at the gateway, which denies by default.
An autonomous agent inherits its role's reach
An agent acts on your behalf using its IAM role. If that role is broad — or, worse, holds permissions that let it change its own permissions — a manipulated or compromised agent doesn't just misuse what it has; it can escalate to more. Scope the role to only the tools, resources, and secrets the agent needs, and explicitly slam the door on the handful of permissions that enable privilege escalation.
Grant only what the agent's task requires
Start from nothing and add the specific actions and resource ARNs the agent uses — the same least-privilege discipline as the model-invoke and tool roles:
{
"Sid": "AgentTaskPermissions",
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "dynamodb:GetItem"],
"Resource": [
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20240620-v1:0",
"arn:aws:dynamodb:us-east-1:111122223333:table/AgentState"
]
}
Explicitly deny the escalation paths
A short, well-known set of IAM/STS actions turns a limited role into an admin one. Even if they are never granted, an explicit Deny guarantees a widened policy can't reintroduce them:
{
"Sid": "NoPrivilegeEscalation",
"Effect": "Deny",
"Action": [
"iam:CreatePolicyVersion",
"iam:SetDefaultPolicyVersion",
"iam:AttachRolePolicy",
"iam:PutRolePolicy",
"iam:AttachUserPolicy",
"iam:CreateAccessKey",
"iam:UpdateAssumeRolePolicy",
"iam:PassRole"
],
"Resource": "*"
}
iam:PassRole is the classic one — the ability to hand a more powerful role to a service the agent can invoke. If the agent legitimately must pass a role, scope the Allow for iam:PassRole to that one role ARN with a Condition on iam:PassedToService, rather than leaving it in the deny.
No self-assumption chains
Keep the agent's trust relationships tight so it cannot assume a broader role. Combine an explicit deny (or a scoped sts:AssumeRole to specific role ARNs) with a permission boundary (see the tool-roles control), so identity policy AND boundary both cap the ceiling.
Naming note: replace the model and table ARNs. If the agent needs iam:PassRole, remove it from the deny and add a narrowly scoped allow instead — do not grant broad PassRole.Acceptance criteria
Agent roles are least-privilege and scoped; gateway uses a separate agent identity store; OAuth scopes limit which tools each agent invokes; no broad escalation path exists. A tool call with no permitting policy is denied.
Practical implementation
How this control is implemented in each reference architecture:
Each agent in the Generative AI account gets a least-privilege IAM role and reaches tools only through AgentCore Gateway with a separate agent identity store and scoped OAuth.
- Assign AgentCore Runtime agents IAM roles with minimum permissions scoped to specific tools, resources, and secrets.
- Centralize tool access through AgentCore Gateway with a separate agent identity store (OAuth Client Credentials); store client IDs/secrets in Secrets Manager.
- Authorize each tool call at the gateway with AgentCore Policy: write Cedar policies that permit each agent identity (IAM or OAuth principal) to call only its own tools. Calls with no matching permit policy are denied by default.
- Scope outbound authorization (SigV4/OAuth scopes) to only the tools each agent may invoke, leaving no broad escalation path.
How to validate: Agent roles are least-privilege and scoped; the gateway uses a separate agent identity store; OAuth scopes limit which tools each agent invokes; chaining two tools cannot escalate. A tool call with no permitting policy is denied.
Avoid: A powerful shared agent role plus a permissive gateway. Scope the role and the OAuth scopes so tool chaining cannot escalate privilege.
Least-privilege agent roles plus AgentCore Gateway with a separate agent identity store and scoped OAuth keep agents from escalating within the account.
- Give each agent an IAM role scoped to only its tools, resources, and secrets.
- Route tool access through AgentCore Gateway with a separate agent identity store; keep client secrets in Secrets Manager.
- Authorize each tool call at the gateway with AgentCore Policy: write Cedar policies that permit each agent identity (IAM or OAuth principal) to call only its own tools. Calls with no matching permit policy are denied by default.
- Scope OAuth to only the tools each agent may invoke.
How to validate: Agent roles are least-privilege; the gateway uses a separate agent identity store; OAuth scopes limit tools; no broad escalation path exists. A tool call with no permitting policy is denied.
Avoid: Reusing the app role for agents. Give agents their own minimal roles and scope their tool access.
Threats addressed
- Excessive agency: an agent reaching resources beyond its task.
- Privilege escalation by chaining tools an agent should not combine.
AWS services
Pricing
IAM roles and policies are free; this is a design control with no cost. IAM Access Analyzer (useful to confirm no unused or escalation-capable permissions remain) has no charge for external-access analysis; unused-access analysis is billed per resource analyzed. See Least-privilege permissions.
Framework mappings
OWASP GenAI/LLM Top 10 (2026)
- LLM03 Excessive Agency
NIST AI Risk Management Framework (AI 100-1)
- MANAGE.1 AI risks are prioritized, responded to and managed
AWS Security Hub — AI Security Best Practices
- BedrockAgentCore.2 Bedrock AgentCore Gateways should require authorization for inbound requests
AWS Well-Architected Generative AI Lens (Security)
- GENSEC05-BP01 Implement least privilege and permission boundaries for agentic workflows
OWASP GenAI Top 10 for Agentic Applications (2025)
- ASI03 Identity and Privilege Abuse
Learning resources
References
- AWS SRA for AI — Capability 5, Identity and access management
AI Security Maturity Model