Generative AI  

Safeguard Multilingual AI Applications with Amazon Bedrock Guardrails

Introduction

Generative AI creates human-like content that must align with organizational standards and safety guidelines. Amazon Bedrock Guardrails helps organizations implement customized safeguards for their AI applications by filtering harmful content, blocking denied topics, and removing sensitive information.

Amazon Bedrock Guardrails provides the following safeguard tiers for specific policies (content filters and denied topics).

  1. Classic Tier: Supports English, French, and Spanish languages.
  2. Standard Tier: Offers more robust performance, extensive language support, and cross-region inference capabilities.

Classic is useful for simpler, limited-language workloads. However, if your application serves diverse global audiences and demands higher safety standards, the Standard tier is the ideal choice.

For example, a global energy company is building a multilingual customer support chatbot to answer billing, service, and outage-related questions from customers worldwide.

In this article, you will learn how to create and configure a guardrail using the Standard tier.

  1. Enable the chatbot to respond in multiple languages beyond English, French, and Spanish (Classic tier limitation).
  2. Prevent large language models (LLMs) from engaging in legal discussions, billing complaints, and penalty-related complaints.
  3. Defend against prompt attacks and jailbreak attempts.

Pre-requisites

An AWS account with administrator access or appropriate IAM permissions.

  1. Amazon Bedrock to create guardrails
  2. IAM role creation

Create guardrails in Amazon Bedrock

To create and configure a guardrail in Amazon Bedrock using the AWS console, follow these steps.

  1. Navigate to the Amazon Bedrock service in the AWS Console.
  2. Select "Safeguards" -> "Guardrails" in the navigation pane. Select Create guardrail.
    Create Guardrail
  3. Enter the guardrail name, description, and select Enable cross-Region inference for your guardrail. Select Next.
    Region inference
  4. Enable configuration of harmful categories filters and select all filters for text prompts as shown in the screenshot.
    Content Filter
  5. Enable configure prompt attacks filters, and select Standard tier for content filters. Select Next.
    Standard Tier
  6. Select Add denied topic and create the following issues.
    penalty charge - Blocks discussions around financial penalties that may be sensitive or escalatory.
    legal action - Prevents unauthorized or inappropriate responses on legal matters.	
    lawsuit - Prevents the chatbot from engaging in or giving advice on legal actions.
    billing complaint - Avoids discussing sensitive financial disputes directly. These should go to a human agent.
    
  7. Select the Standard tier for denied topics. Select Next.
    Next
  8. Leave all other optional steps and proceed to the Review and Create Step. Select Create guardrail.

Validate the guardrail

To validate the newly created guardrail, follow these steps using the AWS Console.

  1. Navigate to the Amazon Bedrock service in the AWS Console.
  2. Select "Safeguards" -> "Guardrails" in the navigation pane.
  3. Select the newly created guardrail. On the right-hand side, select Test. Select Working draft, enable Use ApplyGuardrail API, enter the below content, and choose Run.
    Italian - Voglio sporgere reclamo per un errore di fatturazione
    (I want to file a complaint about a billing error)
    
    Amazon Bedrock
  4. Click "View trace" to view details, including guardrail action, response, and analysis trace.
    View Trace

Summary

This article walked you through the process of creating and configuring a guardrail using the Standard tier in Amazon Bedrock to safely handle multilingual interactions, ensuring a more secure and compliant generative AI experience for your global users.