| 1 | English | [日本語](docs/i18n/README_ja.md) | [Español](docs/i18n/README_es.md) | [Tiếng Việt](docs/i18n/README_vi.md) | [中文](docs/i18n/README_zh.md) | [한국어](docs/i18n/README_ko.md) | [Français](docs/i18n/README_fr.md) | [Deutsch](docs/i18n/README_de.md) | [Português](docs/i18n/README_pt.md) | [Italiano](docs/i18n/README_it.md) |
| 2 | |
| 3 | # Prompt Anonymizer |
| 4 | |
| 5 | > **A buddy check for your prompts — before they reach an LLM.** |
| 6 | > On-device, reversible anonymization that catches the PII you didn't mean to send. |
| 7 | |
| 8 | [](https://github.com/akazah/prompt-anonymizer/actions/workflows/ci.yml) |
| 9 | [](https://github.com/akazah/prompt-anonymizer/releases) |
| 10 | [](https://pypi.org/project/prompt-anonymizer/) |
| 11 | [](https://www.npmjs.com/package/@prompt-anonymizer/cli) |
| 12 | [](pyproject.toml) |
| 13 | [](LICENSE) |
| 14 | |
| 15 | Your team already has the rule: *don't paste customer data, secrets, or |
| 16 | personal info into ChatGPT / Claude / Gemini.* But people are in a hurry, and |
| 17 | a name or a phone number slips through. Prompt Anonymizer is the buddy check — |
| 18 | it runs **on your machine** and catches that PII **before** the text leaves, |
| 19 | so a slip doesn't become a leak. It doesn't replace the rule or your judgment; |
| 20 | it backs them up. |
| 21 | |
| 22 | | Line of defense against a PII slip | Catches it? | What you trust | |
| 23 | |---|---|---| |
| 24 | | A written policy alone | ✗ relies on memory | everyone, every time | |
| 25 | | Your own last-second vigilance | ~ when you remember | your attention, mid-rush | |
| 26 | | **+ Prompt Anonymizer** | **✓ automatic, on-device** | **code you can read** | |
| 27 | |
| 28 | It replaces PII with consistent labels (`<人名_1>`, `<Name_1>`, `<Nombre_1>`, |
| 29 | `<Tên_1>`, …) **before** the text leaves your machine. Because the same value |
| 30 | always gets the same label, the LLM's answer still makes sense — you're not |
| 31 | trading away frontier intelligence to stay safe. When the reply comes back, |
| 32 | the mapping — which never left your device — restores the real values. |
| 33 | |
| 34 | For people, it's a second pair of eyes in the browser, desktop app, or Chrome |
| 35 | extension. For pipelines, the same check runs automatically — the |
| 36 | OpenAI-compatible proxy masks before egress, and the `scan` gate fails a commit |
| 37 | or CI run when PII slips in. |
| 38 | |
| 39 | Supported languages: English (`en`), Japanese (`ja`), Spanish (`es`), |
| 40 | Vietnamese (`vi`), and — new — Chinese (`zh`), Korean (`ko`), French (`fr`), |
| 41 | German (`de`), Portuguese (`pt`) and Italian (`it`). The default |
| 42 | `PromptAnonymizer(languages=…)` remains `("en", "ja")`; every other language |
| 43 | is opt-in via `languages=[...]`. All UI language pickers and auto-detect |
| 44 | cover all ten. Language support is registry-driven — adding a language is one |
| 45 | registry entry (`languages.py` / `languages.ts`) plus one label file. |
| 46 | |
| 47 | Detection runs on-device (WebGPU / WASM in the browser, spaCy or local |
| 48 | transformers in Python). Don't take our word for it: open DevTools, watch |
| 49 | the network tab, or read the source. It's MIT-licensed and small enough |
| 50 | to audit in one sitting — [docs/AUDIT.md](docs/AUDIT.md) is the |
| 51 | step-by-step procedure. |
| 52 | |
| 53 | <details> |
| 54 | <summary><b>Table of contents</b></summary> |
| 55 | |
| 56 | - [Demo](#demo) |
| 57 | - [Try it](#try-it) |
| 58 | - [Quickstart (Python)](#quickstart-python) |
| 59 | - [Quickstart (JavaScript / TypeScript)](#quickstart-javascript--typescript) |
| 60 | - [Quickstart (local proxy)](#quickstart-local-proxy) |
| 61 | - [Quickstart (MCP server)](#quickstart-mcp-server) |
| 62 | - [Commit-time / CI gate (`scan`)](#commit-time--ci-gate-scan) |
| 63 | - [Why not …?](#why-not-) |
| 64 | - [How it works](#how-it-works) |
| 65 | - [Supported entities](#supported-entities) |
| 66 | - [Accuracy](#accuracy) |
| 67 | - [Limitations](#limitations) |
| 68 | - [Roadmap](#roadmap) |
| 69 | - [Contributing / Security / License](#contributing--se |