prompt-injection detection · text · WASM · ~739 MB
The built text classifiers judge sentiment or toxicity. This one judges intent against an LLM: is a prompt a normal request, or an attempt to hijack the model — "ignore your instructions", jailbreaks, system-prompt extraction, role-play escapes? It's the input filter you put in front of an LLM app to catch adversarial prompts before they reach the model. Type a prompt or try an example. Runs entirely on your device.
| Model | deberta-v3-base-prompt-injection-v2 — a deberta-v3 classifier |
|---|---|
| Task / pipeline | text-classification — SAFE vs INJECTION — via transformers.js |
| Input | a user prompt (the text you'd send to an LLM) |
| Output | a probability for SAFE vs INJECTION (softmax over the two classes) |
| Quantization | fp32 ONNX — runs on the plain WASM backend, no WebGPU needed |
| Download | ~739 MB, cached after first load (auto-inits on return) |
| License | Apache-2.0 (ProtectAI) |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
Injection detection is a filter: it flags prompts that try to override an application's instructions, so you can block or review them before they reach your LLM. It's a classifier, so it can miss novel attacks or occasionally over-flag an unusual-but-benign prompt — the confidence score shows how sure it is. Running it locally means user prompts never leave the device to be screened.
Compare benign vs adversarial presets with live SAFE/INJECTION probability bars, a confidence gauge, and a block-threshold slider.
Scan untrusted user input plus retrieved RAG chunks independently off-main-thread, quarantine poisoned chunks, and build a sanitized payload.
Try to smuggle a covert instruction past the local DeBERTa guard across three difficulty tiers with perturbation diffs and trigger-word ablation.
Chain DeBERTa-v3 prompt-injection screening with BERT NER PII redaction for a combined Cleared/Quarantined verdict and per-stage timings.