BerriAI/litellm · error · ValueError

Bedrock 'checks' must enable at least one of: contentFilter,

Error message

Bedrock 'checks' must enable at least one of: contentFilter, promptAttack, sensitiveInformation.

What it means

Pydantic model_validator on BedrockChecksConfigModel: none of contentFilter, promptAttack, or sensitiveInformation is set. The Bedrock InvokeGuardrailChecks API is resource-less, so the inline checks config must enable at least one check to have any effect.

Source

Thrown at litellm/types/guardrails.py:472

class BedrockChecksSensitiveInformationModel(BaseModel):
    entities: list[BedrockChecksSensitiveInformationEntityItem]


class BedrockChecksConfigModel(BaseModel):
    """Inline `checks` config for the resource-less Bedrock InvokeGuardrailChecks API.

    Include only the checks you want to run; at least one must be set.
    """

    contentFilter: BedrockChecksContentFilterModel | None = None
    promptAttack: BedrockChecksPromptAttackModel | None = None
    sensitiveInformation: BedrockChecksSensitiveInformationModel | None = None

    @model_validator(mode="after")
    def _require_at_least_one_check(self) -> "BedrockChecksConfigModel":
        if self.contentFilter is None and self.promptAttack is None and self.sensitiveInformation is None:
            raise ValueError(
                "Bedrock 'checks' must enable at least one of: contentFilter, promptAttack, sensitiveInformation."
            )
        return self


class BedrockGuardrailConfigModel(BaseModel):
    """Configuration parameters for the AWS Bedrock guardrail"""

    guardrailIdentifier: str | None = Field(default=None, description="The ID of your guardrail on Bedrock")
    guardrailVersion: str | None = Field(
        default=None,
        description="The version of your Bedrock guardrail (e.g., DRAFT or version number)",
    )
    disable_exception_on_block: bool | None = Field(
        default=False,
        description="If True, will not raise an exception when the guardrail is blocked. Useful for OpenWebUI where exceptions can end the chat flow.",
    )
    aws_region_name: str | None = Field(default=None, description="AWS region where your guardrail is deployed")

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Enable at least one check in the Bedrock guardrail config: contentFilter, promptAttack, or sensitiveInformation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/types/guardrails.py:472 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/e1c7a67387828bac. Report an issue: GitHub.