
pii-shield v2.2.3
Zero-code K8s sidecar for log sanitization. Detects secrets via Entropy Analysis, preserves JSON integrity, and redacts PII deterministically. 🛡️
PII-Shield 🛡️
Zero-code log sanitization sidecar for Kubernetes. Prevents data leaks (GDPR/SOC2) by redacting PII from logs before they leave the pod.
PII-Shield runs in-process — CLI, sidecar, or WASM. There is no hosted API and no server your data is sent to.
Same name, different projects. This is not the PII Shield privacy proxy from the Microsoft developer-community blog (May 2026, vikasgautam18/pii-shield), not the piishield.ai or piishield.com prompt-redaction products, and not the
pii-shieldpackage on PyPI by Intellirim. Our packages arepii-shield-wasion PyPI and@aragossa/pii-shield-wasion npm; in prose we call this project the PII-Shield sidecar.
"Don't let PII poison your AI models." PII-Shield ensures that sensitive data never reaches your training dataset, saving you from GDPR-forced model retraining.
[!WARNING] Upgrading to v2.0.0? We have moved end-user distribution to Helm-based installs and Distroless Native Sidecars. Kustomize is no longer a supported release installation path for production users, though the operator repository still keeps Kustomize scaffolding for local development and manifest generation.
/bin/shaccess inside the PII-Shield sidecar is no longer supported. Read the Migration Guide.
Two Deployment Models
PII-Shield offers two distinct ways to integrate into your stack:
- Kubernetes Operator (Zero-code): Our flagship deployment model. A fully automated K8s Operator that injects a highly-secure Distroless Sidecar into your pods to intercept and sanitize logs on the fly.
- In-Process WASM (For core integrations): For extreme performance, the core engine can be embedded directly via WASM, providing
<1mslatency without network hops.
Project Status & Roadmap
PII-Shield is an actively developed open-source security tool in a production-hardening phase. The v2.x release line ships usable CLI, container, Helm/operator, and WASM SDK artifacts. Core redaction paths are ready for controlled deployments, while some Kubernetes deployment modes and supply-chain guarantees are still being stabilized.
| Component | Status |
|---|---|
| Core scanner | Released / controlled deployments |
| CLI sidecar | Released / controlled deployments |
| Kubernetes operator | Stabilization phase |
| WASM SDKs | Released beta |
| Proxy-Wasm gateway integration | Planned R&D |
| Rule server (central rules, panel) | First version, self-hosted image |
| eBPF audit agent (observes stdout/stderr, never redacts) | Experimental, see docs/ebpf-audit.md |
See KNOWN_LIMITATIONS.md for the current production-hardening boundaries.
Why PII-Shield?
Developers often forget to mask sensitive data. Traditional regex filters in Fluentd/Logstash are slow, hard to maintain, and consume expensive CPU on log aggregators.
PII-Shield sits right next to your app container:
- Production-hardening Core Engine: Optimized for Kubernetes sidecars with low memory allocations on hot paths and deterministic regex matching.
- Context-Aware Entropy Analysis: Detected high-entropy secrets even without keys (e.g.
Error: ... 44saCk9...) by analyzing context keywords. - Custom Regex Rules: Deterministic redaction for structured data (UUIDs, IDs) that overrides entropy checks for known patterns.
- Built-in Secret Signatures: Issuer-prefixed credentials — AWS and Google API keys, GitHub, Slack and Stripe tokens, JWTs,
Bearercredentials and PEM private-key blocks — are redacted on their format, so a valid key is caught even when its body is low-entropy or the threshold has been raised. - Telephone Numbers by Shape: International numbers with a
+, North American(555) 234-5678forms and digits under a phone-named key (phone,mobile,wa_id, ...) are hidden even though digits alone never score as a secret. - Identity Numbers by Key: Digits under a key that names an identity document (
idNumber,national_id,ssn,passport_number,tax_id, ...) are hidden; a record id such asuser_idororder_idis not. - Regression & Fuzz Coverage: Tested against stress cases including binary garbage, JSON nesting, and multilingual logs.
- Deterministic Hashing: Replaces secrets with unique hashes (e.g.,
[HIDDEN:a1b2c]), allowing QA to correlate errors without seeing the raw data. - Drop-in: No code changes required. Works with any language (Node, Python, Java, Go).
- Whitelist Support: Explicitly allow safe patterns (e.g., git hashes, system IDs) using
PII_SAFE_REGEX_LISTto prevent false positives.
Managing PII-Shield across dozens of clusters?
A rule server keeps the rule sets in one place: a security team edits a set in the browser, sees on the real scanner what a draft does to pasted log lines, publishes a version, and every cluster whose PiiPolicy names the set pulls it with a read-only token, without a pod restart. Nothing about a cluster is sent to it unless the cluster turns on the stats channel, which sends counters only. It ships as the image ghcr.io/pii-shield/pii-shield-rules for your own perimeter, see docs/rules-server.md. Publications can be signed with keys only the publishers hold, every change goes to an activity log, and an opt-in stats channel shows per cluster which rule version runs and how many values were hidden, as counters only. It runs on SQLite, or on Postgres for several instances; deploy/rules-server runs it on one machine with HTTPS and continuous backups.
Integrations
PII-Shield's in-process WASM build ships inside GuardSpine Code, an open-source AI code-governance GitHub Action, which vendors the binary and credits it in its NOTICE.
Performance Considerations
Measured on 2026-10-25 with the CLI reading stdin and writing a file, one Apple M1 core (GOMAXPROCS=1), Go 1.27.3, 200 000-line corpora, median of 5 runs, main after the 2.2.8 release:
- Text logs (application and syslog-style lines, 122 bytes on average): about 92 000 lines/s, 10.7 MiB/s.
- JSON logs (structured lines with nested objects, 161 bytes on average): about 90 000 lines/s, 13.8 MiB/s. JSON lines go through the quote-aware tokenizer, not
encoding/json, and the hot path makes about seven allocations per line. - nginx access logs (312 bytes on average, a User-Agent on every line): about 53 000 lines/s, 15.7 MiB/s. This shape is the slowest the scanner sees, so size for it when your logs look like it.