Skip to main content
Memproof includes a ContentRedactor that applies regex-based patterns to strip sensitive data from memory content before it reaches the storage adapter. Redaction runs as part of the pipeline, after auth and before risk assessment, so downstream components never see raw PII or secrets.

How It Works

The ContentRedactor maintains an ordered list of RedactionPattern objects. When redact() is called, each pattern is applied in order. Matched substrings are replaced with a bracketed placeholder (e.g., [SSN_REDACTED]), and a RedactionResult is returned alongside the safe content.

Default Patterns

The following patterns are enabled out of the box:

Basic Usage

Multiple Matches

The redactor handles content with multiple types of sensitive data in a single pass.

Custom Patterns

Add your own RedactionPattern to handle domain-specific sensitive data.

RedactionResult Fields

The RedactionResult object returned from redact() contains metadata about what was redacted:
The redactor does not store or log the original sensitive values. Once redacted, the raw content is discarded. Audit events record that redaction occurred and which patterns matched, but never the matched content itself.
Combine content redaction with the risk engine. The risk engine detects PII and secrets for scoring purposes; the redactor removes them before persistence. Together they provide defense in depth — even if a policy rule allows the operation, the stored content is already sanitized.