Courseiva

Filtering Offensive Content in Amazon Bedrock Using Guardrails

A company uses Amazon Bedrock to generate product descriptions. They need to ensure outputs do not contain offensive language. Which service should they integrate to filter content?

Quick Answer

The answer is Amazon Bedrock Guardrails, the correct choice because it is the native AWS service designed specifically to enforce content policies for foundation model outputs, including offensive content filtering with Bedrock Guardrails. This service allows you to apply customizable safety filters, deny topics, and block harmful language like hate speech or profanity directly within your Bedrock workflows, without needing additional services or custom code. On the AWS Certified AI Practitioner AIF-C01 exam, this question tests your understanding of built-in safety mechanisms versus external solutions—a common trap is confusing Guardrails with services like Amazon Comprehend or Lambda-based filters, but Guardrails is the integrated, zero-code option for content moderation. Remember the memory tip: “Guardrails guard the gates”—if the task is filtering outputs at the model level, Bedrock Guardrails is the direct, exam-approved answer.

⚠ Common exam trap

A common mix-up: candidates confuse Amazon Comprehend's text analysis capabilities (like sentiment detection) with real-time content filtering, but Comprehend lacks the policy enforcement and integration with Bedrock that Guardrails provides.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Bedrock Guardrails

Amazon Bedrock Guardrails is the correct choice because it is specifically designed to enforce content policies for foundation model outputs, including filtering for offensive language, hate speech, and other harmful content. It integrates directly with Bedrock to apply customizable safety filters and deny topics without requiring additional services or custom code.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Amazon Comprehend

    Why it's wrong here

    Amazon Comprehend performs sentiment, entity and language detection; its toxicity detection is not the managed guardrail integrated with Bedrock model output. It is tempting as an NLP service, but it suits analysing existing text, not filtering generations inline.

  • ✗

    Amazon Rekognition

    Why it's wrong here

    Amazon Rekognition analyses images and videos for objects, scenes, and faces, but lacks the natural language processing capability to scan text for offensive language, which is the requirement in this scenario. It is tempting because Rekognition includes content moderation for unsafe visual content, such as explicit imagery, making it a plausible choice for filtering inappropriate material in a different context—specifically, when moderating image or video assets rather than generated text.

  • ✓

    Bedrock Guardrails

    Why this is correct

    Bedrock Guardrails applies configurable content filters that intercept both prompts and responses, blocking offensive language before it reaches users. This satisfies the requirement to filter outputs, unlike prompt engineering or post-processing, because filtering happens within the Bedrock inference path itself.

  • ✗

    AWS WAF

    Why it's wrong here

    AWS WAF filters HTTP requests at the edge, inspecting inbound traffic, not the text Bedrock generates. It is tempting because it blocks malicious input, but it is the right choice for protecting a web application from exploits such as SQL injection, not for moderating model output.

About these practice questions

One of 862 original AIF-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on AIF-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is using Amazon Bedrock to generate images from text prompts. They need to ensure the generated images do not contain offensive content. Which feature should be enabled?

medium
  • A.VPC endpoints
  • B.AWS WAF
  • ✓ C.Content moderation with AI
  • D.IAM policies

Why C: Amazon Bedrock's content moderation with AI feature allows you to filter generated images for offensive or inappropriate content by applying predefined or custom moderation policies. This is the correct choice because it directly addresses the requirement to ensure generated images do not contain offensive material, leveraging machine learning models to detect and block such content at inference time.

Variation 2. A company is using Amazon Bedrock to generate images. They want to ensure the outputs comply with content policies. Which TWO AWS services can help? (Choose two.)

medium
  • ✓ A.Amazon Augmented AI (A2I)
  • ✓ B.Amazon Rekognition
  • C.Amazon GuardDuty
  • D.AWS WAF
  • E.Amazon Comprehend

Why A: Amazon Augmented AI (A2I) is correct because it provides a human review workflow that can route Bedrock-generated images (or their metadata) to human reviewers who validate compliance with content policies before the output is released. Amazon Rekognition is correct because its DetectModerationLabels API automatically identifies unsafe or policy-violating content categories (e.g., explicit nudity, violence, drugs) in images, enabling automated filtering of Bedrock outputs. Amazon GuardDuty is not relevant because it is a threat-detection service for AWS accounts, workloads, and logs (e.g., CloudTrail, VPC Flow Logs), not image content moderation. AWS WAF does not belong because it filters HTTP/S web traffic at the application layer (e.g., SQL injection, XSS) and cannot inspect image content. Amazon Comprehend is incorrect because it is an NLP service for text (sentiment, entities, moderation of text), not image content analysis.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.