{"record":{"id":"6715c2b1d2ab639c","repo":"BerriAI/litellm","slug":"azure-content-safety-azure-guardrail-is-not-a-v","errorCode":null,"errorMessage":"Azure Content Safety: {azure_guardrail} is not a valid guardrail","messagePattern":"Azure Content Safety: (.+?) is not a valid guardrail","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/azure/__init__.py","lineNumber":51,"sourceCode":"                \"api_key\": litellm_params.api_key,\n                \"api_base\": litellm_params.api_base,\n                \"default_on\": litellm_params.default_on,\n                \"event_hook\": litellm_params.mode,\n            },\n        )\n    elif azure_guardrail == \"text_moderations\":\n        azure_content_safety_guardrail = AzureContentSafetyTextModerationGuardrail(\n            guardrail_name=guardrail_name,\n            **{\n                **litellm_params.model_dump(exclude_none=True),\n                \"api_key\": litellm_params.api_key,\n                \"api_base\": litellm_params.api_base,\n                \"default_on\": litellm_params.default_on,\n                \"event_hook\": litellm_params.mode,\n            },\n        )\n    else:\n        raise ValueError(f\"Azure Content Safety: {azure_guardrail} is not a valid guardrail\")\n\n    litellm.logging_callback_manager.add_litellm_callback(azure_content_safety_guardrail)\n    return azure_content_safety_guardrail\n\n\nguardrail_initializer_registry: Final = {\n    SupportedGuardrailIntegrations.AZURE_PROMPT_SHIELD.value: initialize_guardrail,\n    SupportedGuardrailIntegrations.AZURE_TEXT_MODERATIONS.value: initialize_guardrail,\n}\n\n\nguardrail_class_registry: Final = {\n    SupportedGuardrailIntegrations.AZURE_PROMPT_SHIELD.value: AzureContentSafetyPromptShieldGuardrail,\n    SupportedGuardrailIntegrations.AZURE_TEXT_MODERATIONS.value: AzureContentSafetyTextModerationGuardrail,\n}\n","sourceCodeStart":33,"sourceCodeEnd":67,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/azure/__init__.py#L33-L67","documentation":"Dispatch guard in the Azure Content Safety initializer: the path segment after 'azure/' in litellm_params.guardrail is neither prompt_shield nor text_moderations, so no handler class matches.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/azure/__init__.py:51 when the library encounters an invalid state.","commonSituations":"An unrecognized Azure guardrail type was configured.","solutions":["Use a supported Azure guardrail type (e.g. prompt_shield or text moderation)."],"exampleFix":"Set the guardrail to a valid Azure Content Safety guardrail name.","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"}