BerriAI/litellm · error · HTTPException

statusCode in response: {statusCode_in_response}, errorMsg:

Error message

statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}

What it means

Error "statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:354

                        "action": "ALLOW",
                        "zscaler_ai_guard_response": json_response,
                        "direction": direction,
                    }
                else:
                    verbose_proxy_logger.error(
                        "Action field in response is %s, expecting 'ALLOW', 'BLOCK' or 'DETECT'", guardrail_result
                    )
                    user_facing_error = self._create_user_facing_error(
                        f"Action field in response is {guardrail_result}, expecting 'ALLOW', 'BLOCK' or 'DETECT'"
                    )
                    raise HTTPException(status_code=500, detail=user_facing_error)
            else:
                errorMsg: Final = json_response.get("errorMsg", None)
                verbose_proxy_logger.error("statusCode in response: %s, errorMsg: %s", statusCode_in_response, errorMsg)
                user_facing_error = self._create_user_facing_error(
                    f"statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}"
                )
                raise HTTPException(status_code=500, detail=user_facing_error)
        else:
            verbose_proxy_logger.error("Zscaler AI Guard status_code - %s", response.status_code)
            user_facing_error = self._create_user_facing_error(f"Response status code: {response.status_code}")
            raise HTTPException(status_code=response.status_code, detail=user_facing_error)

    async def make_zscaler_ai_guard_api_call(
        self, zscaler_ai_guard_url, api_key, policy_id, direction, content, **kwargs
    ):
        """
        Makes an API call to the Zscaler AI Guard service and handles retries, errors, and response parsing.
        """

        extra_headers: Final = self._prepare_headers(api_key, **kwargs)

        data: Final = {
            "direction": direction,
            "content": content,
        }

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read errorMsg from the Zscaler response for the server-side cause.
  2. Verify the request payload matches the Zscaler AI Guard API schema.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:354 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/655c6ff14b704c74. Report an issue: GitHub.