BerriAI/litellm · error · HTTPException

Content blocked by Zscaler AI Guard: {self.extract_blocking_

Error message

Content blocked by Zscaler AI Guard: {self.extract_blocking_info(blocking_info)}

What it means

Error "Content blocked by Zscaler AI Guard: {self.extract_blocking_info(blocking_info)}" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:229

            zscaler_ai_guard_result = None
            direction: Final = "OUT" if input_type == "response" else "IN"
            verbose_proxy_logger.debug("direction: %s", direction)
            # Concatenate all texts and send to Zscaler AI Guard
            if texts:
                concatenated_text: Final = " ".join(texts)
                zscaler_ai_guard_result = await self.make_zscaler_ai_guard_api_call(
                    zscaler_ai_guard_url=self.zscaler_ai_guard_url,
                    api_key=self.api_key,
                    policy_id=policy_id,
                    direction=direction,
                    content=concatenated_text,
                    **kwargs,
                )
                verbose_proxy_logger.debug("response from zscaler ai guards: %s", zscaler_ai_guard_result)
            if zscaler_ai_guard_result and zscaler_ai_guard_result.get("action") == "BLOCK":
                blocking_info: Final = zscaler_ai_guard_result.get("zscaler_ai_guard_response")
                error_message = f"Content blocked by Zscaler AI Guard: {self.extract_blocking_info(blocking_info)}"
                raise HTTPException(status_code=400, detail={"error": error_message})
        except HTTPException:
            raise
        except Exception as e:
            verbose_proxy_logger.error("ZscalerAIGuard: Failed to apply guardrail: %s", str(e))
            raise e

        verbose_proxy_logger.debug("ZscalerAIGuard: Successfully applied guardrail.")
        return inputs

    def extract_blocking_info(self, response):
        """
        Extracts transaction ID and blocking detector details from a response.
        """
        transaction_id: Final = response.get("transactionId", None)

        # Find which detectors are invoked and blocking
        blocking_detectors: Final = []
        detector_responses: Final = response.get("detectorResponses", {})

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Review the blocking info from Zscaler AI Guard and modify the request content.
  2. Adjust the Zscaler AI Guard policy if the block is unintended.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:229 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/87b3dabd67288f8d. Report an issue: GitHub.