AWS Cloud Certify · Practice exams

GenAI Developer

Amazon Bedrock Guardrails Explained: Content Filters, PII Masking and Grounding Checks

Updated November 2026 · 3 min read · Based on official AWS documentation

Quick answer

Amazon Bedrock Guardrails let you add content filters, denied topics, word filters, sensitive information (PII) filters, contextual grounding checks and Automated Reasoning checks to model inputs and outputs. PII can be blocked or masked, grounding thresholds go from 0 to 0.99, and the bedrock:GuardrailIdentifier IAM condition key can force every inference call to use an approved guardrail.

The guardrail policy types

Amazon Bedrock Guardrails policies
PolicyWhat it does
Content filtersDetect harmful text or image content in the categories Hate, Insults, Sexual, Violence, Misconduct and Prompt Attack, each with its own strength.
Prompt attacksA content filter category that detects jailbreaks and prompt injections; prompt leakage detection needs the Standard tier.
Denied topicsTopics the application must avoid, such as illegal investment advice.
Word filtersExact-match words or phrases, such as profanity or competitor names.
Sensitive information filtersDetect PII or custom regex entities and block or mask them.
Contextual grounding checksFlag responses that are not grounded in the source or not relevant to the query.
Automated Reasoning checksValidate that responses follow logical rules and policies you define.

Source: docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html

A guardrail must contain at least one filter and the messaging to show when a prompt or response is blocked.

PII: block or mask

The sensitive information filter is a probabilistic, context-dependent ML filter. Block rejects the whole request or response; mask replaces the value with its type, for example `{NAME}` or `{EMAIL}`. You can also define custom regex entities (lookaround is not supported).

Masking applies to content sent to and returned by the model, not to model invocation logs: the input field in CloudWatch Logs keeps the original request. AWS points to CloudWatch Logs data protection for the logs. PII in tool call arguments, tool results and tool definitions is not filtered either.

Contextual grounding: catching hallucinations

A grounding check scores two things: grounding (is the answer supported by the source?) and relevance (does it answer the question?). It needs the grounding source, the query and the content to guard, and it only runs on the model output.

Detect mode: test before you block

Each filter can use the action NONE, which takes no action but returns detection information. That lets you measure how a guardrail behaves on real traffic before switching it to block or mask.

Make guardrails mandatory with IAM

Add the `bedrock:GuardrailIdentifier` condition key to an IAM policy with an explicit Deny, so any `InvokeModel`, `InvokeModelWithResponseStream`, `Converse` or `ConverseStream` call without the approved guardrail is rejected.

Why it matters for AIP-C01

Domain 3 (AI Safety, Security, and Governance) is 20% of the exam, and its first task is input and output safety controls. See Domain 3 and the study topic Bedrock Guardrails: filters, PII and grounding.

Frequently asked questions

What is the difference between block and mask in Bedrock Guardrails?

Block rejects the whole request or response when PII is found; mask replaces each PII value with its type, such as {NAME}.

What threshold should a contextual grounding check use?

Any value from 0 to 0.99. Higher thresholds block more ungrounded or irrelevant responses. A value of 1 is invalid.

Do Bedrock Guardrails mask PII in invocation logs?

No. Masking applies to model inputs and outputs; the invocation log keeps the original input. Use CloudWatch Logs data protection for logs.

How do I force every Bedrock call to use a guardrail?

Use the bedrock:GuardrailIdentifier IAM condition key with an explicit Deny for requests that do not specify the approved guardrail.

Sources

AWS updates its programs and documentation. Check the linked official pages for the latest details before you decide or pay.

Practice for AIP-C01

Free AWS Generative AI Developer – Professional practice questions with an explanation for every option. No sign-up.

Start a practice test GenAI Developer hub

Keep reading