Skip to main content
pii-airlock logo

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.

CI PyPI Python License: MIT

Works with Claude Code · GitHub Copilot · Codex · Cursor · Aider · Gemini · any OpenAI-compatible client

📖 User guide · Quickstart · Pick your setup · Help

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.

Terminal demo: pii-airlock scrubs a name and an email from a prompt, then restores them in the reply

2-minute quickstart

pipx install "pii-airlock[proxy]"   # or: brew install matinfo/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 --map file. Data handling
  • Hooks don't see tool output (what cat prints 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:

Community

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.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pii-airlock 0.8.3
File Size Uploaded Provenance Actions
pii_airlock-0.8.3.tar.gz 137.5 kB With provenance Details for pii_airlock-0.8.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pii-airlock 0.8.3
File Interpreter ABI Platform Actions
pii_airlock-0.8.3-py3-none-any.whl Python 3 none any Details for pii_airlock-0.8.3-py3-none-any.whl

Total release size: 223.8 kB

Release files / pii_airlock-0.8.3.tar.gz

Download URL pii_airlock-0.8.3.tar.gz
Size 137.5 kB
Tags Source
SHA-256 checksum
How to use checksums
80724dc72826db27eeb2e10d66843ab9c39954c18c6a467055ec64f73ac561c1
BLAKE2b-256 checksum
How to use checksums
5df17c21da9f16541180c84a5d58a99cbc7537a9b5b823f5eee0ee2fe05849a7
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 log

Release files / pii_airlock-0.8.3-py3-none-any.whl

Download URL pii_airlock-0.8.3-py3-none-any.whl
Size 86.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efdf34494f26ccf34e77cf6455ad3a1aad53606b139e661fe878c1b63238d7be
BLAKE2b-256 checksum
How to use checksums
2dfb588008f6642d2e231ba286b18191b5d01cbd94e45b14dd0944df6fa4ad8a
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 log

Security for pii-airlock 0.8.3

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.

Select from 2 files

Attestation for pii_airlock-0.8.3.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page