BerriAI/litellm · error · HTTPException

Blocked by XecGuard grounding: rules=[{rules_str}] trace_id=

Error message

Blocked by XecGuard grounding: rules=[{rules_str}] trace_id={trace_id} rationale={rationale}

What it means

Error "Blocked by XecGuard grounding: rules=[{rules_str}] trace_id={trace_id} rationale={rationale}" thrown in BerriAI/litellm.

Source

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

        if scan_result.get("decision") == "UNSAFE":
            raise HTTPException(
                status_code=400,
                detail={
                    "error": self._format_scan_block_message(scan_result),
                    "guardrail_name": self.guardrail_name or "xecguard",
                    "xecguard_response": scan_result,
                },
            )

        if input_type == "response":
            documents: Final = self._extract_grounding_documents(request_data)
            if documents:
                grounding_result: Final = await self._call_grounding(
                    messages=messages,
                    documents=documents,
                )
                if grounding_result is not None and grounding_result.get("decision") == "UNSAFE":
                    raise HTTPException(
                        status_code=400,
                        detail={
                            "error": self._format_grounding_block_message(grounding_result),
                            "guardrail_name": self.guardrail_name or "xecguard",
                            "xecguard_response": grounding_result,
                        },
                    )

        return inputs

    async def async_logging_hook(
        self,
        kwargs: dict,
        result: Any,
        call_type: str,
    ) -> tuple[dict, Any]:
        """Observe-only scan for logging_only mode.

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Review the grounding rules listed and adjust the request or data sources.
  2. Use the trace_id to inspect the grounding decision in XecGuard.

When it happens

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