{"record":{"id":"d24d4fb2805542c2","repo":"BerriAI/litellm","slug":"guardrail-request-guardrail-name-not-found-pl","errorCode":null,"errorMessage":"Guardrail '{request.guardrail_name}' not found. Please ensure the guardrail is configured in your LiteLLM proxy.","messagePattern":"Guardrail '(.+?)' not found\\. Please ensure the guardrail is configured in your LiteLLM proxy\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_endpoints.py","lineNumber":2313,"sourceCode":"        version,\n    )\n    from litellm.proxy.utils import handle_exception_on_proxy\n\n    data: dict = {\n        \"guardrail_name\": request.guardrail_name,\n        \"input\": [request.text],\n        \"messages\": request.messages or [],\n        \"metadata\": {\"route\": \"/apply_guardrail\"},\n    }\n    litellm_logging_obj = None\n    start_time: Final = datetime.now(timezone.utc)\n\n    try:\n        active_guardrail: Final[CustomGuardrail | None] = GUARDRAIL_REGISTRY.get_initialized_guardrail_callback(\n            guardrail_name=request.guardrail_name\n        )\n        if active_guardrail is None:\n            raise HTTPException(\n                status_code=404,\n                detail=f\"Guardrail '{request.guardrail_name}' not found. Please ensure the guardrail is configured in your LiteLLM proxy.\",\n            )\n\n        request_processor: Final = ProxyBaseLLMRequestProcessing(data=data)\n        (\n            data,\n            litellm_logging_obj,\n        ) = await request_processor.common_processing_pre_call_logic(\n            request=fastapi_request,\n            general_settings=general_settings,\n            user_api_key_dict=user_api_key_dict,\n            version=version,\n            proxy_logging_obj=proxy_logging_obj,\n            proxy_config=proxy_config,\n            route_type=\"apply_guardrail\",\n        )\n","sourceCodeStart":2295,"sourceCodeEnd":2331,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_endpoints.py#L2295-L2331","documentation":"Raised by the /apply_guardrail endpoint when GUARDRAIL_REGISTRY.get_initialized_guardrail_callback returns None for the requested guardrail_name — no guardrail with that name has been initialized in the running proxy (not in config.yaml, or failed to load). The request is rejected before any text is scanned; the message directs the operator to configure the guardrail first.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_endpoints.py:2313 when the library encounters an invalid state.","commonSituations":"The request referenced a guardrail name not configured on the proxy.","solutions":["Configure the guardrail in the proxy config (guardrails section) with that guardrail_name.","Check the guardrail_name for typos."],"exampleFix":"List configured guardrails via /guardrails/list and use an existing 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-14T05:17:10.506Z"}