Bedrock guardrails should enforce content and prompt-attack filters

Description

Amazon Bedrock guardrails should filter every harmful-content category, block prompt attacks, and define messages for blocked prompts and responses. Without these filters, a model can accept or produce harmful content, and jailbreak or prompt-injection techniques can get around model instructions and safety controls. A guardrail passes when every harmful-content filter (HATE, INSULTS, SEXUAL, VIOLENCE, MISCONDUCT) has an input and output strength of LOW, MEDIUM, or HIGH, a PROMPT_ATTACK filter is configured and every PROMPT_ATTACK filter has an input strength of LOW, MEDIUM, or HIGH, and the blocked input and output messages are not blank. A guardrail with no content policy fails, and a category the guardrail omits fails like one set to NONE, because CIS treats an unfiltered category as an exclusion that needs a documented reason. A filter direction counts only when it is also enabled and its action is BLOCK or not reported, because an action that is not reported defaults to BLOCK; NONE (detect only) or any other action value does not count, because such a filter is not known to block anything. A filter with a missing or blank type fails, because it could be an unenforced harmful-content or prompt attack filter. Each guardrail version, including the working DRAFT, is evaluated as its own resource, so a failing DRAFT or older version produces a finding even when the version in use passes.

Remediation

Edit the guardrail in the Amazon Bedrock console or with aws bedrock update-guardrail, then create a new version:

  1. For each harmful category (Hate, Insults, Sexual, Violence, Misconduct), set the input and output strength to LOW, MEDIUM, or HIGH with a blocking action, as described in Block harmful words and conversations with content filters.
  2. Enable the prompt attack filter with an input strength of LOW, MEDIUM, or HIGH and a blocking action, as described in Detect prompt attacks with Amazon Bedrock Guardrails.
  3. Enter messages for blocked prompts and blocked responses.

References