Skip to content

Guardrail · Benchmarks

Benchmarks ​

Two independent measurements. First, every system scored on one fixed sample of our own held-out test split, so the comparison is apples-to-apples. Second, public safety benchmarks that were never part of training at all — the harder and more honest test.

How these were produced

Both tables come from scripts in the open-source repository — scripts/benchmark_all.py and scripts/eval_public_benchmarks.py — and the page itself is generated from their JSON output, so nothing here is transcribed by hand.

Part 1 — head-to-head on held-out rows ​

  • Benchmark set: 20,000 test rows (10,993 Turkish / 9,007 English), sampled at natural prevalence from the held-out split
  • Positives: 7,441 moderation, 1,177 prompt shield
  • Thresholds: fitted per system on a separate 8,000-row calibration sample, never on test
  • Input: raw text for every system. Guardrail normalizes internally; the external ones receive exactly what a real integration would hand them.

None of the external systems share our nine categories, so the comparable axis is the two gates. A system with no signal for a gate is absent from that table rather than scored zero — a toxicity classifier is not a failed prompt shield, it is simply not one.

Moderation gate ​

Insulting, hateful, sexual, violent, self-harm or illegal-activity content.

SystemAPAUCF1PrecisionRecallFPRAP (real rows only)F1 (TR)F1 (EN)
Frontier LLM judge (zero-shot)0.9460.9760.9180.9130.9220.0532—0.9530.872
Guardrail (this library)0.8370.9000.7300.8040.6690.09650.7030.7900.645
Qwen/Qwen3Guard-Gen-0.6B0.8160.8830.7430.6630.8450.25440.7310.7370.753
textdetox/xlmr-large-toxicity-classifier0.6950.8180.6720.7070.6410.15730.6930.6780.664
unitary/multilingual-toxic-xlm-roberta0.6270.7440.5900.5980.5830.23270.7400.5260.683
s-nlp/roberta_toxicity_classifier0.5980.7120.6100.4640.8890.60750.7540.5760.686
unitary/toxic-bert0.5790.6960.5980.4530.8770.62660.7280.5690.662
unitary/unbiased-toxic-roberta0.5740.6910.5800.4710.7550.50290.7350.5360.649
citizenlab/distilbert-…-toxicity0.5520.6890.5920.4950.7350.44420.6120.5870.603
martin-ha/toxic-comment-model0.5300.6660.5990.4580.8660.60660.6730.5770.651
KoalaAI/Text-Moderation0.4880.5880.5510.4080.8480.72830.6440.5510.551

Prompt-shield gate ​

Attacks on the assistant itself: jailbreaks, prompt injection, and attempts to extract system prompts or data.

SystemAPAUCF1PrecisionRecallFPRAP (real rows only)F1 (TR)F1 (EN)
Frontier LLM judge (zero-shot)0.8870.9740.8880.8370.9460.0101—0.9390.638
Guardrail (this library)0.7970.9780.7300.6770.7930.02360.5190.7630.574
Qwen/Qwen3Guard-Gen-0.6B0.4140.8590.4510.4120.4970.04430.3700.4950.327
protectai/deberta-v3-base-prompt-injection-v20.2680.8080.2090.5700.1280.00610.3750.0610.615
deepset/deberta-v3-base-injection0.1540.7810.2260.1570.4080.13730.0440.2390.169
protectai/deberta-v3-base-prompt-injection0.1030.5460.1260.1100.1480.07500.2070.0840.253
madhurjindal/Jailbreak-Detector0.0960.6740.1580.0950.4690.27890.0740.1800.112
jackhhao/jailbreak-classifier0.0730.4420.1200.1290.1110.04690.2260.0200.207

Obfuscation robustness — prompt-shield gate ​

Recall on known-unsafe text after an attacker perturbs the surface form, at each system's own threshold.

An attack that raises recall is not robustness

Read each number against that system's unperturbed recall in the gate table above. unitary/toxic-bert recovers 0.98 under masked vowels against 0.56 on clean text — censored profanity (f*ck) is itself a strong signal in its Jigsaw training data, so the perturbation hands it a feature rather than hiding one. Guardrail strips the mask characters first and then has to recognise the word underneath, which is strictly harder and scores lower here.

Attackprotectai/deberta-v3-base-prompt-injection-v2protectai/deberta-v3-base-prompt-injectiondeepset/deberta-v3-base-injectionjackhhao/jailbreak-classifiermadhurjindal/Jailbreak-DetectorQwen/Qwen3Guard-Gen-0.6BGuardrail (this library)
leetspeak0.0810.1500.1360.0340.4510.5500.771
Cyrillic homoglyphs0.1150.1660.3140.0560.6400.5200.782
zero-width characters0.4040.2350.0010.1070.4640.4700.782
spaced letters0.2120.5270.3280.0580.6720.5250.750
masked vowels0.1090.5470.0250.1060.4950.4900.595
character repeats0.1190.2060.0620.0410.8100.5100.634
Turkish de-ASCII0.1470.2290.2850.1070.5050.5100.784
uppercase0.1050.4030.1600.1070.8790.5950.782
punctuation noise0.0890.0590.0450.0710.5000.4950.624
combined attack0.1340.2660.0090.0390.6290.5350.774
base64 wrapping1.0001.0000.0000.0040.0000.0000.935
reversed text0.4220.9240.0010.0200.0720.0150.882

Obfuscation robustness — moderation gate ​

Recall on known-unsafe text after an attacker perturbs the surface form, at each system's own threshold.

An attack that raises recall is not robustness

Read each number against that system's unperturbed recall in the gate table above. unitary/toxic-bert recovers 0.98 under masked vowels against 0.56 on clean text — censored profanity (f*ck) is itself a strong signal in its Jigsaw training data, so the perturbation hands it a feature rather than hiding one. Guardrail strips the mask characters first and then has to recognise the word underneath, which is strictly harder and scores lower here.

Attackunitary/multilingual-toxic-xlm-robertaunitary/toxic-bertunitary/unbiased-toxic-robertamartin-ha/toxic-comment-models-nlp/roberta_toxicity_classifiercitizenlab/distilbert-…-toxicitytextdetox/xlmr-large-toxicity-classifierKoalaAI/Text-ModerationQwen/Qwen3Guard-Gen-0.6BGuardrail (this library)
leetspeak0.2510.9930.4210.2250.7160.9890.8900.5190.7950.684
Cyrillic homoglyphs0.6690.9880.3850.8540.9610.9900.8580.9210.8050.694
zero-width characters0.9550.8850.8680.8730.9890.7260.9200.8650.8400.694
spaced letters0.9550.9950.9690.8010.9950.9290.7130.8750.8450.676
masked vowels1.0001.0001.0000.9991.0001.0000.9980.8890.8550.552
character repeats0.9450.9990.9110.9540.9900.9910.9630.9450.8800.591
Turkish de-ASCII0.7970.8990.9150.8230.7000.8140.7150.7710.8450.694
uppercase0.9700.8990.9840.8230.9691.0000.8300.3950.8050.694
punctuation noise0.8790.9760.8200.3200.9580.9950.8890.8000.7150.550
combined attack0.3670.9930.3720.3430.8300.9950.9600.7840.7550.688

Latency ​

Single-message latency, which is what a request path actually pays. Same machine for every system in this table; every neural model here, including the Guardrail row, ran on this machine's Apple-Silicon GPU (MPS) via the training repo's best_device(), through the PyTorch checkpoint rather than the shipped ONNX package.

The shipped Python package measures separately, CPU-only: onnxruntime 1.30 on an Apple M-series (14 cores), 1,000 texts of mean 150 characters — scan() p50 0.45 ms, 1.25 ms p50 single-threaded, 667 texts/s batched on a single thread.

Systemp50 (ms)p95 (ms)Throughput (texts/s, batched)
Guardrail (this library)1.31.63838
citizenlab/distilbert-…-toxicity4.35.5362
madhurjindal/Jailbreak-Detector5.59.5372
s-nlp/roberta_toxicity_classifier7.410.097
textdetox/xlmr-large-toxicity-classifier7.48.5122
martin-ha/toxic-comment-model10.515.8170
KoalaAI/Text-Moderation15.957.651
unitary/toxic-bert16.329.186
jackhhao/jailbreak-classifier18.429.287
unitary/unbiased-toxic-roberta18.827.683
protectai/deberta-v3-base-prompt-injection-v219.528.367
protectai/deberta-v3-base-prompt-injection21.335.171
unitary/multilingual-toxic-xlm-roberta22.234.684
deepset/deberta-v3-base-injection40.552.332
Qwen/Qwen3Guard-Gen-0.6B83.1130.312

Part 2 — public safety benchmarks ​

Our corpus already contains AdvBench, DoNotAnswer, ToxiGen, Jigsaw, RTP-LX and MultiJail, so quoting those would be quoting the training set. These are benchmarks the model has never seen — except the two marked otherwise, which are in the corpus but were reserved for test from the start by construction.

detect is the share of should-flag prompts caught; FP is the share of must-not-flag prompts wrongly flagged. Both use each system's own calibrated thresholds — no per-benchmark tuning.

XSTest ​

XSTest (Röttger et al., 2024) — exaggerated-safety test suite
450 prompts · 200 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)12.5%4.4%0.5630.617

HarmBench ​

HarmBench (Mazeika et al., 2024) — harmful behaviours, all textual
400 prompts · 400 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)21.5%———

StrongREJECT ​

StrongREJECT (Souly et al., 2024) — forbidden prompts
313 prompts · 313 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)26.5%———

JailbreakBench ​

JailbreakBench JBB-Behaviors (Chao et al., 2024) — 100 harmful + 100 matched benign
200 prompts · 100 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)30.0%11.0%0.6790.707

deepset prompt-injections ​

deepset/prompt-injections — EN+DE injections with benign controls (label includes scope violations, not only instruction overrides; never trained on, but its failure analysis motivated later training data)
546 prompts · 203 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)9.9%0.3%0.7160.760

OR-Bench-Hard-1K ​

OR-Bench-Hard-1K (Cui et al., 2024) — benign prompts that look harmful
1,319 prompts · 0 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)—8.6%——

HateCheck ​

HateCheck (Röttger et al., 2021) — functional tests; test-only in this corpus
3,728 prompts · 2,563 should-flag · in corpus, test-only split

SystemdetectFPAPAUC
Guardrail (this library)57.4%39.5%0.7660.616

Turkish over-refusal twins ​

Turkish over-refusal twins (Yurtsevenler) — matched safe/harmful pairs, test-only in this corpus
240 prompts · 120 should-flag · in corpus, test-only split

SystemdetectFPAPAUC
Guardrail (this library)49.2%5.0%0.8120.849

tr_advbench ​

Turkish AdvBench translation (MultiJail-style 'cogoverload' data) -- machine-translated AdvBench harmful-behavior goals; never used in training, eval-only
520 prompts · 520 should-flag · never used in training

SystemdetectFPAPAUC
Guardrail (this library)23.1%———

Every number regenerates with bash scripts/run_all.sh in the repository. If a number here looks wrong, the harness that produced it is open — check it.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub