PII redaction API for LLMs. Remove personal data before sending to ChatGPT, Claude, or any AI.
Input: "Contact John Doe at john@example.com"
Output: "Contact <PERSON> at <EMAIL>"
Masker detects and redacts:
- EMAIL — email addresses
- PHONE — phone numbers
- CARD — credit card numbers
- PERSON — person names (AI-powered)
docker run -p 8000:8000 ghcr.io/kikuai-lab/maskercurl -X POST http://localhost:8000/v1/redact \
-H "Content-Type: application/json" \
-d '{"text": "Email me at john@example.com", "mode": "placeholder"}'Drop-in replacement for /v1/chat/completions that automatically redacts PII:
import openai
client = openai.OpenAI(
base_url="http://localhost:8000/v1",
api_key="your-openai-key",
default_headers={"X-Api-Key": "your-masker-key"}
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "My email is john@example.com"}]
)
# PII redacted before reaching OpenAI- Text & JSON — process plain text or nested JSON
- Policy system — configure mask/drop/placeholder per PII type
- Audit logging — JSONL logs without storing raw text
- Fail modes —
closed(block) oropen(pass-through) - Multi-tenant — API key authentication
- Multi-language — English & Russian NER
git clone https://github.com/KikuAI-Lab/masker.git
cd masker
cp .env.example .env
docker-compose up -dMASKER_API_KEYS=sk-key1:tenant1,sk-key2:tenant2
MASKER_UPSTREAM_URL=https://api.openai.com/v1/chat/completions
MASKER_DEFAULT_FAIL_MODE=closedSee .env.example for all options.
📖 Wiki — full documentation
| Endpoint | Description |
|---|---|
POST /v1/redact |
Redact PII from text or JSON |
POST /v1/chat/completions |
OpenAI-compatible proxy |
GET /health |
Health check |
GET /metrics |
Prometheus metrics |
Stateless by Design. Masker is a firewall, not a storage bucket.
- ✅ Zero Data Retention — Payloads are processed in RAM and forgotten instantly.
- ✅ Local Intelligence — No 3rd party API calls. All ML runs on your CPU.
- ✅ Air-Gapped Logic — Container requires no internet access to function.
📖 Read about our Stateless Architecture to understand how we guarantee data privacy.
AGPL-3.0 — KikuAI OÜ
