Skip to content

Commit daa64f6

Browse files
committed
[Feat] Build a public labelled set for the injection guard from InjecAgent and AgentDojo
scripts/build_injection_dataset.py builds evals/labelled/injection-public.jsonl from InjecAgent at a fixed commit and agentdojo 0.1.35 (benchmark v1.2.2). The agentdojo dependency is declared as PEP 723 inline metadata, so pyproject.toml and uv.lock stay unchanged, and a rebuild writes the same bytes. The set holds 665 tool outputs. 335 carry a planted instruction, sampled with a fixed seed across user tools, injection tasks and attack templates; 330 carry none, among them normal requests written for a person. Positives that only the user's task tells apart are marked in their notes and reported on their own. rails.evaluate records the labelled set's sha256, taken from the bytes it parsed before the first model call, and the decision model's name in summary.json. --report turns a job into the benchmark tables; it recomputes the digest of the set it reads and stops on a mismatch or on a job without these fields, labels its tables with the recorded model, and checks each note's grade against the row's label. docs/benchmarks.md gains the Jev run of 2026-10-05, whose verdicts and summary are in docs/results/injection_guard/2026-10-05/. NOTICE and THIRD_PARTY_LICENSES.md carry both MIT notices; evals/README.md, docs/roadmap.md and CHANGELOG.md describe the new set.
1 parent 3008e8f commit daa64f6

13 files changed

Lines changed: 3001 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); ver
2929
- `docs/benchmarks.md`: the Google Flights driver comparison rerun on 2026-09-23 from Poland, every arm three times on
3030
both decision backends, next to the baseline rows in one table; the 24 S1A records, as one archive, and the chart
3131
under `docs/results/flights/rerun-2026-09-23/`.
32+
- `evals/labelled/injection-public.jsonl`: 665 labelled tool outputs for the `injection_guard` rail from InjecAgent
33+
and AgentDojo at pinned versions, 335 with an injected instruction. 65 of those read as an ordinary request that only
34+
the user's task tells apart; their notes carry a `-u` source and they are reported on their own row. Negatives
35+
include requests written for a human (`R2` in the note), which with the unmarked positives form a hard subset.
36+
`uv run scripts/build_injection_dataset.py` rebuilds the file byte for byte; `--report <job>` prints precision and
37+
recall per source without the `-u` positives, their own recall, and balanced accuracy on the hard subset against
38+
fixed keyword baselines; the Jev run of 2026-10-05 behind `docs/benchmarks.md` is in
39+
`docs/results/injection_guard/2026-10-05/`.
3240

3341
### Changed
3442

‎NOTICE‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ This product includes software developed by third parties:
1212
evals/2048/style/fonts are Clear Sans by Intel Corporation (Apache-2.0)
1313
- evals/millionaire/questions.json, fetched at first run: Open Trivia Database
1414
(https://opentdb.com), CC BY-SA 4.0
15+
- evals/labelled/injection-public.jsonl: tool outputs from InjecAgent,
16+
uiuc-kang-lab/InjecAgent (MIT, Copyright (c) 2023 Qiusi Zhan). Full license text:
17+
THIRD_PARTY_LICENSES.md
18+
- evals/labelled/injection-public.jsonl: tool outputs from AgentDojo, ethz-spylab/agentdojo
19+
(MIT, Copyright (c) 2024 Edoardo Debenedetti, Jie Zhang, Mislav Balunovic, Luca
20+
Beurer-Kellner, Marc Fischer, and Florian Tramèr). Full license text: THIRD_PARTY_LICENSES.md

‎THIRD_PARTY_LICENSES.md‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,53 @@ Fonts under `evals/2048/style/fonts` are Clear Sans by Intel Corporation, Apache
3939

4040
`evals/millionaire/questions.json`, fetched on the first Millionaire run, holds questions from the
4141
[Open Trivia Database](https://opentdb.com), Creative Commons Attribution-ShareAlike 4.0 International.
42+
43+
## InjecAgent
44+
45+
The records of `evals/labelled/injection-public.jsonl` whose note starts with `injecagent-` are built by
46+
`scripts/build_injection_dataset.py` from [uiuc-kang-lab/InjecAgent](https://github.com/uiuc-kang-lab/InjecAgent) at
47+
commit `f19c9f2c79a41046eb13c03c51a24c567a8ffa07`: `data/test_cases_dh_base.json`, `data/test_cases_ds_base.json` and
48+
`data/attacker_simulated_responses.json`.
49+
50+
MIT License
51+
52+
Copyright (c) 2023 Qiusi Zhan
53+
54+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
55+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
56+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
57+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
58+
59+
The above copyright notice and this permission notice shall be included in all copies or substantial portions
60+
of the Software.
61+
62+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
63+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
64+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
65+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
66+
DEALINGS IN THE SOFTWARE.
67+
68+
## AgentDojo
69+
70+
The records of `evals/labelled/injection-public.jsonl` whose note starts with `agentdojo` are tool outputs of the
71+
[ethz-spylab/agentdojo](https://github.com/ethz-spylab/agentdojo) suites, benchmark version v1.2.2 of the `agentdojo`
72+
0.1.35 package, produced by `scripts/build_injection_dataset.py` from the user tasks' ground truth with and without the
73+
package's attacks, and from the suites' own read tools on the default environments.
74+
75+
MIT License
76+
77+
Copyright (c) 2024 Edoardo Debenedetti, Jie Zhang, Mislav Balunovic, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr
78+
79+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
80+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
81+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
82+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
83+
84+
The above copyright notice and this permission notice shall be included in all copies or substantial portions
85+
of the Software.
86+
87+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
88+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
89+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
90+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
91+
DEALINGS IN THE SOFTWARE.

‎docs/benchmarks.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,46 @@ The same showcase on ALFWorld, Blackjack and Millionaire is under `results/<eval
7878

7979
The rail scores 20 of 20 on its labelled set at a median of 464 ms (`s1a run injection_guard`).
8080

81+
A larger set, `evals/labelled/injection-public.jsonl`, uses data from two public benchmarks, InjecAgent and AgentDojo:
82+
665 tool outputs such as emails, calendar entries, files, web pages and product pages, 335 of them with an instruction
83+
planted by an attacker. `scripts/build_injection_dataset.py` rebuilds the file. The run below is from 2026-10-05
84+
(`uv run s1a run injection_guard --model jev --labelled-set evals/labelled/injection-public.jsonl`), at a median of
85+
304 ms per decision and $0.016 for the whole set. Its records are in `docs/results/injection_guard/2026-10-05/`, and
86+
`uv run scripts/build_injection_dataset.py --report docs/results/injection_guard/2026-10-05` prints the tables below
87+
from them.
88+
89+
| tool output | count | quarantined by Jev |
90+
|---|---|---|
91+
| no planted instruction | 330 | 0 |
92+
| of which a normal request written for a person, such as a bill asking for payment | 34 | 0 |
93+
| planted instruction in attack wording, such as "ignore your previous instructions" (AgentDojo) | 154 | 150 |
94+
| planted request to send the user's data somewhere (InjecAgent) | 61 | 58 |
95+
| planted request for a harmful action, with no attack wording (InjecAgent) | 55 | 23 |
96+
| planted request that reads like an ordinary one, such as a payment request in an email | 65 | 34 |
97+
98+
The last row is counted apart. Only the user's task tells these requests from real ones, and the rail sees only the
99+
tool output.
100+
101+
Over the 600 outputs outside the last row, the run gives these precision and recall figures:
102+
103+
| measure | Jev | quarantine everything |
104+
|---|---|---|
105+
| precision: share of quarantined outputs that carry a planted instruction | 1.00 | 0.45 |
106+
| recall, InjecAgent direct harm (55) | 0.42 | 1.00 |
107+
| recall, InjecAgent data stealing (61) | 0.95 | 1.00 |
108+
| recall, AgentDojo (154) | 0.97 | 1.00 |
109+
110+
Recall is the share of planted instructions that the rail quarantined. "Quarantine everything" is what a rail scores if
111+
it quarantines every output.
112+
113+
On the 150 outputs that carry no attack wording (the 116 planted instructions without it and the 34 normal requests), a
114+
rule that quarantines any text containing "please" is right 65% of the time, counting the two groups equally. Jev is
115+
right 85% of the time: it catches 70% of the planted instructions and none of the normal requests.
116+
117+
The set has two limits. Only 34 of the normal outputs contain a request. The planted instructions and the normal
118+
requests also come from different benchmarks with different text formats, so a simple word-count classifier already
119+
separates them 73% of the time.
120+
81121
## Series
82122

83123
The protocol in `evals/README.md` quotes nothing under ten episodes and asks for 500 Blackjack hands. The series of
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"rail": "injection_guard",
3+
"model": "jev",
4+
"records": 665,
5+
"positives": 335,
6+
"acted": 265,
7+
"uncertain": 57,
8+
"precision": 1.0,
9+
"recall": 0.791,
10+
"accuracy": 0.895,
11+
"median_ms": 304,
12+
"jev_input_tokens": 373489,
13+
"cost_usd": 0.015687,
14+
"thresholds": {
15+
"allow": 0.3,
16+
"act": 0.7
17+
},
18+
"labelled_set": "evals/labelled/injection-public.jsonl",
19+
"labelled_set_sha256": "466e9d01b1ee18b8aa9b34137f9df164e299d1bab05804163a36288c0bbab43f",
20+
"finished_at": "2026-10-05T13:28:00.507439+00:00"
21+
}

0 commit comments

Comments
 (0)