Try it in a minute, with no API key
Install, start the proxy, and run the leak check through it. The check plays the model provider, so it sees exactly what the proxy forwarded. It should print CLEAN.
pip install llm-shield-proxy
UPSTREAM_BASE_URL=http://127.0.0.1:8765 UPSTREAM_API_KEY=unused VALID_VIRTUAL_KEYS=sk-demo llm-shield-proxy --port 4000 &
pii-leak-benchmark selfcheck --target-base-url http://127.0.0.1:4000/v1 --target-api-key sk-demo
Using Windows PowerShell? Use these commands. Ready for real traffic? Set it up with your app.
How it works
- Your app sends a requestSame OpenAI client, pointed at the proxy.
- The provider sees placeholdersEmails, card numbers, SSNs and keys are replaced before the request leaves.
- Your app gets real values backThe streamed reply is restored as it arrives, even when a placeholder is split across events.
Four tools, each usable on its own
LLM-Shield-Proxy
A self-hosted proxy that hides personal data and secrets before a request reaches the model provider, and puts the real values back in the streamed reply.
pip install llm-shield-proxyFor anyone running an LLM gatewayLeak Benchmark
Tests whether any OpenAI-compatible gateway sends personal data to its provider, in about a minute, with no API key.
pip install pii-leak-benchmarkFor MCP server authorsmcp-ssrf-check
Checks your own MCP server for missing Host and Origin checks, forged sessions, and tools that can be made to fetch loopback.
pip install mcp-ssrf-checkFor guardrail and redactor authorschunk-invariance
A one-line test assertion that fails when a value split across two stream chunks slips through your filter.
pip install chunk-invarianceQuestions
What is LLM-Shield-Proxy?
An open-source (Apache 2.0), self-hosted proxy for OpenAI-compatible LLM APIs. It replaces the personal data and secrets it detects before a request goes to the model provider, and restores them in the reply your application receives.
Do I need an API key to try it?
No. The one-minute trial points the proxy at a local stand-in for the model provider, so nothing calls a real model and nothing costs money.
Which data does it detect?
Eleven structured types by pattern and checksum (emails, card numbers, SSNs, API keys and other identifiers), high-entropy secrets, and names when the optional local NER model is enabled. It does not promise to find every value; the limitations page says what it misses.
Can I test a gateway I already use?
Yes. pii-leak-benchmark works against any OpenAI-compatible gateway, including LiteLLM, Portkey and NeMo Guardrails, and reports per data type whether the value reached the provider.
Does it run without internet access?
Yes. Detection runs locally, and in air-gapped mode the proxy sends masked requests to an internal model gateway.