BerriAI/litellm · error · HTTPException

Violated Pangea guardrail policy

Error message

Violated Pangea guardrail policy

What it means

Error "Violated Pangea guardrail policy" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/pangea/pangea.py:141

        endpoint: Final = f"{self.api_base}/{api}"

        headers: Final = {
            "Authorization": f"Bearer {self.api_key}",
            "Content-Type": "application/json",
        }

        verbose_proxy_logger.debug(
            "Pangea Guardrail (%s): Calling endpoint %s with payload: %s", hook_name, endpoint, payload
        )

        response: Final = await self.async_handler.post(url=endpoint, json=payload, headers=headers)
        response.raise_for_status()

        result: Final = response.json()

        if result.get("result", {}).get("blocked"):
            verbose_proxy_logger.warning("Pangea Guardrail (%s): Request blocked. Response: %s", hook_name, result)
            raise HTTPException(
                status_code=400,  # Bad Request, indicating violation
                detail={
                    "error": "Violated Pangea guardrail policy",
                    "guardrail_name": self.guardrail_name,
                },
            )
        verbose_proxy_logger.debug(
            "Pangea Guardrail (%s): Request passed. Response: %s", hook_name, result.get("result", {}).get("detectors")
        )

        return result

    async def _async_pre_call_hook(
        self,
        user_api_key_dict: UserAPIKeyAuth,
        cache: DualCache,
        data: dict,
        call_type: str,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Modify the request to comply with the Pangea guardrail policy that fired.
  2. Review the enabled Pangea services (e.g. redact, malicious prompt detection) and their thresholds.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/pangea/pangea.py:141 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/84ca250750d5ac87. Report an issue: GitHub.