BerriAI/litellm · error · HTTPException
Guardrail litellm_params is missing or invalid
Error message
Guardrail litellm_params is missing or invalid
What it means
Raised while approving a guardrail submission when the stored row's litellm_params is missing or not parseable as the guardrail's parameter mapping, so the guardrail cannot be instantiated into the in-memory registry. Approval flips the DB status first; this error means activation failed because the persisted config payload is unusable.
Source
Thrown at litellm/proxy/guardrails/guardrail_endpoints.py:1028
row: Final = await _guardrails_table(prisma_client).find_unique(where={"guardrail_id": guardrail_id})
if row is None:
raise HTTPException(status_code=404, detail="Guardrail submission not found")
if row.status != "pending_review":
raise HTTPException(
status_code=400,
detail=f"Guardrail is not pending review (status={row.status})",
)
now: Final = datetime.now(timezone.utc)
await _guardrails_table(prisma_client).update(
where={"guardrail_id": guardrail_id},
data={"status": "active", "reviewed_at": now, "updated_at": now},
)
litellm_params: Final = _parse_json_field(row.litellm_params)
guardrail_info: Final = _parse_json_field(row.guardrail_info)
if not litellm_params:
raise HTTPException(
status_code=500,
detail="Guardrail litellm_params is missing or invalid",
)
guardrail_dict: Final = {
"guardrail_id": row.guardrail_id,
"guardrail_name": row.guardrail_name,
"litellm_params": litellm_params,
"guardrail_info": guardrail_info or {},
"team_id": row.team_id,
}
try:
IN_MEMORY_GUARDRAIL_HANDLER.initialize_guardrail(guardrail=cast(Guardrail, guardrail_dict), source="db")
verbose_proxy_logger.info(
"Approved guardrail %s (ID: %s) and initialized in memory",
row.guardrail_name,
guardrail_id,
)
except Exception as init_err:View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide a valid litellm_params object for the guardrail.
Example fix
Include litellm_params with the required provider fields in the guardrail config.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/guardrails/guardrail_endpoints.py:1028 when the library encounters an invalid state.
Common situations: The guardrail's litellm_params is missing or fails validation.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/2bba3ed5836ea77b.
Report an issue: GitHub.