{"record":{"id":"69c849d3d0ba7cd3","repo":"BerriAI/litellm","slug":"guardrail-pipeline-error","errorCode":"guardrail_pipeline_error","errorMessage":"Content blocked by guardrail pipeline '{policy_name}'","messagePattern":"Content blocked by guardrail pipeline '(.+?)'","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/utils.py","lineNumber":1350,"sourceCode":"            step_results_serializable: Final = [\n                {\n                    \"guardrail\": sr.guardrail_name,\n                    \"outcome\": sr.outcome,\n                    \"action\": sr.action_taken,\n                }\n                for sr in result.step_results\n            ]\n            error_detail: Final = {\n                \"error\": {\n                    \"message\": f\"Content blocked by guardrail pipeline '{policy_name}'\",\n                    \"type\": \"guardrail_pipeline_error\",\n                    \"pipeline_context\": {\n                        \"policy\": policy_name,\n                        \"step_results\": step_results_serializable,\n                    },\n                }\n            }\n            raise HTTPException(status_code=400, detail=error_detail)\n\n        if result.terminal_action == \"modify_response\":\n            raise ModifyResponseException(\n                message=result.modify_response_message or \"Response modified by pipeline\",\n                model=data.get(\"model\", \"unknown\"),\n                request_data=data,\n                guardrail_name=f\"pipeline:{policy_name}\",\n                detection_info=None,\n            )\n\n        return data\n\n    # The actual implementation of the function\n    @overload\n    async def pre_call_hook(\n        self,\n        user_api_key_dict: UserAPIKeyAuth,\n        data: None,","sourceCodeStart":1332,"sourceCodeEnd":1368,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/utils.py#L1332-L1368","documentation":"Policy-enforcement error raised when a guardrail pipeline's step results include a blocking outcome: at least one guardrail in the named policy flagged the content and its action stopped the call. The error body embeds the policy name and per-step outcomes so callers can see which guardrail fired; this is intended content moderation, not a system fault.","triggerScenarios":"Thrown at litellm/proxy/utils.py:1350 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Modify the request content so it passes the guardrail policy, or adjust the policy configuration if it is a false positive."],"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"}