Est.

AWS Bedrock Agent Security Controls and IAM Role Scoping

Scoped IAM roles set an agent's real blast radius, not prompts.

· 8 min read
Cover illustration for “AWS Bedrock Agent Security Controls and IAM Role Scoping”
AI Security Observability · November 17, 2026 · 8 min read · 1,735 words

AWS Bedrock agent security starts with IAM role scoping, because an agent acts through permissions. Action groups, guardrails, session isolation, logging, and private networking each protect a different boundary. Together, they form a workable security model only when the identities underneath them have no more access than their tasks require.

Why Bedrock agents are a non-human identity problem before they are an AI problem

When Bedrock takes an agent instruction and begins calling services, the conversation becomes an execution path. The agent operates as a non-human identity through an IAM role, and it can chain service calls within a single interaction. The prompt does not define the blast radius. The role does, which makes the IAM review discipline used for privileged service accounts the right starting point for agents.

AWS documentation states that, as of November 2026, sign-up for Amazon Bedrock Agents, now called Amazon Bedrock Agents Classic, has closed. Existing customers can continue using it, while AWS directs new builds to Amazon Bedrock AgentCore. That distinction sets the scope of this article. The agent configuration controls below apply to Agents Classic unless the text names AgentCore.

How the multi-layer IAM surface is structured across a Bedrock deployment

A Bedrock deployment has at least four independently grantable IAM layers. At the application or user layer, the caller needs bedrock:InvokeAgent scoped to the specific agent-alias ARN it should invoke. That boundary governs entry into the agent. The agent service role then permits orchestration model invocation, reading OpenAPI schemas from S3, retrieving knowledge base content, applying guardrails, and invoking collaborator aliases.

The Knowledge Base service role governs a separate boundary, namely the data sources and embedding models the knowledge base can reach. It does not inherit the agent service role. At the tool layer, a Lambda resource-based policy sets who can invoke the function, while its execution role sets what the function can change downstream. Permission to ring the doorbell is not permission to rearrange the house.

Trust policies determine which principals can assume each role, so permission policies alone do not establish a sound boundary. Administration adds another route into these permissions. Builders who create or update agents need iam:PassRole, which creates a privilege escalation risk when broadly granted. The recommended scope is named agent roles, with the iam:PassedToService condition set to bedrock.amazonaws.com.

Why over-scoped agent roles accumulate in production and what that costs

Permission drift often begins after a reasonable deployment. An agent built for data lookup gains workflow automation, infrastructure APIs, or access to new datasets, but its role does not receive a matching review. Over time, the role describes the agent’s accumulated history rather than its current job, and a compromised agent can exploit that difference.

Generated roles can make that accumulation harder to see. Unit 42 found that the AWS AgentCore starter toolkit auto-generates roles with wildcard access to memory, Code Interpreters, and ECR repositories. Those grants let agents access each other’s data and reach execution contexts that have more privileges. In Agents Classic, broadly scoped bedrock:InvokeAgent likewise lets one application role invoke agents beyond the one it was meant to invoke.

The governance response belongs at the point of change. Repurposing should trigger a new approval, with the role reviewed against the new task’s data and service scope before production use. The date an agent first went live says little about what it can access now.

Specific IAM permissions that can rewrite live agent behavior without a code deployment

Six permissions deserve particular restriction because they can change live behavior without a code deployment. bedrock:UpdateAgent can rewrite the agent’s base prompt and expose system instructions, while bedrock:UpdatePrompt can modify live prompt templates without redeployment. Application service accounts should hold neither.

The same separation applies to guardrail and tool administration. bedrock:UpdateGuardrail can weaken content filters and safety controls, while bedrock:DeleteGuardrail can remove guardrail enforcement. bedrock:CreateAgentActionGroup can attach malicious Lambda tool executors. Finally, bedrock:UpdateFlow can add or change S3 Storage, Lambda, or Condition nodes to siphon data or bypass authorization. A release pipeline is not the only way to change what an agent does.

All six permissions should be held only by CI/CD deployment roles with tight conditions on their use, keeping them out of application service accounts. IAM Access Analyzer provides more than 100 policy checks to help validate policies and surface permission combinations that create privilege escalation paths. Service Control Policies can restrict where Bedrock APIs run and which accounts may invoke or deploy agents, setting a maximum permission boundary that individual role policies cannot override.

Designing action groups so the tool surface does not exceed the agent's actual task

An action group defines what the agent can attempt through a tool. Whatever its Lambda execution role or return-control handler can do becomes part of that operational surface. When one Lambda function routes an action group’s reads and writes through the same execution role, what looks like a simple API design choice gives both the same privileges.

If it accepts a free-form query, the model gains room to exercise the execution role’s full database access. A narrow cancelBooking(bookingId) tool exposes the intended task instead. The recommended design separates reads and writes into different action groups, Lambda functions, and execution roles, with each role limited to the downstream calls its function needs.

The Lambda resource-based policy should use aws:SourceAccount and aws:SourceArn conditions that replace agent/* with real agent IDs to restrict the invoking agent. AWS documents requireConfirmation set to ENABLED as a way to guard against malicious instructions in API or knowledge base responses by requiring user confirmation before the action group function runs.

What guardrails control, what they cannot control, and how to configure them so the distinction is clear

Guardrails screen model inputs and outputs. Their controls include content filtering, denied topics, word and pattern filters, PII detection and redaction, grounding verification, and automated reasoning checks. None narrows the role’s AWS access. Conversely, a tightly scoped role does not prevent undesirable model content, so neither layer can stand in for the other.

Guardrail enforcement also depends on protected configuration. A principal able to weaken or delete a guardrail can undo the model-layer protection. The administrative restrictions above therefore come first. Attachment is not automatic. An Agents Classic deployment must attach its guardrail through guardrailConfiguration for content rules to take effect on the agent, even if the guardrail is already defined at the account level.

AWS’s AgentCore defense-in-depth design combines Bedrock IAM with a required guardrail on model calls, so invocation cannot proceed without the specified protection. That coupling is the architecture to reproduce in Classic deployments, rather than treating guardrail attachment as an optional convention. Pre-processing needs attention too. Its prompt is disabled by default and should be enabled to filter malicious instructions before orchestration begins.

Session state, memory isolation, and why identity must come from the application layer

The application must establish who the user is. A model may process identity attributes, but it cannot be trusted to bind a session to the authenticated person who started it. In Agents Classic, sessionAttributes persist for the session, while promptSessionAttributes last one turn and enter the orchestration prompt. Both should be set only by the application or Lambda, never derived from model output.

The application should pass authenticated user identity in sessionAttributes, bind sessionId and memoryId to that user, and make tools decide access from those attributes. A memoryId stores session summaries across sessions for a configurable retention period, so one memoryId per user is the intended boundary. Shared or unscoped values create paths for cross-user leakage.

The earlier AgentCore wildcard finding shows why application separation also needs an IAM boundary. Unit 42 identified GetMemory and RetrieveMemoryRecords grants across wildcard memory resources, allowing cross-agent reading. Supervisor arrangements add another identity relationship, so bedrock:InvokeAgent on the supervisor role should replace agent/* with collaborator agent-alias ARNs.

Logging and observability controls that must be switched on explicitly

Model invocation logging and agent runtime CloudTrail data events are disabled by default. A running deployment therefore does not, by itself, establish a durable record of model interactions and runtime activity. Visibility requires explicit configuration at both points. Model invocation logging should be enabled through PutModelInvocationLoggingConfiguration, with output routed to S3 or CloudWatch Logs.

Runtime coverage needs its own switch. InvokeAgent and RetrieveAndGenerate are CloudTrail data events and must be enabled separately from model invocation logging. Without those records, reviewers lack the runtime evidence they need to see how agents were used and what happened as a result. Customer-managed encryption also requires explicit configuration rather than an assumption that deploying Bedrock has selected a customer-managed key.

GuardDuty AI Protection covers anomalous model invocations, cost harvesting attacks, and direct prompt injection attempts. The GuardDuty Foundational plan covers guardrail removal and disabled invocation logging, so the distinction between those plans affects which signals are available. Observability is part of permission governance because reviewers need evidence of how an identity is used.

Network isolation controls that keep Bedrock traffic off the public internet

Private networking governs the route to Bedrock, while IAM governs access to its resources. AWS PrivateLink with interface VPC endpoints keeps application requests and responses on the AWS private backbone. The same principle applies to private knowledge base access, including OpenSearch Serverless. An ECS-hosted application can therefore reach Bedrock through a private data path. That path complements scoped permissions, but it does not make an excessive grant safe.

How the control layers compose into a governance posture that scales beyond a single agent

Agent sprawl turns isolated permission decisions into an organizational problem. Copying an agent’s role carries over assumptions about what it needs to access that may not fit the next task, and leaving logging unconfigured makes another identity hard to review. Each new agent should have its own role, a review of its trust policy, and logging configured for it.

The other layers then attach to that identity boundary. Logging supplies runtime evidence, while private networking confines the traffic path. Each control has a distinct job, which makes the model repeatable without pretending that one successful check proves the whole deployment safe.

AgentCore introduces its own workload identity directory, authorizer, and Cedar policy evaluation layer, so its role model and gateway authorization path are not interchangeable with those of Agents Classic. The IAM-first principle survives the move. Individual configurations do not transfer by assumption. Across multiple AWS accounts, Service Control Policies provide the highest-leverage common boundary by constraining Bedrock use regardless of individual role configurations.

Sources

  1. Defence in Depth for Agents running on Amazon Bedrock AgentCore

More in AI Security Observability