Skip to main content

🛡️ pii-veil: Ultrafast Reversible PII & Secret Anonymizer

GLASTOR® pii-veil Banner

CI Status Security & SemVer Audit GitHub Release Crates.io Go Reference Python SDK Node.js SDK Docker Distroless Kubernetes Sidecar Benchmarks Compliance License: MIT OR Apache-2.0

Key Capabilities • Quickstart • Benchmarks • Compliance (GDPR / HIPAA / PCI-DSS / LGPD) • Kubernetes Sidecar • Examples

pii-veil is a sub-millisecond, zero-bloat Rust engine for detecting, anonymizing, and restoring PII and secrets across LLM prompts, MCP agents, HTTP/SSE proxies, JSON/NDJSON logs, CSVs, and multi-gigabyte SQL dumps.

Designed with the 6-in-1 Multi-Market Architecture:

  1. crates/veil-core (crates.io library: pii-veil-core)
  2. crates/veil-cli (crates.io / Homebrew CLI binary + built-in MCP Server & HTTP/SSE Proxy: veil)
  3. crates/veil-ffi (crates.io C-ABI cdylib/staticlib + pii_veil.h: pii-veil-ffi)
  4. crates/veil-py (PyPI package via PyO3 & maturin: pii-veil)
  5. crates/veil-node (npm package via napi-rs: @pii-veil/node)
  6. sdks/go (Go SDK + net/http DLP middleware + Rust veil mcp bridge: github.com/glastor-core/pii-veil/sdks/go)

✨ Key Capabilities

  • Reversible LLM Roundtrip & Real-Time SSE Streaming (Placeholder Mode): Replaces sensitive data with semantic tokens ([EMAIL_1], [CREDIT_CARD_1], [IBAN_1]), restores full responses in $O(N)$ via aho-corasick, or restores live token streams chunk-by-chunk ([EMA + IL_1]) via StreamingRestorer.
  • Built-in Model Context Protocol (veil mcp) & HTTP/SSE Proxy (veil proxy):
    • veil mcp: Zero-dependency JSON-RPC 2.0 MCP server over stdio exposing veil_redact, veil_restore, veil_redact_json, and veil_scan directly to Claude Desktop, Cursor, and Windsurf.
    • veil proxy: Local HTTP/SSE reverse proxy (127.0.0.1:8080) that redacts outgoing LLM JSON prompts and restores incoming text/event-stream SSE or JSON responses in real time.
  • 18 Built-in Detectors with Mathematical Checksum Verification:
    • Financial: Credit Cards (Luhn checksum) and IBANs (ISO 13616 Mod-97 checksum).
    • Regional National IDs: US SSN, Spain DNI/NIE (Mod-23 letter table), Argentina CUIT/CUIL (Mod-11 weights), and Chile RUT (Mod-11 verifier).
    • Cloud, AI & Infra Secrets: Database Connection URIs (postgres://, mysql://, mongodb+srv://, redis://), Slack/Discord Webhooks, OpenAI, Anthropic, AWS, GitHub, Slack, Google API, Stripe keys, JWTs, and PEM Private Keys.
    • Network & Contact: Emails, Phones, IPv4, IPv6, and MAC addresses.
  • Authenticated Encrypted Vaults (--vault-pass): Export and restore .vault files encrypted and authenticated with a passphrase for safe storage in Redis, S3, or disk.
  • Constant-Memory Streaming (Lines, NDJSON, SQL, CSV): Anonymize and restore multi-gigabyte pg_dump SQL streams (COPY ... FROM stdin), column-aware .csv files, and .jsonl logs in $O(1)$ memory per line.

🚀 Quickstart

1. Interactive Demo & Benchmark (Rust CLI)

cargo run --release -p pii-veil-cli -- demo
cargo run --release -p pii-veil-cli -- bench

2. Local HTTP/SSE DLP Proxy (veil proxy)

# Start in local LLM echo/SSE simulator mode (or pass --upstream host:port)
veil proxy --listen 127.0.0.1:8080 --echo

3. Redact & Restore with Encrypted Vault (--vault-pass)

# Redact text and save an authenticated encrypted vault
veil redact \
  --text "Charge maria@startup.io (CUIT 20-12345678-6) on card 4532-0151-1283-0366" \
  --vault-out vault.enc \
  --vault-pass "my-secret-passphrase"

# Restore original values from LLM response
veil restore \
  --text "Invoice sent to [EMAIL_1] (tax ID [NATIONAL_ID_1]) for card [CREDIT_CARD_1]." \
  --vault vault.enc \
  --vault-pass "my-secret-passphrase"

4. Stream Multi-GB SQL Dumps, CSVs, or NDJSON Logs

# Anonymize a PostgreSQL dump with deterministic synthetic data (Luhn & Mod-97 valid)
pg_dump mydb | veil stream --format sql --mode synthetic --key "prod-seed" > anon_dump.sql

# Anonymize a CSV file (detects sensitive column headers like password/api_key + regex PII)
veil stream --input users.csv --output anon_users.csv --format csv --vault-out csv.vault

# Stream-restore a huge file in O(1) memory per line
veil restore --file anon_users.csv --output restored_users.csv --vault csv.vault --stream

5. Go SDK (sdks/go)

cd sdks/go
go test -v ./...

6. GitHub Action (glastor-core/pii-veil@v1)

Use pii-veil as a sub-millisecond DLP gatekeeper in any GitHub Actions workflow:

- name: 🛡️ PII & Secret DLP Audit
  uses: glastor-core/pii-veil@v1
  with:
    path: "."
    exclude: "examples,tests"
    fail-on-detect: "true"

📂 Production Examples (examples/)

Metadata

Release files for glastor-pii-veil 0.1.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 glastor-pii-veil 0.1.3
File Size Uploaded Provenance Actions
glastor_pii_veil-0.1.3.tar.gz 33.1 kB Without provenance Details for glastor_pii_veil-0.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for glastor-pii-veil 0.1.3
File Actions
glastor_pii_veil-0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for glastor_pii_veil-0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
glastor_pii_veil-0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for glastor_pii_veil-0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
glastor_pii_veil-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for glastor_pii_veil-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
glastor_pii_veil-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for glastor_pii_veil-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
glastor_pii_veil-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for glastor_pii_veil-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Total release size: 5.2 MB

Release files / glastor_pii_veil-0.1.3.tar.gz

Download URL glastor_pii_veil-0.1.3.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a00a3d561293d0b143821ddfc1eaa7aba3366770ef858c9608a6709c0ea41378
BLAKE2b-256 checksum
How to use checksums
61f1849d569a6a623f19356942e60c97c86323efbe055cd20a8bb211119dda81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / glastor_pii_veil-0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL glastor_pii_veil-0.1.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cd45361926360ed0a28485207f19c09299e012f5c415f6edee079f3d71641c0f
BLAKE2b-256 checksum
How to use checksums
95ea35079ecc41558776361871b407023a0e5c3b1a46ee19a501e437c9ef0b6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / glastor_pii_veil-0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL glastor_pii_veil-0.1.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5a8440b6495fd5ff70d1de59cee08870f28d06a2463eaa2790bf34f1be79f710
BLAKE2b-256 checksum
How to use checksums
ae59af1e49ff800328d917a04e91608f4b36db3c645ad2b00beab27f5407712d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / glastor_pii_veil-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL glastor_pii_veil-0.1.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
10d582aeb2f36594b0edc73ca154e9f52b3ac528a78e778cc54f523c46bea1aa
BLAKE2b-256 checksum
How to use checksums
2aab0e516d5b17163676e29dccea44ad554c8e8d01f2613016450e5710fd3f1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / glastor_pii_veil-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL glastor_pii_veil-0.1.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6b2543caad94e9acc7a087e67c96622833114f77b72a285531476dcf97de05c8
BLAKE2b-256 checksum
How to use checksums
c3bb4877a74bc868dddfb80e852dfb14e23d93a8d19d0b8d81f353e61b0ab412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / glastor_pii_veil-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL glastor_pii_veil-0.1.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7093ba02ad5e77b544784c929530683522933921c9d20fdbc199a6b0b501bf89
BLAKE2b-256 checksum
How to use checksums
33cb70335901b37c530671576b18db85c8943962c26f0e1db6ea9b63d14ad0b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Security for glastor-pii-veil 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.3 This release

6 release files No provenance

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