# PII & Secret Redactor: Free Offline Privacy Scrubber

> Scans local logs, CSVs, JSON, Markdown, .env, or HAR files offline to redact PII and secrets with reversible or permanent placeholders, returning sanitized copies, a local restore vault, and a zero-leak verification report.

PII & Secret Redactor: Free Offline Privacy Scrubber is a free AI agent skill on Agensi by ClumsyMoney, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [ClumsyMoney](https://www.agensi.io/creators/clumsymoney)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-12-02
- Security: scan passed (2026-12-02); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/pii-secret-redactor-free-offline-privacy-scrubber
- Tags: security, productivity, data-databases, coding, automation

## About this skill

Sanitizes logs, CSV exports, HAR captures, and .env files locally before sharing with teammates or AI tools. Masks customer PII, auth tokens, and production API keys offline with zero network calls while preserving original file structure.

**PII & Secret Redactor** is a 100% free, 100% offline Python 3.9+ privacy scrubber that cleans local files before they ever leave your machine—with zero pip installs, zero API keys, and zero network requests.

### What It Does
- **Checksum- & Entropy-Validated Detection (`redact_files.py`)**: Detects emails (skipping RFC 2606 example domains), US SSNs (filtering invalid SSA areas), payment card numbers (ISO/IEC 7812 Luhn Mod-10), IBANs (ISO 13616 Mod-97 across 24 countries), public IPv4/IPv6 addresses (preserving RFC 1918 private and RFC 5737 doc IPs by default), provider tokens (AWS, GitHub, Stripe, Slack, Google, JWT, Bearer headers, PEM keys), and high-entropy secret assignments—while ignoring UUIDs, Git commit SHAs, and non-Luhn order IDs.
- **Format-Preserving Redaction**: Parses `JSON`, `JSONL`, `HAR 1.2`, `CSV`, `TSV`, and `.env` natively so sanitized outputs stay valid, parseable, and column-aligned. Scrubs HAR headers, cookies, `postData.text`, and `request.queryString` + `request.url` in sync.
- **Permanent Masking or Reversible Tokenization (`restore_tokens.py`)**: Choose permanent `[REDACTED:EMAIL]` masks or deterministic reversible `<<EMAIL_001>>` tokens backed by a local `0600` vault JSON so you can restore values locally after debugging.
- **Independent Zero-Leak Verification Gate (`verify_zero_leak.py`)**: Re-scans sanitized outputs against all active rules and vault fingerprints without printing raw secrets, exiting `0` (`PASS`) or `1` (`FAIL`) with exact `file:line:col` locations.

### Supported File Formats
1. Logs & plain text (`.log`, `.txt`, `.md`, `.sql`)
2. Structured tables (`.csv`, `.tsv`)
3. JSON & newline-delimited JSON (`.json`, `.jsonl`)
4. Browser network captures (`.har` 1.2)
5. Environment configs (`.env`, including database URI credentials)

## Requires

- Python 3.9+

## Known limitations

This toolkit scrubs text-based formats (logs, Markdown, CSV/TSV, JSON/JSONL, HAR 1.2, .env, SQL) using deterministic rules, checksums, and entropy thresholds; it does not perform OCR on binary images/PDFs or contextual NER for arbitrary unformatted person names in free-form prose.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the PII & Secret Redactor: Free Offline Privacy Scrubber skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Does this skill upload my logs or sensitive files to any cloud service?

No. Every script runs 100% offline using Python 3.9+ standard library only. Zero network requests, zero API keys, and zero raw secrets are ever printed to stdout.

### Will redacting a JSON, HAR, or CSV file break its syntax?

No. Structured formats are parsed natively with Python's json and csv modules, scrubbed at the leaf-value level, and re-serialized cleanly so quotes, escaping, and column counts remain valid.

### How does it avoid false positives on order IDs, UUIDs, or private IPs?

Payment cards require ISO/IEC 7812 Luhn validation, IBANs require ISO 13616 Mod-97 checksums, US SSNs filter invalid SSA area codes (000, 666, 900-999), UUIDs and Git SHAs are allowlisted, and RFC 1918/5737 private/doc IPs plus RFC 2606 example domains are preserved by default.

### Can I reverse the redaction locally after troubleshooting?

Yes. Run redact_files.py with --mode tokenize --vault ./private/run.vault.json to generate deterministic <<TYPE_NNN>> placeholders, then run restore_tokens.py locally to restore original values.

### What do I need installed to use this skill?

Only Python 3.9 or newer. There are no pip installs or external dependencies.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
