Day 075 / Privacy / Explicit Redaction

PII Redaction Playground

View source ↗Scroll to explore ↓
PII Redaction Playground project cover
/ Overview

Practice recursive JSON field redaction with a local Python CLI and synthetic examples.

NamePII Redaction Playground

ClientIndependent daily build

IndustriesPrivacy education

DateDay 075 · November 16, 2026

/ Challenge

Sharing a structured example requires knowing which fields were removed and which survived. Automatic-looking masking can create misplaced confidence if free text, alternate spellings or identifying keys are left behind.

/ Provided services

Clear thinking.
Practical delivery.

01

Choose the fields

Repeated key options define the redaction contract. Exact matching avoids silently broadening the selection.

02

Replace selected subtrees

A selected value is replaced in full; nested matches inside arrays are handled recursively.

03

Review what survives

Free text, identifying keys and unselected fields may still contain personal information. Successful transformation does not mean safe publication.

PII Redaction Playground feature visual
/ Solution

A standard-library Python CLI reads one UTF-8 JSON file capped at 64 KiB. Repeated key options choose exact, case-insensitive object-key matches at every traversed depth. Selected values become a fixed redaction marker, including entire selected subtrees. Unselected values and array order remain unchanged. Duplicate keys, nonfinite JSON constants and excessive traversed depth are rejected. The source file is unchanged and output goes to stdout. The tool has no network or automatic PII detection and provides no anonymization guarantee.

/ Impact

Explicit field selection

Recursive object and array handling

Synthetic sample included

Bounded parsing and fixed errors

Fourteen passing tests

/ Tech stack

Python standard library

Argparse, pathlib and JSON provide a dependency-free local CLI.

Fourteen tests

Tests cover selection, casing, arrays, subtrees, null values, idempotence, unchanged data and invalid input.

Next project

Secret Leak Pattern Scanner

View case study ↗