Deepset
Binary prompt-injection classifier.
Encoder sequence classifier that labels a text as LEGIT or INJECTION. Feed it the raw user prompt (or any untrusted text such as retrieved snippets); no model response or extra context is involved. validate accepts a single string or a list[str], in which case the whole list runs as one true batched inference call and a list of outputs is returned in the same order.
Verdict mapping onto GuardrailOutput:
validisTruewhen the predicted label is notINJECTION.scoreis the probability of theINJECTIONclass (canonical risk direction: higher = riskier), regardless of which label won the argmax.categoriesholds the full label distribution — one entry per class with its probability; the predicted class is markedtriggered=True.
For more information, see:
Supported Models
deepset/deberta-v3-base-injection
Constructor
model_id
`str
None`
No
provider
Optional[Provider[dict[str, Any], dict[str, Any]]]
No
None
Initialize the Deepset guardrail.
validate
Default validation pipeline: preprocess -> inference -> postprocess.
Parameters
input_text
`str
list[str]`
Yes
—
Returns: GuardrailOutput | list[GuardrailOutput]
Benchmarks
Prompt Injection
deepset_pi (unspecified)
f1
native-valid
0.991597
guardrail-bench+ag0.7.4
measured:guardrail-bench+ag0.7.4
⚠️
notinject (unspecified)
fpr
native-valid
0.705263
guardrail-bench+ag0.7.4
measured:guardrail-bench+ag0.7.4
gandalf (unspecified)
recall
native-valid
0.883929
guardrail-bench+ag0.7.4
measured:guardrail-bench+ag0.7.4
bipia_email (unspecified)
f1
native-valid
0.7806
bir@fd86c16
measured:bir@fd86c16
bipia_table (unspecified)
f1
native-valid
0.876783
bir@fd86c16
measured:bir@fd86c16
License
Vendor: deepset
Default license:
mit(of the default model/service)
Last updated