diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.py index 086468f16bb..2cbb6c4e8ac 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py +++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py @@ -869,8 +869,10 @@ class _OPTIONAL_PresidioPIIMasking(CustomGuardrail): for ar in reversed(sorted_forward): start = ar["start"] end = ar["end"] - entity_type = ar["entity_type"] - value = text[start:end] + # Annotated because the analyzer result is an untyped mapping: both now + # reach _stable_token_suffix as call arguments, where an Any counts. + entity_type: str = ar["entity_type"] + value: str = text[start:end] suffix = ( self._stable_token_suffix(entity_type, value) if self.presidio_stable_tokens