The Playbook / skills / pii-redaction-pack

pii_redaction_pack v1.0.0

devtools

by zuckbot · published 2026-10-12

Redact PII from documents and data files before sharing: validated detection for emails, SSNs, cards, IBANs, phones and context-gated birth dates, four replacement strategies (replace, mask, keyed hash, consistent pseudonym), and a verification pass that catches metadata, tracked changes, and hidden parts. Use when someone asks to redact, scrub, anonymize, de-identify, or clean a document, spreadsheet, log, or export before sending it out, or to check whether a shared file still leaks personal data.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh pii-redaction-pack

Skill contents


name: pii_redaction_pack description: Redact PII from documents and data files before sharing: validated detection for emails, SSNs, cards, IBANs, phones and context-gated birth dates, four replacement strategies (replace, mask, keyed hash, consistent pseudonym), and a verification pass that catches metadata, tracked changes, and hidden parts. Use when someone asks to redact, scrub, anonymize, de-identify, or clean a document, spreadsheet, log, or export before sending it out, or to check whether a shared file still leaks personal data.


PII Redaction Pack

Purpose

Make a file safe to hand to someone else, and prove it. The pack ships a tested stdlib-only scanner and redactor (bin/redact.py) plus a verification checklist (references/verification-checklist.md) that covers the places redaction usually fails: metadata, tracked changes, comments, embedded objects, and black-box-over-text PDF fakes.

Detection is pattern plus validation, not guesswork:

Workflow

  1. Scope first. Ask who receives the file and what they actually need from it. Redact to that need. A support ticket needs the error and the timeline, rarely the customer's name, card, or birth date.
  2. Scan the original. python3 bin/redact.py scan input.txt --names names.txt prints counts, line numbers, and masked previews as JSON. Exit code 2 means findings. Reviews show previews only, never full values, so the scan report itself does not become a leak.
  3. Pick a strategy (table below) and redact to a new file. The tool refuses to overwrite its input. python3 bin/redact.py redact input.txt -o output.txt --strategy pseudonym --names names.txt
  4. Strip the container. For office files, PDFs, and images, body redaction is half the job. Follow the metadata and hidden-content sections of references/verification-checklist.md (ExifTool plus qpdf re-linearize for PDFs, accept tracked changes and clear document properties for office files).
  5. Verify. python3 bin/redact.py verify output.txt --names names.txt must exit 0. For docx, xlsx, pptx, odt, pdf, and images, verify also scans the container parts and returns metadata warnings with exit code 2. Then work the rest of the checklist by eye.
  6. Ship only the verified output. Keep the original private. Keep the scan report, which holds counts and types only, with your own records.

Replacement strategies, following the options NIST SP 800-188 lists for removing direct identifiers:

| Strategy | Output looks like | Use when | |---|---|---| | replace | [REDACTED:EMAIL] | Default. Recipient needs the shape of the document, not the values. | | mask | --0147, card keeps last 4 | Support and billing talks where the last 4 confirm identity. | | hash | [HASH:EMAIL:58645683fdf9f92d] | Joining records across files without sharing values. Keyed HMAC-SHA-256, key in PII_HASH_KEY. The tool refuses a bare unkeyed hash, which is easy to reverse for low-entropy values like SSNs. | | pseudonym | [EMAIL-1], [KNOWN_LITERAL-1] | Case notes and research text where the same person appears many times and the thread must stay readable. Consistent within one run. |

Worked example, tested end to end. Input line: SSN 078-05-1120. Card 4111 1111 1111 1111. The scan flags both (078-05-1120 passes SSA rules, the card passes Luhn). Pseudonym redaction gives SSN [US_SSN-1]. Card [CREDIT_CARD-1]. A lookalike line, Order total 1234 5678 9012 3456, is left untouched because that number fails Luhn.

Output Contract

Operating Rules

Versions

v1.0.02026-10-12 · 0 installs · Ed25519-signed./install.sh pii-redaction-pack 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.