{"record":{"id":"464697803fd0e1a1","repo":"BerriAI/litellm","slug":"presidio-pii-anonymization-failed-type-e-name","errorCode":null,"errorMessage":"Presidio PII anonymization failed: {type(e).__name__}","messagePattern":"Presidio PII anonymization failed: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/presidio.py","lineNumber":533,"sourceCode":"            redacted_text: Final = await self._post_presidio_anonymize(text, analyze_results)\n            if redacted_text is None:\n                raise Exception(\"Invalid anonymizer response: received None\")\n\n            verbose_proxy_logger.debug(\"redacted_text: %s\", redacted_text)\n\n            if not output_parse_pii:\n                return self._finalize_presidio_anonymize_simple(redacted_text, masked_entity_count)\n\n            return self._finalize_presidio_anonymize_numbered_tokens(\n                text, analyze_results, request_data, masked_entity_count\n            )\n        except Exception as e:\n            # Sanitize exception to avoid leaking the original text (which may\n            # contain API keys or other secrets) in error responses.\n            error_str: Final = str(e)\n            if \"Invalid anonymizer response\" in error_str or \"Presidio anonymizer returned\" in error_str:\n                raise\n            raise Exception(f\"Presidio PII anonymization failed: {type(e).__name__}\") from e\n\n    def filter_analyze_results_by_score(\n        self, analyze_results: list[PresidioAnalyzeResponseItem] | _PresidioAnonymizeResponse\n    ) -> list[PresidioAnalyzeResponseItem] | _PresidioAnonymizeResponse:\n        \"\"\"\n        Drop detections that fall below configured per-entity score thresholds\n        or match an entity type in the deny list.\n        \"\"\"\n        if not self.presidio_score_thresholds and not self.presidio_entities_deny_list:\n            return analyze_results\n\n        if not isinstance(analyze_results, list):\n            return analyze_results\n\n        filtered_results: Final[list[PresidioAnalyzeResponseItem]] = []\n        deny_list_strings: Final = [getattr(x, \"value\", str(x)) for x in self.presidio_entities_deny_list]\n        for item in analyze_results:\n            entity_type = item.get(\"entity_type\")","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/presidio.py#L515-L551","documentation":"Error \"Presidio PII anonymization failed: {type(e).__name__}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/presidio.py:533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the proxy logs for the underlying Presidio exception.","Verify the Presidio analyzer/anonymizer endpoints and language configuration.","Confirm the input text encoding and size are within Presidio limits."],"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"}