---
title: Bedrock guardrails should enforce content and prompt-attack filters
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Bedrock guardrails should enforce
  content and prompt-attack filters
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Bedrock guardrails should enforce content and prompt-attack filters
 
## Description{% #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{% #remediation %}

Edit the guardrail in the Amazon Bedrock console or with [`aws bedrock update-guardrail`](https://docs.aws.amazon.com/cli/latest/reference/bedrock/update-guardrail.html), 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](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-content-filters.html).
1. 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](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html).
1. Enter messages for blocked prompts and blocked responses.

## References{% #references %}

- [Block harmful words and conversations with content filters](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-content-filters.html)
- [Detect prompt attacks with Amazon Bedrock Guardrails](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-prompt-attack.html)
- [update-guardrail command reference](https://docs.aws.amazon.com/cli/latest/reference/bedrock/update-guardrail.html)
- [CIS Amazon Web Services Benchmarks](https://www.cisecurity.org/benchmark/amazon_web_services)
