Skip to main content
skill CX Codex

privacy-parser-pii-extraction — Claude Code skill

Returns personal data found in a string as labelled spans with character offsets. Useful when a log or document has to be inspected before it leaves your machine.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add reason-machines/trending-skills --skill privacy-parser-pii-extraction -a claude-code
Open on GitHub

What privacy-parser-pii-extraction does

This skill wraps the privacy-parser library, which flips OpenAI's Privacy Filter around. The filter hides PII behind <REDACTED>; here you get the spans back — label, matched text, and where it sits in the original string. Same opf 1.5B weights, same label set.

Three backends ship with it. PIIParser skips the model entirely and matches known formats with regex in microseconds. ModelPIIParser runs the network alone. HybridPIIParser adds span merging plus a regex backstop for secrets, account numbers and URLs, and that is the one to put in production code. Labels cover names, emails, phones, addresses, private URLs, personal dates, account numbers and secrets.

The first call pulls the opf 1.5B checkpoint, roughly 3 GB, into ~/.opf/privacy_filter/; later runs read it from cache. On GPU the model wants about 3 GB of VRAM, so fall back to device="cpu" if that is tight — CPU parsing lands near 600 ms. Offsets index the exact string handed to parse(), so strip or normalise your text only after parsing if you plan to use them.

What it helps with

  • pull emails, phones and account numbers out of a log with offsets
  • label a dataset of personal data for training
  • check whether tokens or passwords leaked into a support ticket
  • export every PII span from a document as JSON before publishing
  • mask the fragments after reviewing what was found

Example prompts for the agent

  • Run this text through privacy-parser and list every PII span with its offsets
  • Find secrets and account numbers in dump.txt and print the result as JSON
  • Parse the string for personal data and replace each span with its label in square brackets

How to install privacy-parser-pii-extraction

1Skills CLI (Vercel)

npx skills add reason-machines/trending-skills --skill privacy-parser-pii-extraction -a claude-code

2Manually: put the files in place

~/.claude/skills/privacy-parser-pii-extraction/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/privacy-parser-pii-extraction/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about privacy-parser-pii-extraction

How do I install privacy-parser-pii-extraction in Claude Code?

Run npx skills add reason-machines/trending-skills --skill privacy-parser-pii-extraction -a claude-code. The skill lands at ~/.claude/skills/privacy-parser-pii-extraction/SKILL.md.

What does privacy-parser-pii-extraction do?

It scans text and hands back a list of spans, each with a label, the matched substring, and start and end offsets. Nothing is masked for you — you decide what happens to the findings.

How is HybridPIIParser different from ModelPIIParser?

The hybrid merges adjacent spans carrying the same label and adds regex patterns on top of the model output. Secrets, account numbers and URLs are where the model alone misses most, so the gap shows up there.

Similar skills

All skills for Security →

From the same set186

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor