Skill 3.1.1

Develop comprehensive content safety systems to protect against harmful user inputs to FMs (for example, by using Amazon Bedrock guardrails to filter content, Step Functions and Lambda functions to implement custom moderation workflows, real-time validation mechanisms)

Key Concepts

Amazon Bedrock Guardrails evaluate user input with content filters for hate, insults, sexual content, violence and misconduct at configurable strengths (none, low, medium, high), a prompt attack filter, denied topics defined in natural language, word filters including a managed profanity list, and sensitive information filters. A guardrail is attached to Converse or InvokeModel calls, or called directly with the ApplyGuardrail API, and returns a configurable blocked message when an input is blocked.

Custom moderation covers rules that guardrails do not express: a Lambda function checks input length, language, allowed characters, rate of requests per user and domain-specific rules in real time; a Step Functions workflow combines several checks, such as Amazon Comprehend toxicity detection and a classifier model, and routes borderline cases to human review.