BerriAI/litellm · error · GuardrailRaisedException

Streamed response could not be verified for tool permissions

Error message

Streamed response could not be verified for tool permissions (not a parseable Anthropic SSE stream), blocking it

What it means

Error "Streamed response could not be verified for tool permissions (not a parseable Anthropic SSE stream), blocking it" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/guardrails/guardrail_hooks/tool_permission.py:894

        assembled_model_response: Final[ModelResponse | TextCompletionResponse | None] = (
            stream_chunk_builder(chunks=all_chunks) if not is_raw_sse_stream(all_chunks) else None
        )
        if isinstance(assembled_model_response, ModelResponse):
            denied_tools = self._check_assembled_stream(assembled_model_response)
            if denied_tools:
                self._modify_response_with_permission_errors(assembled_model_response, denied_tools)

            mock_response: Final = MockResponseIterator(model_response=assembled_model_response)
            # Return the reconstructed stream
            async for chunk in mock_response:
                yield chunk
            return

        anthropic_response: Final = assemble_anthropic_sse_stream(all_chunks)
        if anthropic_response is None:
            if is_raw_sse_stream(all_chunks):
                raise GuardrailRaisedException(
                    guardrail_name=self.guardrail_name,
                    message=(
                        "Streamed response could not be verified for tool permissions "
                        "(not a parseable Anthropic SSE stream), blocking it"
                    ),
                )
            for chunk in all_chunks:
                yield chunk
            return

        anthropic_denials: Final = self._check_assembled_stream(anthropic_response)
        if not anthropic_denials:
            for chunk in all_chunks:
                yield chunk
            return

        self._modify_response_with_permission_errors(anthropic_response, anthropic_denials)
        for sse_chunk in anthropic_sse_chunks_from_response(anthropic_response):

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Ensure the upstream model returns a valid Anthropic SSE stream for tool-permission-checked requests.
  2. If verification is not possible for this provider, exclude it from tool permission guardrails.

When it happens

Trigger: Thrown at litellm/proxy/guardrails/guardrail_hooks/tool_permission.py:894 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/9ed93ae055870756. Report an issue: GitHub.