- Newest
- Most votes
- Most comments
When a guardrail is triggered in your Amazon Bedrock Flow, you can access information about why content was blocked by examining the response fields.
When a guardrail intervenes, the response includes specific fields that indicate the type of blockage:
-
amazon-bedrock-guardrailAction- This field will show "INTERVENED" when the guardrail blocks content or "NONE" if it doesn't. -
amazon-bedrock-trace- This field appears if you enable tracing and contains detailed information about the blocked content, including:
- The model output that was blocked
- Assessment details about what triggered the guardrail
The assessment information can include:
- Topic policies that were violated (with the name of the topic)
- Content filter violations
- Custom word violations
- Sensitive information policy violations
To enable more detailed tracing in your Flow invocation, make sure to set the enableTrace parameter to true in your InvokeFlow request. This will provide you with trace events for each node in your flow, including the guardrail intervention.
For your Kotlin implementation, you should check the response from your flow invocation for these guardrail-specific fields to determine the exact reason for the blockage. The trace information will help you identify whether the content was blocked due to a denied topic, harmful content, sensitive information, or custom word filters.
Sources
Test your guardrail - Amazon Bedrock
Track each step in your flow by viewing its trace in Amazon Bedrock - Amazon Bedrock
answered 10 months ago
Relevant content
asked a year ago
asked 4 years ago
asked a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 9 months ago
