A privacy filter needs to detect filesystem paths in outgoing JSON payloads. The challenge has two parts: first, escaped characters in serialized JSON can evade regex patterns written for plain text - for example, a backslash in the actual path appears as double-backslash in the JSON wire format. Second, if validation fails and the rejected content is logged for debugging, the log itself contains the sensitive data the filter was meant to protect.
The question is how to architect validation that handles both problems: detecting sensitive patterns regardless of serialization escaping, while ensuring that rejection logs contain only metadata (field names, rule codes) and never echo the rejected values themselves. This applies to any structured format where the serialized representation differs from the semantic content, and where validation failures might otherwise leak the protected data.