pii-airlock
Your prompts get the placeholders. You keep the secrets.
A local privacy layer for AI tools: swaps personal data for placeholders before requests leave your machine, then restores the originals in the reply.
Works with Claude Code · GitHub Copilot · Codex · Cursor · Aider · Gemini · any OpenAI-compatible client
Why
Everything you paste into an AI tool is sent to a third party. pii-airlock sits between you and the provider: it spots names, emails, phones, cards, IBANs and secrets, and sends placeholders instead. Answers come back with your real values restored.
John Smith (john@acme.com) → <PERSON_482913> (<EMAIL_ADDRESS_093117>)
Detection runs 100% on your machine (macOS, Linux, Windows · Python ≥ 3.10), built on Microsoft Presidio.
2-minute quickstart
pipx install pii-airlock # or: brew install matinfo-tech/tap/pii-airlock
cd my-project
pii-airlock init # guard this project
That's it. init creates .pii-airlock/ in the project, installs the hooks for Claude Code and GitHub Copilot (once, for your user), and downloads the detection models. From now on, in this project only, prompts and tool calls that contain personal data are stopped before they leave your machine.
pii-airlock status # what is guarded, by which hooks, with which policy
pii-airlock allow "Acme SA" # never PII here (your company, products)
pii-airlock deny "Project X" # always sensitive here (client, code name)
pii-airlock off # pause here (`pii-airlock on` resumes)
Check it works:
pii-airlock doctor # one-command health check
echo "Contact John Smith at john@example.com" | pii-airlock scrub
# → Contact <PERSON_482913> at <EMAIL_ADDRESS_093117>
More install options (Homebrew details, pip, extras): Install guide.
Pick your setup
| You use | Do this | Details |
|---|---|---|
| Claude Code | pii-airlock init — hooks block prompts and tool calls containing PII |
Claude Code guide |
| GitHub Copilot | pii-airlock init — guards Copilot's tool calls |
Copilot guide |
| Cursor, Codex, Aider, SDKs, any OpenAI-compatible client | The gateway (below) | Gateway guide |
| A website chat you paste into | scrub / restore (below) |
Clean a file or text |
The gateway
Point your client at a local address; pii-airlock scrubs on the way out and restores on the way back:
pii-airlock proxy # listens on http://127.0.0.1:8745
export OPENAI_BASE_URL=http://127.0.0.1:8745/openai # OpenAI-compatible tools
export ANTHROPIC_BASE_URL=http://127.0.0.1:8745/anthropic # Anthropic SDK
# Gemini: use base URL http://127.0.0.1:8745/gemini
Per-tool setup (Cursor, Continue, Aider, Gemini SDK…): Gateway guide.
Scrub files or text by hand
echo "Contacte Jean Dupont à jean@acme.fr" | pii-airlock scrub
# → Contacte <PERSON_558644> à <EMAIL_ADDRESS_094087>
# …send the scrubbed text to your LLM, then restore its answer:
echo "J'ai répondu à <PERSON_558644>." | pii-airlock restore
# → J'ai répondu à Jean Dupont.
Works on files too (text, CSV, JSON, Word, PDF): Clean a file or text.
Limits & safety — read this
- Detection is best-effort, not a guarantee. Statistical models miss things; review truly sensitive material. Safety and limits
- Mapping files hold the real values. They are encrypted and git-ignored by default; never commit or share a plain
--mapfile. Data handling - Hooks don't see tool output (what
catprints back). Route traffic through the gateway for full coverage. What hooks cannot see
Configure
Your rules live in .pii-airlock/config.yaml, shared with your team (only protection-tightening settings apply until a teammate runs pii-airlock trust). Allow/deny terms, per-type actions (tokenize, redact, allow, block), placeholder styles, languages and more:
- Tell it what is sensitive · Choose what happens · Placeholders · Languages
- All settings · What it detects · All commands
Community
- ❓ Need help? Troubleshooting, or open a bug report with
pii-airlock --version, your install method, and the exact command + error (never real personal data). - 🤝 Contributing — adding a language or a provider adapter is a great first PR
- 🔒 Security policy — responsible disclosure + the honest threat model
- 📜 Changelog · Code of Conduct
If pii-airlock helps you keep PII out of your AI tools, a ⭐ helps others find it.
License
MIT © Matinfo
Metadata
Release files for pii-airlock 0.9.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pii_airlock-0.9.2.tar.gz | 176.1 kB | With provenance | Details for pii_airlock-0.9.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pii_airlock-0.9.2-py3-none-any.whl | Python 3 | none | any | Details for pii_airlock-0.9.2-py3-none-any.whl |
Total release size: 279.5 kB
Release files / pii_airlock-0.9.2.tar.gz
| Download URL | pii_airlock-0.9.2.tar.gz |
|---|---|
| Size | 176.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad84b6af98bc9a8eebd00cd6510ccd739577ecf9468231f85c2343088bf580e2
|
|
BLAKE2b-256 checksum How to use checksums |
67b45449d16181d6d416f510ed0096eea551be0c69a2049e86305053850d39aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / pii_airlock-0.9.2-py3-none-any.whl
| Download URL | pii_airlock-0.9.2-py3-none-any.whl |
|---|---|
| Size | 103.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ade3393425eaa2662a658ad124142c48648874e75c5718600bc7cbf85f2b2a6
|
|
BLAKE2b-256 checksum How to use checksums |
48d9e41826aea6a5d9abd7bb7d553e6edc711d4d38fd105b5f83b6bce3bef7c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for pii-airlock 0.9.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pii_airlock-0.9.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.