The AWS Bedrock Guardrail plugin is a robust content filtering system that leverages Amazon Bedrock’s guardrail capabilities to protect your AI gateway. It provides comprehensive content moderation through Amazon’s pre-trained models and customizable guardrails, ensuring that content passing through your gateway adheres to specified policies and guidelines.The plugin integrates seamlessly with AWS Bedrock’s guardrail system, which offers three primary types of protection:
Topic Policy: Controls allowed and disallowed topics
Content Policy: Filters potentially harmful or inappropriate content
Sensitive Information Policy: Detects and protects against exposure of sensitive data
Each policy type can be configured through AWS Bedrock’s guardrail configuration, making this plugin highly flexible and adaptable to various use cases and security requirements.
The topic policy feature allows you to control which subjects or topics are allowed or denied in the content. When a topic is blocked, the plugin will return a specific error message indicating which topic violated the policy.Example configuration focusing on topic policies:
• Use appropriate guardrail IDs for your use case• Test guardrails thoroughly before deployment• Keep guardrail versions consistent across environments
The AWS Bedrock Guardrail plugin is designed for optimal performance while providing robust content filtering capabilities. The plugin maintains a single AWS client instance per plugin instance, reducing the overhead of creating new connections for each request. The implementation includes efficient error handling and logging mechanisms to ensure reliable operation in production environments.Key performance features include:
Efficient AWS client management
Optimized request handling
Comprehensive logging for debugging
Minimal memory footprint
Fast response times for content evaluation
The plugin’s architecture supports concurrent processing with low latency, making it suitable for high-throughput environments. The integration with AWS Bedrock’s guardrail system ensures that content evaluation is performed quickly and efficiently, with minimal impact on overall system performance.