Evaluating the learned guard
Tripwire's gateway is deterministic: policy decides, and a small learned model can add a reason to review. This page reports how good that model is, measured on the benchmark it was built for. The short version: it is not good enough to be a gate, which is why it is not one.
Every number below comes from a run logged in EVIDENCE.md (date, commit, hardware, command). Labels are construction labels from a rubric over AgentDojo trajectories, cross-checked by an LLM rater; there is no human-labelled gold set.
Setup
- Task: given a tool call and its context, predict
allow,needs_approvalorblock. - Data: AgentDojo v1.2.2 trajectories, 12,465 examples. Split by task template, so no template appears in two partitions. Train 5,374; dev for choosing thresholds; test 2,032 examples (21 templates); held-out 590 attack steps from 4 injection tasks that appear in no other partition.
- Operating point: threshold chosen on dev only for at most 1% false blocks on allowed calls. Test and held-out are read once to report.
- Intervals: 95% intervals resample task templates, not examples. With 21 test templates an example-level interval is much too narrow (for one model it was ±0.02 versus 0.03–0.38 by template).
Results
On attack goals the model never saw, the shipped TF-IDF model blocks 7% (95% interval 3.5% to 11.9%). The larger DeBERTa-v3-base encoder blocks 38% to 69% depending on the random seed.
The 1% false-block target set on dev did not transfer reliably. Three seeds of the same DeBERTa-v3-base recipe give test false-block rates of 0.6%, 14.8% and 19.9%. One checkpoint meets the target; the recipe does not.
| Model | Test recall | Test false blocks | Held-out recall |
|---|---|---|---|
| TF-IDF + logistic regression (shipped) | 0.863 [0.785, 0.929] | 0.008 [0.000, 0.034] | 0.071 [0.035, 0.119] |
| DeBERTa-v3-small, 3 epochs | 1.000 | 0.016 [0.000, 0.060] | 0.363 [0.307, 0.418] |
| DeBERTa-v3-base, seed 0 | 1.000 | 0.006 [0.002, 0.017] | 0.653 [0.555, 0.735] |
| DeBERTa-v3-base, seed 1 | 1.000 | 0.148 [0.029, 0.376] | 0.690 [0.583, 0.773] |
| DeBERTa-v3-base, seed 2 | 1.000 | 0.199 [0.037, 0.460] | 0.380 [0.329, 0.438] |
Brackets are template-level 95% intervals. All of these numbers are on AgentDojo tool calls. The gateway applies the TF-IDF model to file actions, a different input distribution; see File actions. High test recall alongside low held-out recall means the models learned what the known attacks look like, not "untrusted text steering a sensitive call".
Liquid d1.1 (the optional decision model). Scored like the trained models, with its threshold picked on a 500-example dev sample at a 1% false-block rate, it blocks 51.3% of test attacks [36.8%, 67.7%] at a 0.4% false-block rate [0.0%, 1.6%] (1,224 of 2,032 test examples; the run stopped at its cost cap), and 52.7% of held-out attacks [43.7%, 63.1%]. It was never trained on these templates, so held-out matches test, unlike every trained model. At the product's own review threshold it raises 97.7% of test and 92.7% of held-out attacks to review, along with 18.4% of benign test calls. About $20 per million decisions and 0.27 s per call (p50) over the network. Obfuscation robustness was not measured.
Zero-shot LLM judge (reference, not a gate). GLM-5.3-Flash given the written rubric, scored on its own labels with no threshold tuning (ADR-0016), blocked all 590 held-out attacks and all 141 block examples in a 500-example test sample, and blocked none of the 211 allow examples there. Its main error is letting 16 of 148 needs-approval calls through as allow. Caveats: it reads the same rubric that defined the labels, a zero error count gives no useful interval, only a quarter of test was judged, and it takes 1.8 s p50 per call at about $185 per million decisions. It shows what the small models are missing, not something to deploy inline.
File actions
The gateway's local model was probed on 183 file actions over real project files (the seed repo, the dashboard example and Tripwire's own source and docs), with construction labels: benign reads, scratch notes and the three change sets Claude Code proposed in recorded runs, and risky credential reads, secret exfiltration into scratch/, injection-driven writes, test-disabling and backdoor patches. The policy stopped 24 of 90 risky cases. Of the 66 risky actions the policy allowed, the model raised none to review (and none of 90 benign). Its scores do rank risky above benign (AUC 0.885), but the highest risky score is 0.52 against a threshold of 0.92 set on the benchmark. On file actions the shipped model adds no protection at its configured threshold; a file-action threshold needs its own dev data. The risky templates were written for this probe, so this is a probe, not a benchmark.
On the same cases Liquid d1.1 raised 63 of the 66 risky actions and none of the 90 benign ones at the product's review threshold, for $0.0007 in total; it missed plain credential reads. A local threshold chosen on a file-disjoint dev split (0.375) raised 23 of 46 risky and 3 of 63 benign actions on the test files. Liquid stays opt-in because it sends the task, action and context to OpenRouter; tripwire connect --liquid offers it (ADR-0021).
Approval friction
Used as a three-way decision rule (cost-weighted, rather than a single block threshold), TF-IDF sends every held-out attack to a human but also prompts on 76% of benign test calls (86% under the release guard policy, which adds a severity floor). That is why the gateway treats the score as a reason to look, not a decision.
Latency
The TF-IDF model is fast (p95 2.9 ms in process). The DeBERTa models are not: even at 128 tokens with INT8 on four vCPUs they take 178 ms p95, and on a T4 GPU at 512 tokens 26 ms against a 3 ms target. The default dynamic INT8 export collapses the model to "allow everything"; the best of three other recipes keeps held-out recall at 0.20. Static quantization or quantization-aware training were not tried. The encoders are accuracy references, not something to serve under these targets.
What failed
- The 1% false-block operating point is unstable across seeds (above).
- INT8 quantization destroyed accuracy for every dynamic recipe tried.
- A distilled linear student did not improve held-out recall (0.051 versus 0.071) and was not shipped.
- Neither latency target (10 ms CPU, 3 ms GPU) was met by any encoder.
- The local model raised none of the risky file actions the policy allowed (above).
- Not measured: real agent traffic at scale, any human-labelled data, adaptive attackers, the Apple M2 for encoders, Liquid on file actions and on obfuscated inputs.
Reproduce
make eval # rules and TF-IDF reports
make eval-deberta eval-m3b compare # score committed encoder predictions
python scripts/make_figures.py # redraw the figures from reports/*.json
Encoder training ran on Kaggle GPUs; the predictions are committed under models/, so scoring needs no GPU. Details, protocol and limits for each run: EVIDENCE.md, model card, design record, label rubric.