BerriAI/litellm · error · HTTPException

Azure Content Safety Guardrail: {} crossed severity {}, Got

Error message

Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}

What it means

Raised by the Azure text-moderation severity check: a category (embedded via {}) scored at or above its configured threshold (category-specific or default); the observed severity is embedded. The block reflects the deployment's threshold settings, not a hard Azure failure.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py:180

            if text:
                await self.async_make_request(text=text)
        return inputs

    def check_severity_threshold(self, response: "AzureTextModerationGuardrailResponse") -> Literal[True]:
        """
        - Check if threshold set by category
        - Check if general severity threshold set
        - If both none, use default_severity_threshold
        """

        if self.severity_threshold_by_category:
            for category in response["categoriesAnalysis"]:
                severity_category_threshold_item = self.severity_threshold_by_category.get(category["category"])
                if (
                    severity_category_threshold_item is not None
                    and category["severity"] >= severity_category_threshold_item
                ):
                    raise HTTPException(
                        status_code=400,
                        detail={
                            "error": "Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}".format(
                                category["category"],
                                self.severity_threshold_by_category.get(category["category"]),
                                category["severity"],
                            )
                        },
                    )
        if self.severity_threshold:
            for category in response["categoriesAnalysis"]:
                if category["severity"] >= self.severity_threshold:
                    raise HTTPException(
                        status_code=400,
                        detail={
                            "error": "Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}".format(
                                category["category"],
                                self.severity_threshold,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Remove or rephrase content that exceeds the configured severity threshold.
  2. Raise the severity threshold in the guardrail config if the block is too strict.

Example fix

Adjust severity_threshold in the Azure text moderation guardrail config.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py:180 when the library encounters an invalid state.

Common situations: Content crossed the configured severity threshold for an Azure moderation category.


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