Skip to content

nullpiiMask PII before it reaches an LLM

Personal data and secrets become placeholders before your text leaves your machine — and the real values come back only into your local tools.

How it works

Masked on the way in, restored on the way out

A fine-tuned GLiNER model and a set of pattern recognizers find the values, and an in-memory vault swaps each one for a placeholder and back. The model you call sees only placeholders; the real values return only into the local tools you allow — never into a shell command.

Your machine holds the prompt "Email John Smith at john@acme.io". nullpii masks the person and the email into placeholders kept in an in-memory vault, and only the placeholders cross to the LLM provider. The reply crosses back still masked, and nullpii restores the real values only into the file tools; shell commands keep the placeholders. YOUR MACHINELLM providersees only placeholders{{PII_PRIVATE_PERSON_0_…}}{{PII_PRIVATE_EMAIL_0_…}}YOUR PROMPT Email John Smith at john@acme.ionullpiiGLiNER model+ pattern recognizersin-memory vaultnullpiirestores the valuesonly the tools in the policyFILE TOOLSreal values backSHELL COMMANDSplaceholders stayplaceholders onlyreply with placeholders Your prompt is masked into placeholders by nullpii, the LLM provider sees only the placeholders, and the reply's values are restored by nullpii only into the file tools; shell commands keep the placeholders. YOUR PROMPT Email John Smith at john@acme.ioplaceholders onlynullpiiGLiNER model + pattern recognizersin-memory vaultLLM providersees only placeholders{{PII_PRIVATE_PERSON_0_…}}reply with placeholdersnullpiirestores the valuesfile toolsreal values backshell commandsplaceholders stay

What you get

A local gate in front of the model

Local detection

A fine-tuned GLiNER model plus a set of pattern recognizers, on your CPU or GPU. Your text goes nowhere, and the vault lives in memory only.

Built for coding agents

Masks tool output — files, logs, command output — not only prompts, and keeps links to code hosts and documentation readable. Built and tested with Claude Code, through the mod or the gateway.

Works with any model

Mask before your LLM call and restore after it. Or point your client at the gateway, in front of the Anthropic Messages API or the OpenAI Chat Completions API.

One policy for everything

One JSON file decides what gets masked, for the library, the CLI, the gateway and the Claude Code mod: per category, mask it, ask first, or leave it readable.

Reversible by design

A placeholder belongs to its session, and one value always gets the same placeholder. Streaming restore puts the real values back into chunked replies.

Measured, losses included

Benchmarked on coding-agent traffic and held-out document sets, with the cases it loses published too. See the benchmark.

Install

One npm install

npm install nullpii onnxruntime-node

You need Node 22 or later. On first use, nullpii downloads the model (1.2 GB) into ~/.cache/nullpii/.

For Claude Code, use the mod or run the gateway in front of the API.

Released under the Apache-2.0 License.