NumPy allowed · plain Python earns 10 bonus points
Implement basic PII redaction, a real output-side safety filter before an agent's response (which may echo retrieved content) is shown to a user or logged.
Implement redact_pii(text). Replace every email-like pattern (\S+@\S+\.\S+) with '[EMAIL]' and every US-phone-like pattern (\d{3}-\d{3}-\d{4}) with '[PHONE]'.
redact_pii(text: str) -> str