Scrubber Module
Protect sensitive information with automatic PII redaction.
RedactPII Operation
Automatically redact personally identifiable information using regex patterns.
Supported PII Types
email- Email addressesphone- Phone numbersip- IP addressescredit_card- Credit card numbersssn- Social Security Numbersurl- URLs
Basic Usage
from prompt_refiner import RedactPII
# Redact all PII types
redactor = RedactPII()
result = redactor.process("Contact john@example.com or 555-123-4567")
# Output: "Contact [EMAIL] or [PHONE]"
# Redact specific types
redactor = RedactPII(redact_types={"email", "phone"})