🛡️ pii-veil: Ultrafast Reversible PII & Secret Anonymizer
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:
crates/veil-core(crates.iolibrary:pii-veil-core)crates/veil-cli(crates.io/ Homebrew CLI binary + built-in MCP Server & HTTP/SSE Proxy:veil)crates/veil-ffi(crates.ioC-ABIcdylib/staticlib+pii_veil.h:pii-veil-ffi)crates/veil-py(PyPIpackage viaPyO3&maturin:pii-veil)crates/veil-node(npmpackage vianapi-rs:@pii-veil/node)sdks/go(Go SDK +net/httpDLP middleware + Rustveil mcpbridge:github.com/glastor-core/pii-veil/sdks/go)
✨ Key Capabilities
- Reversible LLM Roundtrip & Real-Time SSE Streaming (
PlaceholderMode): Replaces sensitive data with semantic tokens ([EMAIL_1],[CREDIT_CARD_1],[IBAN_1]), restores full responses in $O(N)$ viaaho-corasick, or restores live token streams chunk-by-chunk ([EMA+IL_1]) viaStreamingRestorer. - Built-in Model Context Protocol (
veil mcp) & HTTP/SSE Proxy (veil proxy):veil mcp: Zero-dependency JSON-RPC 2.0 MCP server overstdioexposingveil_redact,veil_restore,veil_redact_json, andveil_scandirectly 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 incomingtext/event-streamSSE 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.vaultfiles 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-gigabytepg_dumpSQL streams (COPY ... FROM stdin), column-aware.csvfiles, and.jsonllogs 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/)
examples/python_fastapi_llm_streaming.py— FastAPI + OpenAI/Anthropic SSE streaming withStreamingRestorerand encrypted Vaults.examples/typescript_nextjs_ai_sdk.ts— Next.js / Vercel AI SDKTransformStreamwithVeilStreamingRestorer.examples/go_http_dlp_middleware.go— Gonet/httpDLP middleware (piiveil.NewDlpMiddleware) & SSE restorer.examples/git_pre_commit_hook.sh— Git pre-commit DLP hook powered byveil scan --fail-on-detect.
Metadata
Release files for glastor-pii-veil 0.1.1
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 |
|---|---|---|---|---|
| glastor_pii_veil-0.1.1.tar.gz | 33.1 kB | Without provenance | Details for glastor_pii_veil-0.1.1.tar.gz |
Built distributions (wheels)
Total release size: 5.2 MB
Release files / glastor_pii_veil-0.1.1.tar.gz
| Download URL | glastor_pii_veil-0.1.1.tar.gz |
|---|---|
| Size | 33.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
caa70cc9955eb69f8c9775c14f6bfde4e32705c2389a4b30c028197fba96614d
|
|
BLAKE2b-256 checksum How to use checksums |
4e196f0bd4913486bc29a1256eb852045146bd0952869ecdd04be34d585a82fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Release files / glastor_pii_veil-0.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | glastor_pii_veil-0.1.1-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 |
18e44496d8d74d45f3d0410bd95095cff79beb5907ffa4114b85f7d2b11027a8
|
|
BLAKE2b-256 checksum How to use checksums |
6b7ea4e25a44cf8ab92690d45358ab76e0bc174d13f29c002d751900c2e7b57d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Release files / glastor_pii_veil-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | glastor_pii_veil-0.1.1-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 |
5280e2047fe3dd275d130aec8f38fd3827623ff958603e36123c3a2273c1cd17
|
|
BLAKE2b-256 checksum How to use checksums |
b372e064fdceb1e3ee38f27c713c3bb398e82bf3c25cd705567c9374cdb14d8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Release files / glastor_pii_veil-0.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | glastor_pii_veil-0.1.1-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 |
d98e8469e75b68e327b70d716235df46f4bfb3ea39a3b2b5e2a1839def1a30aa
|
|
BLAKE2b-256 checksum How to use checksums |
65e8175486e0a7b17a7eef67f36eeb8817085715ed3d1c2a8b8a66a4926721f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Release files / glastor_pii_veil-0.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | glastor_pii_veil-0.1.1-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 |
b4eb3893f53cbb1710fd7df2338818038aab7ff6bfeeb4217e48d3bb4ef57367
|
|
BLAKE2b-256 checksum How to use checksums |
ab44534c3246970869e5b9d948802b88e68ba7d50334def31573c89849d86d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Release files / glastor_pii_veil-0.1.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | glastor_pii_veil-0.1.1-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 |
10a571e429886975454b4002716c1d2cfdb052ab47d466c2bcfeb284fa5875f0
|
|
BLAKE2b-256 checksum How to use checksums |
4fdb9055b877e546929143b417f33a2449774edc3d25c6fa1825ff0aa1eb212c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Security for glastor-pii-veil 0.1.1
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.