More Info:
Bedrock Agent Service Roles should prevent cross service confused deputyRisk Level
HighAddress
Monitoring, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- DPDPA
- Digital Operational Resilience Act (EU)
- ISO/IEC 27018
- ISO/IEC 27701
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- StateRAMP
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To prevent a cross‑service confused deputy for Amazon Bedrock Agents, you need to lock down the trust policy on the IAM service role used by your agents.Below are step‑by‑step instructions using the AWS Management Console.
Replace Make sure:
This remediation (adding
1. Identify the Bedrock Agent service role(s)
- Sign in to the AWS Management Console.
- Open Amazon Bedrock.
- In the left navigation, choose Agents.
- For each agent:
- Click the agent name.
- Go to the Agent configuration or Permissions section.
- Note the IAM role shown as the service role used by the agent.
Example:AmazonBedrockAgentExecutionRoleor similar.
2. Open the role in IAM
- Open the IAM console.
- In the left navigation, choose Roles.
- Search for the role name you noted (e.g.,
AmazonBedrockAgentExecutionRole). - Click the role name.
3. Restrict the trusted principal to Bedrock only
- In the role details, go to the Trust relationships tab.
- Click Edit trust policy.
- Make sure the
Principalis only Amazon Bedrock, not a broader service list.
It should look like this:
123456789012 with your AWS account ID.If your agent is in a single Region and you want to be stricter, you can use:- There is no other service listed in
Principal.Service. - There is no wildcard
*principal.
4. Save the trust policy
- After editing, click Update policy (or Save changes).
- Repeat steps 2–4 for every Bedrock Agent service role you use.
5. (Optional) Re‑associate or test agents
- Return to the Amazon Bedrock console.
- Open an agent that uses this role.
- Run a test invocation (e.g., “Test agent” or “Invoke”) to verify the agent still functions.
- Watch CloudWatch Logs for any access‑denied issues if you changed other permissions.
This remediation (adding
aws:SourceAccount and aws:SourceArn conditions and limiting Principal.Service to bedrock.amazonaws.com) is what prevents a confused deputy scenario for Bedrock Agent service roles.Using CLI
Using CLI
To prevent confused‑deputy issues for Amazon Bedrock Agents, you must restrict the IAM role trust policy that Bedrock assumes, using
Assume the role name is:
You’ll edit a new file instead of overwriting this backup.
Get the Agent ARN(s). For example (Agents API):Pick the relevant ARN or use a prefix pattern. Example agent ARN:Create a new file Adjust:If this role is also used by other Bedrock features (e.g., knowledge bases), add separate statements for each service/ARN pattern instead of broadening the existing one.
Confirm:
If you share the exact current trust policy JSON, I can give you a precise before/after version tailored to your account, region, and agent IDs.
aws:SourceAccount and aws:SourceArn conditions.Below are step‑by‑step AWS CLI instructions.1. Identify the Bedrock Agent service role
If you already know the role name, skip to step 2.Common patterns:AmazonBedrockExecutionRoleForAgents_*- A custom role specified when you created the agent.
2. Get the current trust policy
3. Construct a secure trust policy
You must:- Keep the correct service principal:
bedrock.amazonaws.com - Add both:
aws:SourceAccount– your AWS account IDaws:SourceArn(orArnLike/ArnEquals) – specific Bedrock Agent ARN(s)
bedrock-agent-trust-policy.json with content like:- Region:
us-east-1→ your region - Account:
123456789012→$ACCOUNT_ID agent/*→ specific agent ID if you want to restrict to one:
4. Apply the updated trust policy
5. (Optional) Verify the applied trust policy
Principal.Serviceisbedrock.amazonaws.comConditionincludes:aws:SourceAccount= your account IDaws:SourceArnrestricted to your Agent ARN(s)
If you share the exact current trust policy JSON, I can give you a precise before/after version tailored to your account, region, and agent IDs.
Using Python
Using Python
To prevent cross-service confused deputy issues for AWS Bedrock Agents, you must tighten the trust policy of the Agent’s service role so that only your account and your Bedrock agents can assume it. Below is how to do that with Python (boto3).
This ensures:
Python script (e.g., Run:
If you share the exact role name(s) or how you create Bedrock Agents (CDK, CloudFormation, console, etc.), I can adapt the Python example to generate/create the role as well, not just update it.
1. Decide the correct trust policy
Replace123456789012 with your AWS account ID and set the Region(s) as needed (* is fine if you use multiple Regions):- Only Bedrock in your account can assume the role.
- Only ARNs that match your Bedrock agents can use it (prevents confused deputy).
2. Python script to update an existing Bedrock Agent service role
Install dependencies:fix_bedrock_agent_trust.py):3. Verify the change
- In the AWS console, go to IAM → Roles → your Bedrock Agent role.
- Check the Trust relationships tab.
- Confirm:
- Principal:
Service: bedrock.amazonaws.com - Conditions include
aws:SourceAccountandaws:SourceArnas shown above.
- Principal:
If you share the exact role name(s) or how you create Bedrock Agents (CDK, CloudFormation, console, etc.), I can adapt the Python example to generate/create the role as well, not just update it.

