Add BedrockCreateGuardrailOperator - #66035
Merged
Merged
Conversation
vincbeck
reviewed
Apr 28, 2026
john-jac
force-pushed
the
add-bedrock-guardrail-create
branch
from
April 28, 2026 18:48
80c4d32 to
d41ea24
Compare
SameerMesiah97
left a comment
Contributor
There was a problem hiding this comment.
I see that you are actively pushing changes but I have left a few comments for guidance.
The direction is fine but the logic is a bit too messy at the moment. Also, I think you could cover more scenarios in the tests. Also, I know that you have just moved the operator code into the existing file but you should move the tests to test_bedrock.py as well.
john-jac
force-pushed
the
add-bedrock-guardrail-create
branch
5 times, most recently
from
April 29, 2026 00:34
ca20a81 to
8ec0d3d
Compare
Contributor
Author
|
Closing to resubmit with clean branch. Too many accumulated fixes. |
john-jac
force-pushed
the
add-bedrock-guardrail-create
branch
2 times, most recently
from
April 29, 2026 04:39
3fb2797 to
6e2a815
Compare
vincbeck
reviewed
Apr 29, 2026
john-jac
force-pushed
the
add-bedrock-guardrail-create
branch
from
April 29, 2026 13:43
6e2a815 to
b5226f5
Compare
john-jac
force-pushed
the
add-bedrock-guardrail-create
branch
from
April 29, 2026 14:17
b5226f5 to
7c063b5
Compare
Contributor
Author
|
Thanks @SameerMesiah97 and @vincbeck for the review! Addressed all feedback:
|
Contributor
|
CI is failing |
Contributor
Author
Should be good now. I'm still playing with my pre-submit CI process but it keeps missing things. It's a process. |
vincbeck
approved these changes
Apr 29, 2026
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.
What
Add an operator to create Amazon Bedrock guardrails for implementing safety controls in generative AI applications.
Use Case
Teams deploying LLM-powered applications need to enforce content safety policies (block hate speech, filter PII, deny off-topic discussions) as part of their deployment pipeline. A guardrail is created with content filters and topic policies, then associated with the Bedrock model. Having this in a DAG makes safety policy changes versioned, auditable, and promotable through dev/staging/prod:
The
create_guardrailAPI creates a DRAFT version that is immediately usable — no separate version step needed for dev/test workflows.How
BedrockCreateGuardrailOperatorusingAwsBaseOperator[BedrockHook]patternif_exists="skip"handlesConflictExceptionprune_dictfor clean kwargs buildingFiles
operators/bedrock_guardrail.py— operatortest_bedrock_guardrail.py— unit tests (4 tests)example_bedrock_guardrail.py— system test with teardownbedrock_guardrail.rst— docsprovider.yaml+get_provider_info.py— updatedTesting