Skip to content

Skill 4.3.9: Implement safeguards and sensitive data protection to meet application requirements and responsible AI policies


Question Answer & Explanation
### Question 1 - Amazon Bedrock Guardrails Contextual Grounding

An enterprise is deploying an internal HR assistant using Amazon Bedrock. The assistant retrieves employee handbook documents to answer user queries. The compliance team mandates that the assistant must not generate answers that are not directly supported by the retrieved documents, to prevent hallucinations and ensure accurate policy representation. The solution must minimize operational overhead and use native AWS services.

Which ONE Amazon Bedrock Guardrails feature should the ML engineer configure to meet this requirement?

- A) Denied Topics
- B) Contextual Grounding Check
- C) Content Filters
- D) Sensitive Information Filters
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Contextual Grounding Check in Amazon Bedrock Guardrails evaluates whether the model's response is factually supported by the reference text (retrieved passages) provided in the prompt context. If the response is not grounded in the source material, the guardrail blocks or flags it, effectively mitigating hallucinations.

Distractor Analysis:
- A is Incorrect: Denied Topics are used to block conversations about specific predefined subjects (e.g., investment advice or medical diagnoses), not to verify factual alignment with retrieved documents.
- C is Incorrect: Content Filters are designed to block harmful, hateful, or toxic content based on severity categories, not to check for hallucination or grounding.
- D is Incorrect: Sensitive Information Filters detect, mask, or block PII (Personally Identifiable Information) in the input or output, which is unrelated to verifying if a response is supported by the source text.

> Exam Tip: Use Contextual Grounding checks for RAG applications to prevent hallucinations by ensuring responses are supported by retrieved source passages.
### Question 2 - Masking PII in Model Responses

A healthcare company is building an AI chatbot using Amazon Bedrock to answer general patient support queries. The security team mandates that any personally identifiable information (PII), such as Social Security numbers or patient IDs, generated in the model's response must be redacted before being displayed to the user. The solution must use Amazon Bedrock Guardrails and minimize configuration complexity.

Which ONE configuration meets this requirement with the least operational overhead?

- A) Configure a Sensitive Information Filter and set the action to Mask.
- B) Configure a Word Filter with a custom list of all possible patient IDs.
- C) Configure a Denied Topic for "Patient Information".
- D) Configure an Automated Reasoning check to validate PII rules.
Correct Answer: A

Correct Answer Analysis:
- A is Correct: Sensitive Information Filters in Amazon Bedrock Guardrails natively detect PII (like SSNs, phone numbers, or custom regex patterns) and can be configured to Mask the detected sensitive data in the model response before it reaches the user.

Distractor Analysis:
- B is Incorrect: Word Filters are designed to block specific words or profanity. Maintaining a list of all possible patient IDs is unscalable and operationally heavy compared to using native PII detection.
- C is Incorrect: Denied Topics would block the entire conversation about a subject, not specifically redact or mask PII within a valid response.
- D is Incorrect: Automated Reasoning checks validate logical consistency against formal rules, not detect and mask PII entities.

> Exam Tip: Use Sensitive Information Filters with the "Mask" action to redact PII in model outputs without blocking the entire response.
### Question 3 - Blocking Specific Subject Matter

A financial services firm is using a foundation model via Amazon Bedrock to summarize market news. Due to strict regulatory compliance, the foundation model must absolutely refuse to provide any form of investment advice or specific stock recommendations to users. The firm wants to implement this using the most appropriate Amazon Bedrock Guardrails feature.

Which ONE feature should the firm configure to enforce this rule?

- A) Contextual Grounding Check
- B) Sensitive Information Filter
- C) Denied Topics
- D) Content Filters
Correct Answer: C

Correct Answer Analysis:
- C is Correct: Denied Topics in Amazon Bedrock Guardrails allow administrators to define specific subjects that the model must refuse to discuss. Configuring "Investment Advice" as a denied topic ensures the guardrail blocks any prompt or response attempting to solicit or provide such advice.

Distractor Analysis:
- A is Incorrect: Contextual Grounding checks ensure responses are supported by source text; they do not explicitly block entire subject domains like investment advice.
- B is Incorrect: Sensitive Information Filters are for PII redaction, not for blocking thematic content or advice.
- D is Incorrect: Content Filters block harmful/hateful/sexual content based on severity, not specific financial advice topics.

> Exam Tip: Use Denied Topics to prevent the model from engaging in specific, predefined subject matters that violate business policy.
### Question 4 - Implementing Automated Reasoning Checks

An AI application processes user queries about company expense reimbursement policies. The enterprise requires that the model's response strictly adheres to the formal corporate expense policy rules (e.g., "reimbursements over $500 require manager approval"). The ML engineer needs to implement a safeguard that mathematically validates the model's response against these formal logical rules. Which ONE Amazon Bedrock Guardrails feature should be used?

- A) Automated Reasoning checks
- B) Contextual Grounding checks
- C) Word filters
- D) Sensitive Information filters
Correct Answer: A

Correct Answer Analysis:
- A is Correct: Automated Reasoning checks in Amazon Bedrock Guardrails use formal mathematical logic to validate whether the model's response is consistent with explicitly stated rules and policies provided by the administrator.

Distractor Analysis:
- B is Incorrect: Contextual Grounding checks evaluate if a response is supported by retrieved text passages, not if it adheres to formal logical constraints like expense thresholds.
- C is Incorrect: Word filters simply block or mask specific terms; they cannot evaluate logical conditions or policy rules.
- D is Incorrect: Sensitive Information filters are strictly for identifying and masking PII, not for enforcing business logic.

> Exam Tip: Use Automated Reasoning checks to validate model outputs against strict logical or business rules (e.g., corporate policies).
### Question 5 - Applying Guardrails to Third-Party Models

An AI engineering team wants to evaluate user prompts and model responses for harmful content and PII, but they are using a self-hosted open-source model outside of the Amazon Bedrock platform. The team wants to utilize Amazon Bedrock Guardrails to perform this evaluation without building and managing custom content filtering models. Which ONE approach should the ML engineer take?

- A) Migrate the model to Amazon SageMaker JumpStart and use AWS Lambda to intercept calls.
- B) Use the ApplyGuardrail API to evaluate the prompts and responses independently.
- C) Configure a VPC Interface Endpoint to route traffic through Bedrock Guardrails.
- D) Enable AWS CloudTrail data events to inspect the payloads for PII.
- E) Use Amazon Comprehend to detect PII and Amazon Macie to detect harmful content.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: The ApplyGuardrail API in Amazon Bedrock allows developers to evaluate prompts and model responses from any source (including models hosted outside of Bedrock, or custom models) using Bedrock Guardrails. This decouples the guardrail evaluation from the model invocation, providing a flexible, low-operational-overhead solution.

Distractor Analysis:
- A is Incorrect: Migrating the model to SageMaker and writing custom Lambda interceptors introduces unnecessary operational overhead and does not directly leverage the native Bedrock Guardrails API.
- C is Incorrect: VPC Interface Endpoints are for network routing and privacy, not for content inspection or applying safety guardrails.
- D is Incorrect: AWS CloudTrail is used for auditing API calls, not for real-time content evaluation or PII redaction.
- E is Incorrect: While Amazon Comprehend can detect PII, stitching together multiple services for guardrail duties (PII + harmful content) is far more complex and operationally heavy than using the native ApplyGuardrail API.

> Exam Tip: The ApplyGuardrail API allows you to use Bedrock Guardrails on models hosted outside of Amazon Bedrock, decoupling safeguards from model execution.
### Question 6 - Protecting Sensitive Data in Logs

An enterprise has implemented an Amazon Bedrock Guardrail with a Sensitive Information Filter configured to mask PII in model responses. However, the security team notices that unmasked PII is still appearing in the application's Amazon CloudWatch logs. The application uses the InvokeModel API with the guardrail configured. Which ONE action should the ML engineer take to ensure PII is masked throughout the logging path?

- A) Configure AWS Config rules to automatically redact PII from CloudWatch logs.
- B) Enable AWS CloudTrail data events for the Bedrock API calls.
- C) Ensure the application logs the final Guardrail-processed output rather than the raw model output.
- D) Apply a separate Denied Topic guardrail specifically for the logging component.
Correct Answer: C

Correct Answer Analysis:
- C is Correct: When a guardrail is applied, it processes the response and returns the masked version to the caller. If the application code is logging the raw output (or an intermediate step) before the guardrail is applied, or if it logs the raw user prompt instead of the processed prompt, unmasked PII will appear. The engineer must update the application logic to log only the final, guardrail-processed text.

Distractor Analysis:
- A is Incorrect: AWS Config evaluates resource configurations, not real-time data payloads within CloudWatch logs.
- B is Incorrect: CloudTrail logs API metadata, not the actual payload content, so it won't contain the PII response body anyway, and it doesn't fix the application's logging behavior.
- D is Incorrect: Denied Topics block specific subjects; they do not address how the application logs data.

> Exam Tip: Guardrails protect the data returned to the user, but application logging behavior must also be designed to log the post-guardrail payload, not the raw model output.
### Question 7 - Blocking Specific Terms and Profanity

A company is deploying a chatbot using Amazon Bedrock. They want to block profanity and offensive language. Additionally, they have a specific internal list of competitor names that must be blocked from being mentioned in both the prompt and the response. Which ONE Amazon Bedrock Guardrails feature should they configure to handle the competitor names and profanity with the least operational overhead?

- A) Content Filters
- B) Denied Topics
- C) Word Filters
- D) Sensitive Information Filters
Correct Answer: C

Correct Answer Analysis:
- C is Correct: Word Filters in Amazon Bedrock Guardrails can be configured to block specific terms, including profanity and custom-defined words (like competitor names). This feature directly intercepts and blocks or masks the specified terms in both the user input and the model output.

Distractor Analysis:
- A is Incorrect: Content Filters block harmful content based on broad categories (e.g., hate, violence, sexual) and severity thresholds, not specific custom words like competitor names.
- B is Incorrect: Denied Topics are for blocking entire subject matters, not individual words or terms.
- D is Incorrect: Sensitive Information Filters are designed for PII like SSNs and credit card numbers, not custom competitive terms.

> Exam Tip: Use Word Filters to block or mask specific terms, including profanity and custom organizational terms (e.g., competitor names).
### Question 8 - Guardrails Evaluation for Risky Content

A security engineer is designing an Amazon Bedrock Guardrail for a customer service application. The team wants to ensure that the model strictly avoids generating responses that contain harmful content, specifically focusing on "Violence" and "Insults". They need to configure a policy that blocks these categories when the confidence score crosses a certain threshold. Which ONE feature is the MOST appropriate to configure?

- A) Denied Topics
- B) Content Filters
- C) Contextual Grounding Check
- D) Word Filters
Correct Answer: B

Correct Answer Analysis:
- B is Correct: Content Filters in Amazon Bedrock Guardrails are specifically designed to block harmful content across predefined categories (Hate, Insults, Sexual, Violence) by setting acceptable threshold levels (e.g., Low, Medium, High).

Distractor Analysis:
- A is Incorrect: Denied Topics are for blocking specific subjects, not for classifying the toxicity or harmfulness of content based on categories like violence or insults.
- C is Incorrect: Contextual Grounding checks verify factual alignment with retrieved sources, not harmful content.
- D is Incorrect: Word Filters block specific words, but they are not capable of evaluating the broader context or severity of "Insults" or "Violence".

> Exam Tip: Use Content Filters to block harmful content based on AWS's predefined categories (Hate, Insults, Sexual, Violence) by adjusting severity thresholds.
### Question 9 - Contextual Grounding Thresholds

An AI engineering team is building a Retrieval-Augmented Generation (RAG) application. They want to use Amazon Bedrock Guardrails to ensure the model's responses are grounded in the retrieved documents. They configure a Contextual Grounding check with a threshold of 0.65. During testing, they find that the model is still returning some hallucinated responses that are barely grounded in the source text. Which ONE action should they take to make the guardrail more strict and block these hallucinations?

- A) Decrease the threshold to 0.50.
- B) Increase the threshold to 0.85.
- C) Change the action from Block to Mask.
- D) Apply the guardrail only to the prompt, not the response.
Correct Answer: B

Correct Answer Analysis:
- B is Correct: The Contextual Grounding threshold determines the minimum confidence score required for a response to be considered "grounded." A higher threshold (e.g., 0.85) requires a higher degree of grounding in the source text, making the guardrail stricter and more likely to block barely-grounded hallucinated responses.

Distractor Analysis:
- A is Incorrect: Decreasing the threshold makes the guardrail less strict, allowing more borderline or ungrounded responses to pass through.
- C is Incorrect: Contextual Grounding checks evaluate factual support, and "Mask" is not an applicable action for grounding (masking is for PII). The action should be to block the response.
- D is Incorrect: Hallucinations occur in the model's response, not the prompt. Applying the check only to the prompt would fail to catch hallucinated outputs.

> Exam Tip: To prevent hallucinations more strictly with Contextual Grounding checks, increase the threshold score to require a higher degree of factual alignment.
### Question 10 - Comprehensive Safeguard Configuration

A generative AI application is being built on Amazon Bedrock to process internal legal documents. The application has three strict requirements: 1) It must not generate responses that include any employee Social Security Numbers. 2) It must completely refuse to discuss anything related to "Internal Mergers and Acquisitions". 3) It must block any offensive or hateful content. Which THREE Amazon Bedrock Guardrails features must be configured together to meet these application requirements? (Select THREE)

- A) Sensitive Information Filters
- B) Denied Topics
- C) Contextual Grounding Check
- D) Content Filters
- E) Word Filters
Correct Answer: A, B, and D

Correct Answer Analysis:
- A is Correct: Sensitive Information Filters will detect and block/mask Social Security Numbers (PII) in the response.
- B is Correct: Denied Topics will prevent the model from engaging in any conversation about the restricted subject of "Internal Mergers and Acquisitions".
- D is Correct: Content Filters will block offensive and hateful content based on severity categories.

Distractor Analysis:
- C is Incorrect: Contextual Grounding checks are used to ensure responses are supported by retrieved source documents (preventing hallucinations), which is not a requirement listed in the scenario.
- E is Incorrect: Word Filters block specific terms. While you could block the word "merger", Denied Topics are the appropriate, more robust feature for blocking an entire subject matter. SSNs are better handled by Sensitive Information Filters.

> Exam Tip: Amazon Bedrock Guardrails allows you to combine multiple policies (Content Filters, Denied Topics, Word Filters, Sensitive Information Filters, etc.) into a single guardrail to enforce comprehensive responsible AI policies.