Adding Bedrock Guardrails integration#176
Open
mxr-mwaters wants to merge 3 commits intoaws-samples:mainfrom
Open
Adding Bedrock Guardrails integration#176mxr-mwaters wants to merge 3 commits intoaws-samples:mainfrom
mxr-mwaters wants to merge 3 commits intoaws-samples:mainfrom
Conversation
Please verify my implementation. We have been using it and it appears to be working well.
dg-nthompson
added a commit
to maxar-infrastructure/bedrock-access-gateway
that referenced
this pull request
Mar 11, 2026
- Add ENABLE_GUARDRAIL, GUARDRAIL_IDENTIFIER, GUARDRAIL_VERSION env vars - Add guardrailConfig to Converse API requests when enabled - Add guardrail parameters to invoke_model for embeddings when enabled - Update README with Guardrails feature and documentation Based on PR aws-samples#176 by mxr-mwaters with optimized implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
129 - opened by another person. Slightly modified environment variable names from the original issue.
Description of changes:
Added Guardrail support. You can now enable/disable guardrails through an environment variable and also specify the guardrail and version to use via environment variables.
Added ENV variables:
ENABLE_GUARDRAIL (set to true to enable guardrail integration)
GUARDRAIL_IDENTIFIER (set to ARN of guardrail)
GUARDRAIL_VERSION (set to version of guardrail e.g. 1)
Please double check my work - we have been running this with good success so far, but that doesn't mean we have covered all cases.
Thank you for this repo - this has allowed us to move forward quickly!
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.