Skip to main content

scrub_pii_text

Function
This function is defined in the redact module.
Redact API keys, passwords, SSNs, credit cards, and emails from free text. Reuses REDACT_KEYS for key=value pairs and adds value-pattern rules for naked secrets. Zero dependency (stdlib re only).

Signature

Parameters

str
required
Input string — returned unchanged if empty or None.

Returns

str
Scrubbed string with literal secrets replaced by [REDACTED*].

Uses

  • redact_string
  • pat.sub

Source

View on GitHub

praisonaiagents/trace/redact.py at line 147