Skip to main content
Open source · Apache 2.0 · Self-hosted

Keep personal data out of your LLM requests

LLM-Shield-Proxy hides emails, card numbers, IDs and secrets before a request reaches the model provider, and puts the real values back in the streamed reply.

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

  1. Your app sends a requestSame OpenAI client, pointed at the proxy.
  2. The provider sees placeholdersEmails, card numbers, SSNs and keys are replaced before the request leaves.
  3. Your app gets real values backThe streamed reply is restored as it arrives, even when a placeholder is split across events.

Architecture · What it does not do · Published test results

Questions

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.