BerriAI/litellm · error · HTTPException
Blocked by XecGuard: policies=[{policies}] trace_id={trace_i
Error message
Blocked by XecGuard: policies=[{policies}] trace_id={trace_id} rationale={rationale} What it means
Error "Blocked by XecGuard: policies=[{policies}] trace_id={trace_id} rationale={rationale}" thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py:168
request_data: dict,
input_type: Literal["request", "response"],
logging_obj: Optional["LiteLLMLoggingObj"] = None,
) -> GenericGuardrailAPIInputs:
messages: Final = self._build_full_history(
request_data=request_data,
inputs=inputs,
input_type=input_type,
)
if not messages:
return inputs
scan_type: Final = "input" if input_type == "request" else "response"
scan_result: Final = await self._call_scan(messages=messages, scan_type=scan_type)
if scan_result is None:
return inputs
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,View on GitHub (pinned to 77b7c6c40c)
Solutions
- Review the listed policies and rationale, then modify the request content.
- Use the trace_id to look up the decision in XecGuard for details.
When it happens
Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py:168 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/fb40bee3ee56c445.
Report an issue: GitHub.