{"record":{"id":"361d554bca6197a6","repo":"BerriAI/litellm","slug":"violated-guardrail-policy","errorCode":null,"errorMessage":"Violated guardrail policy","messagePattern":"Violated guardrail policy","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/aporia_ai/aporia_ai.py","lineNumber":133,"sourceCode":"                }\n'\n        \"\"\"\n\n        response: Final = await self.async_handler.post(\n            url=self.aporia_api_base + \"/validate\",\n            data=_json_data,\n            headers={\n                \"X-APORIA-API-KEY\": self.aporia_api_key,\n                \"Content-Type\": \"application/json\",\n            },\n        )\n        verbose_proxy_logger.debug(\"Aporia AI response: %s\", response.text)\n        if response.status_code == 200:\n            # check if the response was flagged\n            _json_response: Final = response.json()\n            action: str = _json_response.get(\"action\")  # possible values are modify, passthrough, block, rephrase\n            if action == \"block\":\n                raise HTTPException(\n                    status_code=400,\n                    detail={\n                        \"error\": \"Violated guardrail policy\",\n                        \"aporia_ai_response\": _json_response,\n                    },\n                )\n\n    @log_guardrail_information\n    async def async_post_call_success_hook(\n        self,\n        data: dict,\n        user_api_key_dict: UserAPIKeyAuth,\n        response,\n    ):\n        from litellm.proxy.common_utils.callback_utils import (\n            add_guardrail_to_applied_guardrails_header,\n        )\n","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/aporia_ai/aporia_ai.py#L115-L151","documentation":"Raised when Aporia's /validate responds with a non-allow action: the content violated the deployed Aporia guardrail policy, and the action/warning details from the response determine the block.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/aporia_ai/aporia_ai.py:133 when the library encounters an invalid state.","commonSituations":"The Aporia guardrail flagged the request/response as violating policy.","solutions":["Remove the policy-violating content and retry.","Review the Aporia policy configuration if the block is unexpected."],"exampleFix":"Check the Aporia dashboard for violation details.","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-23T08:17:48.524Z"}