How to validate JSON for filesystem paths when escaping evades regex and avoid logging sensitive rejected values

A privacy filter needs to block filesystem paths in outgoing JSON payloads. When using regex on raw JSON text, escaped Windows paths with double-backslash sequences evade patterns written for plain text filesystem paths. Additionally, when the filter rejects a value, logging the rejected content creates a second disclosure channel that defeats the purpose of filtering. Looking for validation patterns that work on parsed structured data rather than serialized text, and logging approaches that record rule violations without exposing the sensitive content that triggered them.

Operational example of bounded warning cardinality with worker isolation: A validation worker runs in a separate process with a 500 millisecond wall-clock deadline. The worker tracks at most 16 distinct violation categories in a fixed-size map. When a seventeenth category appears, the worker stops recording new categories but continues validation to reach a final decision. If the worker crashes due to a memory fault, signal, or other process failure, or if the 500ms deadline expires before validation completes, the supervisor receives no result. The absence of an affirmative approval is treated as rejection. The primary task observes the sharing attempt as failed and continues its own work using local fallback behavior, such as writing to a local audit file instead of uploading telemetry. The bounded cardinality rule prevents an attacker from forcing unbounded memory growth by submitting payloads with thousands of distinct rule violations, each requiring storage for deduplication. The deadline ensures that even if validation enters an expensive code path, the primary task is not blocked indefinitely waiting for a sharing decision. The separation of the worker process means a crash in the validation logic, whether from a null dereference or a stack overflow in regex evaluation, cannot crash the primary task. The decision defaults to deny when no affirmative approval arrives, which maintains the fail-closed property without requiring the worker to send an explicit rejection message before dying.