{"record":{"id":"9ed93ae055870756","repo":"BerriAI/litellm","slug":"streamed-response-could-not-be-verified-for-tool-p","errorCode":null,"errorMessage":"Streamed response could not be verified for tool permissions (not a parseable Anthropic SSE stream), blocking it","messagePattern":"Streamed response could not be verified for tool permissions \\(not a parseable Anthropic SSE stream\\), blocking it","errorType":"exception","errorClass":"GuardrailRaisedException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/tool_permission.py","lineNumber":894,"sourceCode":"\n        assembled_model_response: Final[ModelResponse | TextCompletionResponse | None] = (\n            stream_chunk_builder(chunks=all_chunks) if not is_raw_sse_stream(all_chunks) else None\n        )\n        if isinstance(assembled_model_response, ModelResponse):\n            denied_tools = self._check_assembled_stream(assembled_model_response)\n            if denied_tools:\n                self._modify_response_with_permission_errors(assembled_model_response, denied_tools)\n\n            mock_response: Final = MockResponseIterator(model_response=assembled_model_response)\n            # Return the reconstructed stream\n            async for chunk in mock_response:\n                yield chunk\n            return\n\n        anthropic_response: Final = assemble_anthropic_sse_stream(all_chunks)\n        if anthropic_response is None:\n            if is_raw_sse_stream(all_chunks):\n                raise GuardrailRaisedException(\n                    guardrail_name=self.guardrail_name,\n                    message=(\n                        \"Streamed response could not be verified for tool permissions \"\n                        \"(not a parseable Anthropic SSE stream), blocking it\"\n                    ),\n                )\n            for chunk in all_chunks:\n                yield chunk\n            return\n\n        anthropic_denials: Final = self._check_assembled_stream(anthropic_response)\n        if not anthropic_denials:\n            for chunk in all_chunks:\n                yield chunk\n            return\n\n        self._modify_response_with_permission_errors(anthropic_response, anthropic_denials)\n        for sse_chunk in anthropic_sse_chunks_from_response(anthropic_response):","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/tool_permission.py#L876-L912","documentation":"Error \"Streamed response could not be verified for tool permissions (not a parseable Anthropic SSE stream), blocking it\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/tool_permission.py:894 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the upstream model returns a valid Anthropic SSE stream for tool-permission-checked requests.","If verification is not possible for this provider, exclude it from tool permission guardrails."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}