Skip to content

Bedrock  >  Structures  >  GuardrailContextualGroundingFilter

GuardrailContextualGroundingFilter

Structure Class

GuardrailContextualGroundingFilter dataclass

The details for the guardrails contextual grounding filter.

Attributes

action class-attribute instance-attribute
action: GuardrailContextualGroundingAction | None = field(repr=False, default=None)

The action to take when content fails the contextual grounding evaluation. Supported values include:

  • BLOCK -- Block the content and replace it with blocked messaging.

  • NONE -- Take no action but return detection information in the trace response.

enabled class-attribute instance-attribute
enabled: bool | None = None

Indicates whether contextual grounding is enabled for evaluation. When disabled, you aren't charged for the evaluation. The evaluation doesn't appear in the response.

threshold instance-attribute
threshold: float

The threshold details for the guardrails contextual grounding filter.

type instance-attribute

The filter type details for the guardrails contextual grounding filter.