Skip to main content

Migrating from Microsoft Presidio

Microsoft Presidio is an in-process SDK for detecting PII. It is not an LLM gateway. Using Presidio on a streaming LLM path requires building custom integration code to handle SSE chunking, state management, and policy enforcement.

LLM-Shield-Proxy is a standalone reverse proxy. It centralizes PII redaction and provides built-in support for streaming LLM traffic (SSE).

Comparison

FeatureMicrosoft PresidioLLM-Shield-Proxy
ArchitectureIn-process Python SDKStandalone reverse proxy / sidecar
Streaming (SSE)Requires custom application logicNative sliding-window SSE rehydration
Secret DetectionRequires writing custom recognizersBuilt-in Shannon entropy scanner for unformatted keys
AuditingNone built-inHash-chained, Ed25519-signed audit logs

Step 1: Client Reconfiguration

To test LLM-Shield-Proxy, simply point your LLM client at the proxy instead of the upstream provider.

# Before (Direct to provider, relying on inline Presidio)
client = OpenAI(api_key="sk-...", base_url="https://api.openai.com/v1")

# After (Routing through LLM-Shield-Proxy)
client = OpenAI(api_key="sk-...", base_url="http://localhost:8000")

Step 2: Entity Mapping

If your compliance policies depend on specific Presidio entity types, use this table to map them to LLM-Shield-Proxy entities.

Presidio EntityLLM-Shield-Proxy EntityDetection Engine
PERSONPERSONTier 3 (requires an ONNX model; no fallback detector)
EMAIL_ADDRESSEMAILTier 1 (google-re2 Regex)
PHONE_NUMBERPHONETier 1 (google-re2 Regex)
US_SSNSSNTier 1 (google-re2 Regex)
CREDIT_CARDCREDIT_CARDTier 1 (google-re2 Regex)
IP_ADDRESSIP_ADDRESSTier 1 (google-re2 Regex)
MEDICAL_LICENSEMRNTier 1 (google-re2 Regex)
CRYPTOAWS_API_KEY, GITHUB_PAT, JWT_TOKENTier 1 (google-re2 Regex)
Custom (high-entropy)SECRET_KEYTier 2 (Shannon Entropy)

Note: Tier 1 (Regex) and Tier 2 (Entropy) are enabled by default. Tier 3 (NER) is opt-in and requires the [ner] extra installation.