← All models · Prompt-injection detection

use case · multi-model · 2 WASM models · ~849 MB total

Multi-model: Two-Stage Privacy & Safety Gate

Before sending user text to an upstream LLM, production apps need both safety and privacy checks. This pipeline runs two independent models locally in separate Web Workers: Stage 1 (DeBERTa-v3 Guard) screens for prompt injection, and Stage 2 (BERT NER) detects and redacts people, organizations, and locations — producing a combined Cleared / Quarantined verdict plus a PII-redacted payload (for outbound forwarding or safe security audit logging).

Two on-device models (both stages run for real)

Stage 1: protectai/deberta-v3-base-prompt-injection-v2 (~739 MB fp32, WASM). Stage 2: Xenova/bert-base-NER (~110 MB q8, WASM). Cached models auto-initialise.

1. Prompt to inspect

Try a preset combining safety + PII states:

50%
Stage 2 redact:
Waiting for both models…

2. Combined gate verdict & per-stage telemetry

WAITING Load both models to run the two-stage pipeline.
stage 1 (DeBERTa) – stage 2 (BERT NER) – total latency – entities redacted 0
Stage 1 · Prompt Injection Guard –
INJECTION –
SAFE –

protectai/deberta-v3-base-prompt-injection-v2

Stage 2 · BERT NER PII Scanner –
Entity highlights will appear here.

Xenova/bert-base-NER (q8)

3. Gate output (PII-redacted text)

Cleared prompts can be forwarded safely with entities masked; quarantined prompts are blocked from the LLM while still redacted for privacy-safe security logging.

Waiting for pipeline run…

← Wild · Back to Prompt-injection detection