# openai-privacy-filter

A skill that wires a token-classification model into your project to find and blank out personal data. Useful before shipping logs or documents to an LLM.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 369 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/openai-privacy-filter/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/openai-privacy-filter

## What it does

The model labels text token by token and returns span boundaries in a single forward pass. Eight categories are covered: names, addresses, email, phone numbers, personal URLs, dates, account numbers and secrets such as tokens and API keys. Context window is 128k tokens, license Apache 2.0.

The repo ships an `opf` CLI with three modes: one-shot redaction of a string or file, evaluation on labeled JSONL, and finetuning on your own dataset. The Python API gives you `PrivacyFilter()` with `redact` for one string and `redact_batch` for a list, plus the detected spans with labels and offsets. Precision and recall are tuned through `operating_point` — `high_recall` masks wider, `high_precision` is stricter.

One thing to plan for: the checkpoint downloads to `~/.opf/privacy_filter` on first use, so on a tight disk or a closed network set `OPF_CHECKPOINT` beforehand. GPU inference needs `--device cuda`, otherwise it runs on CPU. Finetuning expects labeled JSONL with spans, so `opf train` has nothing to work with until you build that file.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill openai-privacy-filter -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/openai-privacy-filter/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/openai-privacy-filter/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill openai-privacy-filter -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/openai-privacy-filter/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill openai-privacy-filter -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/openai-privacy-filter/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills openai-privacy-filter
```

2. **Manually: put the files in place**
- File: `.github/skills/openai-privacy-filter/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill openai-privacy-filter -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/openai-privacy-filter
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/openai-privacy-filter/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill openai-privacy-filter -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/openai-privacy-filter/SKILL.md

## When to use it
- strip names and emails from logs before sending them to a model
- mask card and account numbers in an export
- find tokens and API keys inside config text
- score the detector against your own labeled set
- finetune the model for your project's PII format

## Example prompts
- Run `opf -f logs/app.txt` and show me what got masked
- Write a script using `PrivacyFilter(operating_point="high_recall")` and process a batch of texts
- Build a JSONL with spans and run `opf train train.jsonl --output-dir ./my_finetuned_model`

## Similar
- [output-sanitizer](https://affpapa.org/en/nevibecode/skills/output-sanitizer.md) — skill · 475 installs
- [privacy-policy](https://affpapa.org/en/nevibecode/skills/privacy-policy.md) — skill · 3500 installs
- [privacy-engineering](https://affpapa.org/en/nevibecode/skills/privacy-engineering.md) — skill · 352 installs
- [pii-detect](https://affpapa.org/en/nevibecode/skills/pii-detect.md) — skill · 762 installs
- [openai-agents-sdk](https://affpapa.org/en/nevibecode/skills/laguagu-openai-agents-sdk.md) — skill · 2200 installs
- [openai-api-development](https://affpapa.org/en/nevibecode/skills/openai-api-development.md) — skill · 864 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 49 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
