BerriAI/litellm · error · OvalixGuardrailBlockedException

This message was blocked by Ovalix

Error message

This message was blocked by Ovalix

What it means

Error "This message was blocked by Ovalix" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/ovalix/ovalix.py:271

                    message=f"Ovalix guardrail error: {e}",
                    should_wrap_with_default_message=False,
                ) from e

            action_type = (resp.get("action_type") or "").lower()
            blocking_message = self._get_trackers_corrected_message(resp) or BLOCKED_BY_OVALIX_FALLBACK_MESSAGE
            if action_type == BLOCKED_ACTION_TYPE and is_first_response:
                self._block_current_message(blocking_message)
            elif action_type == BLOCKED_ACTION_TYPE:
                post_guardrail_texts.insert(0, blocking_message)
            else:
                corrected_text = self._get_trackers_corrected_message(resp) or llm_response
                post_guardrail_texts.insert(0, corrected_text)
            is_first_response = False
        return post_guardrail_texts

    def _block_current_message(self, blocking_message: str) -> None:
        """Raise OvalixGuardrailBlockedException with the given message (no default wrapper)."""
        raise OvalixGuardrailBlockedException(
            guardrail_name=self.guardrail_name,
            message=blocking_message,
            should_wrap_with_default_message=False,
        )

    def _get_trackers_corrected_message(self, resp: dict) -> str | None:
        """Extract corrected/blocking message content from Tracker checkpoint response."""
        modified: Final = resp.get("modified_data")
        if isinstance(modified, dict) and "content" in modified:
            return modified["content"]
        return None

    @staticmethod
    def get_config_model() -> type["GuardrailConfigModel"] | None:
        from litellm.types.proxy.guardrails.guardrail_hooks.ovalix import (
            OvalixGuardrailConfigModel,
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Review the Ovalix policy that blocked the message and adjust the content.
  2. Check the Ovalix checkpoint configuration to confirm the applied rules are intended.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/ovalix/ovalix.py:271 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/c959bf207198fc68. Report an issue: GitHub.