Bases: str, Enum
Strategy for handling detected PII.
- MASK: replaces each PII with a type-specific placeholder, e.g. [EMAIL], [SSN]
- REDACT: replaces all PII with the generic [REDACTED] placeholder
Source code in llmfy/guardrails/pii/pii_strategy.py
| class PIIStrategy(str, Enum):
"""Strategy for handling detected PII.
- MASK: replaces each PII with a type-specific placeholder, e.g. [EMAIL], [SSN]
- REDACT: replaces all PII with the generic [REDACTED] placeholder
"""
MASK = "mask"
REDACT = "redact"
def __str__(self) -> str:
return self.value
def __repr__(self) -> str:
return f"'{self.value}'"
|
MASK = 'mask'
class-attribute
instance-attribute
REDACT = 'redact'
class-attribute
instance-attribute
__str__()
Source code in llmfy/guardrails/pii/pii_strategy.py
| def __str__(self) -> str:
return self.value
|
__repr__()
Source code in llmfy/guardrails/pii/pii_strategy.py
| def __repr__(self) -> str:
return f"'{self.value}'"
|