More Info:
Bedrock Agents should use Bedrock Guardrails to protect agent sessionsRisk Level
HighAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- 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
Below are concise, step‑by‑step instructions to ensure an Amazon Bedrock Agent uses a Bedrock Guardrail from the AWS Management Console.
1. Create (or Verify) a Guardrail
- Sign in to the AWS Management Console and open Amazon Bedrock.
- In the left navigation pane, choose Guardrails.
- Click Create guardrail.
- Configure:
- Name and optional description.
- Content filters (e.g., violence, hate, sexual content) and their severities.
- Any topic filters, PII protection, or contextual rules you need.
- Click Create to save the guardrail.
- On the guardrail’s detail page, note:
- The Guardrail ID.
- The Version (e.g.,
1).
2. Attach the Guardrail to a Bedrock Agent
- In the same Amazon Bedrock console, in the left navigation pane, choose Agents.
- Click the Agent you want to protect.
- Go to the Agent configuration or Agent details page.
- Look for the Guardrails section (or Safety / Guardrail configuration depending on the current console UI).
- Choose Edit or Attach guardrail.
- In the Guardrail drop‑down:
- Select the Guardrail ID you created/verified.
- Select the Guardrail version (for example,
1).
- Save or Update the agent configuration.
3. (If Needed) Update Agent Aliases to Use the Guardrail
If your application calls a specific alias:- In the Agents page, select your agent.
- Go to the Aliases tab.
- Select the alias used by your application.
- Choose Edit (or Update).
- Ensure it is using the latest agent version that has the guardrail attached.
- Save the alias settings.
4. Test the Guardrail
- From the Agent detail page, use Test agent (or Chat / Playground, depending on UI).
- Send prompts that might trigger the configured filters.
- Confirm the responses are blocked, redacted, or modified according to your guardrail rules.
Using CLI
Using CLI
Below are the minimal AWS CLI steps to ensure a Bedrock Agent is using a Bedrock Guardrail to protect its sessions.
This returns JSON including:Note the
Output will include something like:Note the
Edit Then run:
You should see:This remediates the finding: the Bedrock Agent is now using a Bedrock Guardrail for its sessions.
1. Create (or identify) a Guardrail
If you already have a guardrail, skip to step 2.guardrailId.2. Create a Guardrail Version
Guardrails must use a version when attached to an agent.version (e.g., "1").3. Attach Guardrail to an Existing Bedrock Agent
First, get the current agent config:agent.json and prepare an input JSON for update-agent. You cannot pass the full output of get-agent back into update-agent; instead create a minimal config file, e.g. update-agent.json:4. (If Needed) Attach Guardrail When Creating a New Agent
You can attach the guardrail at creation time:5. Verify Guardrail Is Attached
Using Python
Using Python
To remediate this, you need to (1) create/configure a Bedrock Guardrail, and (2) attach it to your Bedrock Agent (or Agent alias) so all sessions use it. Below are the step-by-step actions and Python examples using
If you already have a guardrail, you can list or get it:
Guardrails applied at the Agent or alias level protect all sessions using that Agent configuration, which resolves the misconfiguration.
boto3.1. Prerequisites
-
Install/upgrade
boto3: -
Ensure your AWS credentials/region are configured and that the role/user has permissions like:
bedrock:CreateGuardrailbedrock:UpdateGuardrailbedrock:GetGuardrailbedrock:CreateAgentbedrock:UpdateAgentbedrock:CreateAgentAlias/bedrock:UpdateAgentAliasbedrock:GetAgent/bedrock:GetAgentAlias
-
Import and create the client:
2. Create a Guardrail (or Retrieve Existing One)
You must have a Guardrail ID and version to attach to the Agent.2.1 Create a new Guardrail
Adjust the config to your policy (content filters, PII, allowed topics, etc.). This is a minimal example:3. Attach Guardrail to the Agent
When creating or updating an Agent, specifyguardrailConfiguration.3.1 Create a new Agent with Guardrail
3.2 Add Guardrail to an Existing Agent
4. (Optional) Attach Guardrail via Agent Alias
You can also bind the guardrail when creating/updating an alias so that specific aliases of the same agent use a particular guardrail version.4.1 Create Alias with Guardrail
4.2 Update Alias Guardrail
5. Verify Guardrail Usage
- Call your Agent/Agent alias using
bedrock-runtimeand send content that should be blocked or masked. - Check that:
- Responses are blocked or redacted accordingly.
- Messages from the guardrail (
blockedInputMessaging/blockedOutputsMessaging) appear.

