Skip to content

Draft · not published Technical article Pre-MVP · ADR 0028

Rerun our prompt-injection benchmark: Rust, ONNX Runtime, two CPUs

ANANZI flags text that looks like prompt injection so your app can decide what to do with it. Detection, not prevention. This article lists every benchmark number we have published for the two candidate classifiers, links each one to the file it comes from, and gives the commands that rerun it. Where a number is noisy or was superseded, it says so.

Scope notice: serving clearance is refused under ADR 0028 (#117). The faster checkpoint, Horizon, is eligible against our own bars but is not cleared for serving. Nothing here is a price, a hosted result, or a service-level promise. The classifiers are static, pretrained model versions; they do not learn from your traffic.

What was measured, and on what

  • Two FP32 checkpoints, pinned by revision: protectai/deberta-v3-base-prompt-injection-v2 at 90c9989b1a342275dd0d1a95aad283c04e075671 and Horizon-Labs/prompt-injection-guard-small at 2efc2ed5abecd21eb45c2506d231a65d6e392b85 (ADR 0028; export record and SHA-256 in ADR 0029).
  • The Rust harness is the existing benchmark_corpus example in crates/inference, using ONNX Runtime rel-1.31.0 through the ort 2.0.0-rc.15 crate. Two intra-op threads, one inter-op thread, one request in flight, batch size one, 512-token cap (ADR 0035).
  • The corpus is 109 rows: a dev split of 35 and a test split of 74 (ADR 0004, digests in the first report). It is small. One extra false positive among 36 benign test documents moves that rate by almost three points.
  • The hardware is a stand-in. A Linux container capped at --cpus=2 --memory=3g on an Apple M2 (aarch64). The Railway-sized budget it imitates runs x86_64, which we have not measured. Hosted validation is still open.

Detection quality

Counts from the capped-container report. A row is flagged when the injection logit is at least the benign logit. The earlier macOS run likely had CoreML active; the CPU-only rerun changed no flagged row (0 flips in 109).

ModelSplitFalse positives / benignDetected / injection
Protect AIdev2/239/10
Protect AItest6/4920/20
Horizondev1/2310/10
Horizontest3/4920/20

These are rates on one small corpus at one operating point, not a launch claim. Against the bars in ADR 0036, Protect AI is excluded and Horizon is eligible but not cleared. The bars are taken from the candidates themselves, so passing them proves parity with Horizon on this corpus and nothing more.

Latency: what is validated, and how noisy it is

We publish one latency figure, a target, not an SLA: for prompt_injection, warm, one request in flight, p50 at most 100 ms and p95 at most 500 ms (ADR 0039). It rests on inputs shaped like the corpus (median 32 tokens, up to 370). Latency at the full 512-token cap is unmeasured, and the figures cover tokenization and inference only, not authentication, database or network.

Why no tighter number: repeating the run twelve times on the same host showed throughput varying 2.31x (FP32) and 2.86x (INT8) between runs of one file, and p95 5.52x and 7.19x. The regression bars in ADR 0038 (Horizon FP32: p50 at most 49 ms, p95 at most 402 ms, throughput at least 9.9 req/s, peak RSS at most 1.37 GB) catch a large regression, not a 20 to 50 percent one. Peak RSS did not move (1.141 GB FP32). Full tables: 2026-11-25-bar-variance.md. The first capped run measured 18.95 req/s; the median twelve-run FP32 throughput was 21.9 req/s. Method and every committed number: evaluation methodology and results. We publish no cost or price figure.

Experimental: INT8

Experimental. A dynamic-INT8 file made locally from Horizon's FP32 graph met the ADR 0036 bars in one run and has its own bars in ADR 0038 (peak RSS 0.474 GB in the twelve-run set, quality counts 1 / 2 / 2 / 0 false positives, same recall). It is a derived file on one machine, not Horizon's upstream quantized file, and its logits differ from FP32 by up to 3.58, so thresholds would have to be set on whichever variant ships. See ADR 0037 and the comparison report. INT8 is not selected for serving.

Rerun it

You need Docker (we used OrbStack), the repository, and the two pinned ONNX files on your own disk. We do not distribute weights, ONNX files or tokenizer files. Obtain them from the upstream revisions above under their own licenses (our own copies are held under ADR 0027's limits). Lay each out as <spike-root>/<slug>/<revision>/model.onnx (see ADR 0027). There is no just recipe for the benchmark; the script is the entry point.

git clone https://github.com/ananzi-sec/den && cd den
# Quality, runtime and cost report (builds in rust:1.98.1-trixie,
# runs each model at --cpus=2 --memory=3g --memory-swap=3g):
eval/benchmarks/run-container.sh "$HOME/spike" ./out

# Ten warm passes per run, as ADR 0038 used. Repeat at least five times
# and summarize (the script refuses fewer than five runs):
ANANZI_REPEATS=10 eval/benchmarks/run-container.sh "$HOME/spike" ./out-1
python3 eval/benchmarks/summarize-runs.py --repeats 10 ./out-1 ./out-2 ./out-3 ./out-4 ./out-5

Expect different timings on your machine; compare counts first. The recall and false-positive counts were identical in all 24 runs of the twelve-run set. The image is rust:1.98.1-trixie: the Debian bookworm toolchain fails to link the prebuilt ONNX Runtime library (ADR 0035). The script details are in run-container.sh.

What these numbers do not show

  • No hosted or x86_64 result. ADR 0036 §7 requires one before serving.
  • No serving clearance. Horizon is refused under ADR 0028 pending provenance review, a passing hosted run and a larger holdout.
  • No result for text past the 512-token cap, and no p99 figure (ADR 0038 dropped it).
  • No price. Pricing is tracked separately (#212).
  • Detection, not prevention: findings are inputs to your own handling, never a guarantee that text is safe.