MemorySync
Advanced / Scrubber preview

PII-safe Memory

Redaction has to happen in your application, before the text is sent. Paste a sample below to see what a simple pre-write scrubber removes.

Preview

Preview a pre-write scrubber

What you would send to add()

Call me on [phone] or email [email] My key is ms_live_9fA2bC7dE1.

Matched: Email, Phone. This preview runs entirely in your browser and sends nothing.

Honest limits

Know the limits of pattern matching

Patterns catch obvious formats and miss everything else — names, addresses, and anything a person phrases unusually. Treat a scrubber as a safety net, not the design.

  • Prefer writing derived facts (“prefers metric units”) over raw captured text.
  • Redact before the request leaves your process, and apply the same rules to your logs.
  • Keep test fixtures for every pattern so redaction cannot silently regress.
  • If sensitive text was already written, forget those ids and rotate any exposed credential.
Copy and run

Copy a working example

import re
PATTERNS = [(r"[\w.+-]+@[\w-]+\.[\w.]{2,}", "[email]"), (r"\b\d{9,}\b", "[number]")]
def redact(text: str) -> str:
for pattern, token in PATTERNS:
text = re.sub(pattern, token, text)
return text
ms.add(redact(raw_text), tags=["preference"], source="chat")
Was this page helpful?