PromptShield
PromptShield: Protecting User Privacy in AI Chatbots
Drop-in applicable privacy proxy for LLM deployments (Asimine et al., Technical University of Denmark, Software, 2026). Intermediary application layer that sits between the user and the LLM: a 4-stage local pipeline — normalization → regex redaction → XLM-RoBERTa NER (entity spans: names, addresses, emails, credentials, medical info) → post-processing (privacy category mapping + topic classification) — produces a sanitized version; a template-based reformulation engine then rebuilds a grammatically coherent query preserving the original intent without PII. A HITL checkpoint lets users review original / sanitized / reformulated versions at entity level before any text crosses the API boundary. The NER → sanitization → template reformulation → HITL proxy pattern is directly applicable to any enterprise LLM gateway handling sensitive data (GDPR, HIPAA, CCPA compliance).
Qué muestra la demo
Gradio demo showing the full PromptShield pipeline: user enters a prompt with PII → regex + heuristic NER detection → entity-level checkboxes to keep/remove each detected entity → side-by-side view of original / sanitized / reformulated versions → simulated LLM call with only the approved payload.
Fuente: JournalClub.io newsletter · 2026-07-22
Prompt de integración
Pégalo en Claude Code, Cursor o tu agente de código, completa la sección "My project" y evaluará si la técnica encaja en tu caso y la integrará con una medición antes/después. Está en inglés porque es lo que mejor entienden los agentes de código.
I want to evaluate and, if it fits, integrate a technique from recent AI research into my project.
## Technique: PromptShield
PromptShield: Protecting User Privacy in AI Chatbots
Drop-in applicable privacy proxy for LLM deployments (Asimine et al., Technical University of Denmark, Software, 2026). Intermediary application layer that sits between the user and the LLM: a 4-stage local pipeline — normalization → regex redaction → XLM-RoBERTa NER (entity spans: names, addresses, emails, credentials, medical info) → post-processing (privacy category mapping + topic classification) — produces a sanitized version; a template-based reformulation engine then rebuilds a grammatically coherent query preserving the original intent without PII. A HITL checkpoint lets users review original / sanitized / reformulated versions at entity level before any text crosses the API boundary. The NER → sanitization → template reformulation → HITL proxy pattern is directly applicable to any enterprise LLM gateway handling sensitive data (GDPR, HIPAA, CCPA compliance).
What the reference demo shows: Gradio demo showing the full PromptShield pipeline: user enters a prompt with PII → regex + heuristic NER detection → entity-level checkboxes to keep/remove each detected entity → side-by-side view of original / sanitized / reformulated versions → simulated LLM call with only the approved payload.
## Reference implementation (Vector Ridge Labs, POC-017)
- Live demo: https://osoman2-gradio-pocs.hf.space/?poc=POC-017
- Source code: https://huggingface.co/spaces/osoman2/Gradio_pocs/tree/main/promptshield
Original source: JournalClub.io newsletter · 2026-07-22
## My project
<Describe your stack, the problem you want to solve and where this technique would sit. Example: "Python FastAPI RAG service over 50k PDFs, Postgres + pgvector, OpenAI embeddings, p95 latency budget 800 ms.">
## What I need from you
1. Read the reference source code and explain in at most 5 bullets how the technique works and what it would change compared to my current approach.
2. Decide whether it fits my case. If it does not, say why and stop there.
3. Propose the smallest viable integration: files or modules to touch, new dependencies, configuration.
4. Implement it behind a flag or as a separate function so it can be compared side by side with what I have today.
5. Add an evaluation script that measures attack success rate on a small red-team set and the false-positive rate on normal traffic, before and after, on my own data.
6. List the risks (latency, cost, failure modes) and what to monitor once it is in production.
Constraints: keep my existing stack and conventions, avoid heavy dependencies unless the gain is clear, and reference the file in the demo source whenever you reuse its logic.¿Lo quieres en tu stack?
Puedes integrarlo por tu cuenta con el prompt de arriba, o lo hacemos contigo: mapeamos qué técnica encaja en tu sistema, la implementamos y medimos el impacto sobre tus datos.
Conversemos la integración