# Anonymize Doc

> Detect and anonymize PII (SSN, cards, emails, phones, names) and business data (companies, revenue, costs, pricing). Use when handling sensitive files or user requests anonymization. Check-only or full anonymization with 5 strategies (mask/hash/pseudo/token/mixed). GDPR/HIPAA aware. Use when this capability is needed.

- Skill: `tomevault-io/anonymize-doc` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/anonymize-doc`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/anonymize-doc/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/anonymize-doc

---


# PII & Business Data Anonymization

Detect and anonymize PII + sensitive business data using ML-powered detection (Scrubadub + spaCy NER).

## Instructions

### 0. Dependency Check

```bash
SKILL_DIR="$(dirname "$(realpath "$0")" 2>/dev/null || echo /home/mat/dev/agent-skills/dstoic/skills/anonymize-doc)"
pip install -q -r "$SKILL_DIR/requirements.txt" && python -m spacy download -q en_core_web_sm 2>/dev/null
```

### 1. Ask Mode

**Question:** "Check for PII/business data (detection only) or anonymize?"

### 2. Detection

1. Run: `python "$SKILL_DIR/scripts/detect.py" <file_path>`
2. Parse JSON output → format report (type, line/col, severity, category)
3. Ask: "Proceed with anonymization?"

### 3. Anonymization

**Ask strategy:**

| Strategy | Use Case | Reversible | GDPR |
|----------|----------|------------|------|
| `mask` | Max privacy, redaction | No | ✅ Full |
| `hash` | Analytics, tracking | No | ✅ Full |
| `pseudo` | Demos, case studies | Yes | ⚠️ Partial |
| `token` | Financial, vault-backed | Yes | ⚠️ Partial |
| `mixed` | Complex docs (auto per severity) | Mixed | ⚠️ Partial |

**Run:** `python "$SKILL_DIR/scripts/anonymize.py" <file_path> --strategy <choice>`

**Outputs:** `<file>-anonymized.<ext>` + `<file>-audit-log.json`

### 4. Safety Rules

- Preserve original file — never overwrite
- Never commit audit logs to git — check `.gitignore` has `*-audit-log.json`
- Warn: reversible strategies need secure mapping storage
- GDPR requires irreversible (mask/hash) for full compliance

See `reference.md` for entity types, severity tiers, compliance details.
See `examples.md` for before/after samples.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/digital-stoic-org) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

