BerriAI/litellm · error · HTTPException

XecGuard API unreachable (block_on_error=True): {exc}

Error message

XecGuard API unreachable (block_on_error=True): {exc}

What it means

Error "XecGuard API unreachable (block_on_error=True): {exc}" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py:372

        )
        try:
            response: Final = await self.async_handler.post(
                url=endpoint,
                headers={
                    "Authorization": f"Bearer {self.api_key}",
                    "Content-Type": "application/json",
                },
                json=payload,
                timeout=10.0,
            )
            response.raise_for_status()
            return response.json()
        except Exception as exc:
            verbose_proxy_logger.error("XecGuard API error: %s", str(exc))
            if suppress_errors:
                return None
            if self.block_on_error:
                raise HTTPException(
                    status_code=400,
                    detail={
                        "error": (f"XecGuard API unreachable (block_on_error=True): {exc}"),
                        "guardrail_name": self.guardrail_name or "xecguard",
                    },
                ) from exc
            return None

    # ------------------------------------------------------------------
    # Message-assembly helpers (respect the full-history requirement)
    # ------------------------------------------------------------------

    def _build_full_history(
        self,
        request_data: dict,
        inputs: Any,
        input_type: str,
    ) -> list[dict]:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify network connectivity to the XecGuard API.
  2. Set block_on_error=False if requests should proceed during XecGuard outages.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py:372 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/15bf26deb5b92d40. Report an issue: GitHub.