{"record":{"id":"55f49b5054c4073b","repo":"BerriAI/litellm","slug":"no-callback-found-for-guardrail-guardrail-name","errorCode":null,"errorMessage":"No callback found for guardrail: {guardrail_name}","messagePattern":"No callback found for guardrail: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/utils.py","lineNumber":1072,"sourceCode":"            data: Request data\n            user_api_key_dict: User API key auth\n            call_type: Type of call\n            response: Response object (for post_call hooks)\n\n        Returns:\n            Result from the guardrail execution\n        \"\"\"\n        from litellm.proxy.proxy_server import llm_router\n\n        if llm_router is None:\n            raise ValueError(\"Router not initialized\")\n\n        # Select guardrail using router's load balancing\n        selected_guardrail: Final = llm_router.get_available_guardrail(guardrail_name=guardrail_name)\n\n        callback: Final[CustomGuardrail | None] = selected_guardrail.get(\"callback\")\n        if callback is None:\n            raise ValueError(f\"No callback found for guardrail: {guardrail_name}\")\n\n        return await self._execute_guardrail_hook(\n            callback=callback,\n            hook_type=hook_type,\n            data=data,\n            user_api_key_dict=user_api_key_dict,\n            call_type=call_type,\n            response=response,\n        )\n\n    async def _process_guardrail_callback(\n        self,\n        callback: CustomGuardrail,\n        data: dict,\n        user_api_key_dict: UserAPIKeyAuth | None,\n        call_type: CallTypesLiteral,\n        event_type: GuardrailEventHooks,\n    ) -> dict | None:","sourceCodeStart":1054,"sourceCodeEnd":1090,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/utils.py#L1054-L1090","documentation":"After the router selected a deployment for the named guardrail, no CustomGuardrail callback was found under that guardrail_name in the loaded callbacks. The config references a guardrail that was never registered (typo in the name, or the guardrail block failed to load), so there is nothing to execute.","triggerScenarios":"Thrown at litellm/proxy/utils.py:1072 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register a callback for the named guardrail or correct the guardrail_name in your config."],"exampleFix":null,"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"}