Bedrock Guardrail Prompt Attack Strength Should Not Be Low
More Info:
Bedrock guardrail prompt attack strength should not be low
Risk Level
High
Address
Security
Compliance 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
To remediate “Bedrock Guardrail Prompt Attack Strength Should Not Be Low” in the AWS console, you need to edit the guardrail and change the Prompt attack protection strength from Low to Medium or High.
Follow these steps:
-
Open the Bedrock console
- Go to: https://console.aws.amazon.com/bedrock/
- Make sure you’re in the correct AWS Region (top‑right of the console).
-
Navigate to Guardrails
- In the left navigation pane, select Guardrails.
-
Select the affected guardrail
- In the Guardrails list, find the guardrail that your security tool flagged.
- Click the Guardrail name to open its details.
-
Edit the guardrail
- On the guardrail detail page, choose Edit (top right).
-
Locate Prompt attack protection settings
- In the edit view, scroll to the Safety and content filters (or similar) section.
- Find the Prompt attack protection (or Prompt attack safety) configuration.
- There will be a Strength setting with options like Low, Medium, and High.
-
Change the strength
- Change Prompt attack protection strength from Low to Medium or High.
- Ensure the setting is not left at Low for any enabled models/usages under this guardrail.
-
Save the guardrail
- Scroll down and click Save changes.
- If prompted, confirm the update.
-
Re‑validate
- Re-run your security/compliance scan or check your policy evaluation to verify the finding is cleared.
If your environment uses multiple guardrails, repeat these steps for each one that has Prompt attack protection set to Low.
Using CLI
To remediate “Bedrock Guardrail Prompt Attack Strength Should Not Be Low” using AWS CLI, you need to update the guardrail’s contextual grounding / prompt‑attack configuration so that the strength/threshold is MEDIUM or HIGH instead of LOW.
Below is a minimal, step‑by‑step approach.
1. Identify the guardrail
If you already know the Guardrail ID, skip to step 2.
List all guardrails:
aws bedrock list-guardrails
Note the guardrailId (and optionally name) of the guardrail you need to fix.
2. Get the current guardrail configuration
GUARDRAIL_ID="your-guardrail-id"
aws bedrock get-guardrail \
--guardrail-identifier "$GUARDRAIL_ID" \
--guardrail-version "DRAFT" \
> guardrail-current.json
If there is no DRAFT version, you can fetch the latest version instead:
aws bedrock get-guardrail \
--guardrail-identifier "$GUARDRAIL_ID" \
--guardrail-version "1" \
> guardrail-current.json
3. Edit the prompt‑attack / contextual‑grounding section
Open guardrail-current.json in an editor.
Look for the contextual grounding / prompt attack configuration, which typically looks like one of these patterns (names may slightly vary depending on API version):
Pattern A (filters list):
"contextualGroundingPolicyConfig": {
"contextualGroundingFiltersConfig": [
{
"type": "INJECTION",
"threshold": "LOW"
},
{
"type": "HALLUCINATION",
"threshold": "LOW"
}
]
}
Change any "threshold": "LOW" for the prompt‑attack / injection type(s) to "MEDIUM" or "HIGH", for example:
"contextualGroundingPolicyConfig": {
"contextualGroundingFiltersConfig": [
{
"type": "INJECTION",
"threshold": "HIGH"
},
{
"type": "HALLUCINATION",
"threshold": "MEDIUM"
}
]
}
Or, if your guardrail uses a direct “strength” setting such as:
"promptAttackProtection": {
"strength": "LOW"
}
Change it to:
"promptAttackProtection": {
"strength": "MEDIUM"
}
Do not change the guardrailId, arn, status, version, or timestamps; just adjust the relevant thresholds/strength.
Save the edited file as guardrail-updated.json.
4. Remove read‑only fields before update
The get-guardrail output usually contains read‑only fields (like status, version, arn, createdAt, updatedAt). These must not be passed into update-guardrail.
Either:
- Manually delete those read‑only keys from
guardrail-updated.json, keeping only the updatable fields such as:namedescriptioncontentPolicyConfigcontextualGroundingPolicyConfigsensitiveInformationPolicyConfigtopicPolicyConfigblockedInputMessaging,blockedOutputsMessaging, etc.
Or:
- Create a minimal update file that only contains the fields you want to change (e.g. just
contextualGroundingPolicyConfigplusguardrailIdandname/descriptionif needed).
Example minimal guardrail-updated.json:
{
"guardrailIdentifier": "your-guardrail-id",
"description": "Updated to strengthen prompt attack protection",
"contextualGroundingPolicyConfig": {
"contextualGroundingFiltersConfig": [
{
"type": "INJECTION",
"threshold": "HIGH"
},
{
"type": "HALLUCINATION",
"threshold": "MEDIUM"
}
]
}
}
5. Apply the update
aws bedrock update-guardrail \
--cli-input-json file://guardrail-updated.json
Confirm no errors are returned.
6. (Optional) Publish a new version
If your workflows require a non‑DRAFT version:
aws bedrock create-guardrail-version \
--guardrail-identifier "$GUARDRAIL_ID"
Note the new version from the output. Use this version when configuring Bedrock model invocations.
7. Verify
Re-fetch to ensure config is set correctly:
aws bedrock get-guardrail \
--guardrail-identifier "$GUARDRAIL_ID" \
--guardrail-version "DRAFT"
Confirm that the prompt attack / INJECTION threshold or strength is MEDIUM or HIGH, not LOW.
Using Python
To remediate this, you need to update the Guardrail configuration so that the Prompt Attack protection strength is not LOW (set it to MEDIUM or HIGH) using the Bedrock control-plane API (not the runtime).
Below is a minimal, step‑by‑step approach in Python using boto3.
1. Install and configure AWS credentials
pip install boto3
Make sure your AWS CLI/SDK credentials and region are configured (and that your IAM role/user can bedrock:GetGuardrail and bedrock:UpdateGuardrail).
aws configure
2. Initialize the Bedrock client in Python
import boto3
bedrock = boto3.client("bedrock", region_name="us-east-1") # use your region
3. Get the existing Guardrail config
You need the guardrailIdentifier (ID or ARN) and (optionally) guardrailVersion.
GUARDRAIL_ID = "gr-xxxxxxxx" # your Guardrail ID or ARN
resp = bedrock.get_guardrail(
guardrailIdentifier=GUARDRAIL_ID,
guardrailVersion="DRAFT" # or a specific version if needed
)
# Inspect current prompt attack settings in resp
print(resp)
Look for the section related to prompt attack protection (names can differ slightly depending on SDK version; examples):
promptAttackProtectionpromptAttackSettings- or a similarly named structure under guardrail config.
4. Modify the prompt attack strength
You must change the strength from LOW to MEDIUM or HIGH.
The exact field name can differ by SDK version; conceptually it looks like:
updated_prompt_attack_settings = {
"status": "ENABLED", # previously maybe ENABLED already
"strength": "MEDIUM", # change from LOW → MEDIUM or HIGH
# ...copy any other required fields from resp...
}
You should start from the current structure returned by get_guardrail, modify only the relevant field(s), and send it back.
Example pattern (pseudo‑code — adjust keys to match your response):
guardrail = resp
# Example – adjust keys/paths as per your resp:
prompt_attack_cfg = guardrail.get("promptAttackSettings", {})
prompt_attack_cfg["status"] = "ENABLED"
prompt_attack_cfg["strength"] = "MEDIUM" # or "HIGH"
guardrail["promptAttackSettings"] = prompt_attack_cfg
5. Call update_guardrail with the new settings
You must pass all required fields (name, description, and all other policy blocks) plus the updated prompt attack settings. Use the structure from get_guardrail as your base.
Typical pattern:
update_kwargs = {
"guardrailIdentifier": GUARDRAIL_ID,
"name": guardrail["name"],
"description": guardrail.get("description", ""),
"topicPolicyConfig": guardrail.get("topicPolicyConfig"),
"sensitiveInformationPolicyConfig": guardrail.get("sensitiveInformationPolicyConfig"),
"wordPolicyConfig": guardrail.get("wordPolicyConfig"),
"contextualGroundingPolicyConfig": guardrail.get("contextualGroundingPolicyConfig"),
# updated prompt attack config:
"promptAttackSettings": guardrail["promptAttackSettings"],
# and any other required sections from your get_guardrail response
}
resp_update = bedrock.update_guardrail(**update_kwargs)
print(resp_update)
Adjust the argument names to match what get_guardrail returns in your environment. If the SDK complains about missing/unknown keys, print get_guardrail’s output and match it directly with the AWS API reference for UpdateGuardrail.
6. (Optional) Promote the updated draft to a version
If you updated the DRAFT version and your governance process requires a numbered version:
bedrock.create_guardrail_version(
guardrailIdentifier=GUARDRAIL_ID,
description="Increase prompt attack strength to MEDIUM"
)
Summary
- Use
boto3.client("bedrock"). get_guardrail→ read current prompt attack setting.- Change strength from
LOW→MEDIUMorHIGH(keepingstatus=ENABLED). - Call
update_guardrailwith the modified configuration. - Optionally create a new Guardrail version.
If you paste the get_guardrail JSON here, I can give you an exact, ready‑to‑run update_guardrail snippet with the correct field names.
Using Terraform
Terraform currently has no resource for Amazon Bedrock guardrails (no aws_bedrock_guardrail or equivalent), so this specific setting cannot be managed or remediated via Terraform.
You must follow the CLI/console flow instead:
- Retrieve the current config:
aws bedrock get-guardrail \--guardrail-identifier GUARDRAIL_ID \--region AWS_REGION > guardrail.json
- Edit
guardrail.json: incontentPolicy→ thePROMPT_ATTACKfilter, changeinputStrengthfromLOWtoMEDIUMorHIGH, preserving all other filters and fields. - Apply the full, updated config:
aws bedrock update-guardrail \--guardrail-identifier GUARDRAIL_ID \--region AWS_REGION \--cli-input-json file://guardrail.json
Because there is no Terraform surface for this API, terraform plan will not show or track this change.