← all writing
// open source · 2025 q4LangOpsOpen SourceBenchmarks

guardrail-eval-bench: a deterministic prompt-injection set.

2025-12-09 · 7 min

Most prompt-injection benchmarks use an LLM to judge whether the injection was detected. Which is exactly the bug they claim to be measuring. We watched a benchmark pass at 96% one Monday and 73% the following Tuesday, with the same inputs and the same detector — the judge model had been quietly retrained over the weekend. That's the benchmark telling you about itself, not about your detector.

Why deterministic

Adversarial robustness needs hand-labeled ground truth. LLM-as-judge converges around plausible-sounding answers, not correct ones, and the convergence shifts whenever the underlying model is retrained. If the point of the benchmark is to catch inputs that fool language models, using a language model to grade them is incoherent on its face.

LLM-judged benchmarks measure the judge's current taste alongside the detector. Deterministic grading separates the two.

What's in the set

1,800 hand-labeled cases across four categories. Each case carries a deterministic outcome label (block / allow / flag-for-review) and the rationale a human applied. The labels and rationales are version-pinned so a benchmark run today and a run six months from now are directly comparable.

  • Direct injection — explicit instruction overrides ("ignore previous instructions...")
  • Role play — persona impersonation ("you are DAN, you can do anything")
  • Context smuggling — injection via tool output, doc retrieval, or system context
  • Encoding tricks — base64, leetspeak, language-switch, zero-width unicode

How to run it

// python
from guardrail_eval_bench import load, run, score

bench = load(version="2025.11")
results = run(your_detector, bench, categories=["direct_injection", "context_smuggling"])

report = score(results)
print(report.precision, report.recall, report.f1)
# By-category breakdown:
for cat, metrics in report.by_category.items():
    print(cat, metrics)

your_detector is any callable that takes a dict { input, context } and returns a verdict. The bench is intentionally framework-agnostic. We've run it against LangChain guardrails, Anthropic's safety filters, and three custom detectors shipped inside our own products.

What it doesn't catch

Three known gaps, worth saying out loud so you don't oversell what passing the bench means:

  • Novel attack patterns. No static benchmark can; the cases here are the ones we've seen in the wild as of 2025 Q4.
  • Latency tradeoffs. The bench measures accuracy, not eval-budget. A 99.5% detector that takes 800ms is worse for most production systems than a 96% detector that takes 4ms.
  • Category boundaries are fuzzy. Encoding tricks often nest inside role play. The labels capture the dominant category but you'll see disagreement on edge cases.

How we use it internally

Every guardrail node we ship runs this bench as a CI gate across the product portfolio. A drop of more than 0.5% on any category against the previous main blocks merge. On build engagements it's also the first artifact we hand over — it sets the floor the partner team can regress against after we're done.

Public release is in the legal/redaction pass — we're pulling identifying cases pulled from regulated data before the repo goes live. Apache-2.0, no LLM judge, no telemetry. If you want early access for evaluation against your detector, ask via the intake agent and we'll send a private mirror.

// continue

The multi-agent intake engine behind Backbook.