{"record":{"id":"be066954104ba8fe","repo":"BerriAI/litellm","slug":"azure-content-safety-guardrail-crossed-severit","errorCode":null,"errorMessage":"Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}","messagePattern":"Azure Content Safety Guardrail: (.+?) crossed severity (.+?), Got severity: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py","lineNumber":180,"sourceCode":"            if text:\n                await self.async_make_request(text=text)\n        return inputs\n\n    def check_severity_threshold(self, response: \"AzureTextModerationGuardrailResponse\") -> Literal[True]:\n        \"\"\"\n        - Check if threshold set by category\n        - Check if general severity threshold set\n        - If both none, use default_severity_threshold\n        \"\"\"\n\n        if self.severity_threshold_by_category:\n            for category in response[\"categoriesAnalysis\"]:\n                severity_category_threshold_item = self.severity_threshold_by_category.get(category[\"category\"])\n                if (\n                    severity_category_threshold_item is not None\n                    and category[\"severity\"] >= severity_category_threshold_item\n                ):\n                    raise HTTPException(\n                        status_code=400,\n                        detail={\n                            \"error\": \"Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}\".format(\n                                category[\"category\"],\n                                self.severity_threshold_by_category.get(category[\"category\"]),\n                                category[\"severity\"],\n                            )\n                        },\n                    )\n        if self.severity_threshold:\n            for category in response[\"categoriesAnalysis\"]:\n                if category[\"severity\"] >= self.severity_threshold:\n                    raise HTTPException(\n                        status_code=400,\n                        detail={\n                            \"error\": \"Azure Content Safety Guardrail: {} crossed severity {}, Got severity: {}\".format(\n                                category[\"category\"],\n                                self.severity_threshold,","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py#L162-L198","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py:180 when the library encounters an invalid state.","commonSituations":"Content crossed the configured severity threshold for an Azure moderation category.","solutions":["Remove or rephrase content that exceeds the configured severity threshold.","Raise the severity threshold in the guardrail config if the block is too strict."],"exampleFix":"Adjust severity_threshold in the Azure text moderation guardrail config.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}