← All models · Prompt-injection detection

use case · basics · WASM · ~739 MB

Basics: Prompt Injection Scanner

Every prompt-injection classifier returns two softmax probabilities: SAFE and INJECTION. Pick a preset or write your own prompt to inspect the exact probability split, watch the confidence gauge move in real time, and tune the block threshold to see how a real guardrail trades false positives against missed attacks.

On-device model

Scan a prompt

Preset prompts (benign vs attack):

50% P(INJECTION)
Waiting for model…
WAITING Load the model to scan
INJECTION –
SAFE –
backend – latency – argmax – cutoff 50%

Injection risk gauge

– P(INJECTION) 0% 100%

The dark tick marks your active block threshold on the arc.

How threshold calibration works

protectai/deberta-v3-base-prompt-injection-v2 outputs a two-class softmax over SAFE and INJECTION. Lowering the threshold (for example to 25%) catches subtler indirect attacks at the cost of flagging more unusual benign prompts; raising it (for example to 80%) reduces false alarms on legitimate users while letting borderline attacks through. Moving the slider re-evaluates the real model score immediately without re-running inference.

← Model overview · Next: Practical: AI Firewall →