> ## Documentation Index
> Fetch the complete documentation index at: https://cloudanix.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

<Tabs>
  <Tab title="Remediation">
    ### Remediation

    <AccordionGroup>
      <Accordion title="Using Console" defaultOpen="true">
        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:

        1. **Open the Bedrock console**
           * Go to: [https://console.aws.amazon.com/bedrock/](https://console.aws.amazon.com/bedrock/)
           * Make sure you’re in the correct AWS Region (top‑right of the console).

        2. **Navigate to Guardrails**
           * In the left navigation pane, select **Guardrails**.

        3. **Select the affected guardrail**
           * In the Guardrails list, find the guardrail that your security tool flagged.
           * Click the **Guardrail name** to open its details.

        4. **Edit the guardrail**
           * On the guardrail detail page, choose **Edit** (top right).

        5. **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**.

        6. **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.

        7. **Save the guardrail**
           * Scroll down and click **Save changes**.
           * If prompted, confirm the update.

        8. **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.
      </Accordion>

      <Accordion title="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:

        ```bash theme={null}
        aws bedrock list-guardrails
        ```

        Note the `guardrailId` (and optionally `name`) of the guardrail you need to fix.

        ***

        ### 2. Get the current guardrail configuration

        ```bash theme={null}
        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:

        ```bash theme={null}
        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):**

        ```json theme={null}
        "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:

        ```json theme={null}
        "contextualGroundingPolicyConfig": {
          "contextualGroundingFiltersConfig": [
            {
              "type": "INJECTION",
              "threshold": "HIGH"
            },
            {
              "type": "HALLUCINATION",
              "threshold": "MEDIUM"
            }
          ]
        }
        ```

        Or, if your guardrail uses a direct “strength” setting such as:

        ```json theme={null}
        "promptAttackProtection": {
          "strength": "LOW"
        }
        ```

        Change it to:

        ```json theme={null}
        "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:
          * `name`
          * `description`
          * `contentPolicyConfig`
          * `contextualGroundingPolicyConfig`
          * `sensitiveInformationPolicyConfig`
          * `topicPolicyConfig`
          * `blockedInputMessaging`, `blockedOutputsMessaging`, etc.

        Or:

        * Create a minimal update file that only contains the fields you want to change (e.g. just `contextualGroundingPolicyConfig` plus `guardrailId` and `name` / `description` if needed).

        Example minimal `guardrail-updated.json`:

        ```json theme={null}
        {
          "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

        ```bash theme={null}
        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:

        ```bash theme={null}
        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:

        ```bash theme={null}
        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`.
      </Accordion>

      <Accordion title="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

        ```bash theme={null}
        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`).

        ```bash theme={null}
        aws configure
        ```

        ***

        ## 2. Initialize the Bedrock client in Python

        ```python theme={null}
        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`.

        ```python theme={null}
        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):

        * `promptAttackProtection`
        * `promptAttackSettings`
        * 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:

        ```python theme={null}
        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):

        ```python theme={null}
        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:

        ```python theme={null}
        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`](https://docs.aws.amazon.com/bedrock/latest/APIReference/Welcome.html).

        ***

        ## 6. (Optional) Promote the updated draft to a version

        If you updated the `DRAFT` version and your governance process requires a numbered version:

        ```python theme={null}
        bedrock.create_guardrail_version(
            guardrailIdentifier=GUARDRAIL_ID,
            description="Increase prompt attack strength to MEDIUM"
        )
        ```

        ***

        ## Summary

        1. Use `boto3.client("bedrock")`.
        2. `get_guardrail` → read current prompt attack setting.
        3. Change strength from `LOW` → `MEDIUM` or `HIGH` (keeping `status=ENABLED`).
        4. Call `update_guardrail` with the modified configuration.
        5. 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.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>
