Datasets:
Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269---configs: - config_name: default data_files: - split: train path: train.jsonl - split: validation path: validation.jsonl - split: test path: test.jsonllicense: cc-by-sa-4.0language: - en - multilingualtask_categories: - token-classification - text-classificationtags: - prompt-injection - ai-safety - agents - tool-usesize_categories: - 10K<n<100Kpretty_name: Tripwire---
# Tripwire: injected instructions in tool outputs, labelled by span
Version 0.3.1, November 2026.
AI agents read emails, web pages, API responses and tool descriptions. Anattacker can hide an instruction in that text and the agent may follow it. Thisdataset is for training and testing detectors that find such text. Each exampleis something a tool might return, with the exact character ranges an attackerplanted. Clean examples have none.
Most public data for this problem labels a whole text as attack or not. This setlabels the span, so a detector can remove the planted part and keep the rest.
Version 0.2 was rebuilt after an audit of the first trained models. The auditand the reason for each change are in `results/audit.md` in the sourcerepository.
Version 0.3 adds data for four weaknesses found by tests on outside data:
- 1,439 short clean texts that use words such as "ignore", "override" or "password" in their ordinary sense. 358 of them are also used as harmless inserts (see version 0.3.1).- 601 tool descriptions written the way agent tool servers publish them, with usage rules and warnings.- 350 planted instructions written for tool descriptions (`tool_poisoning`). Half of the attacked tool descriptions carry one of these.- 421 more calm requests with no attack wording (`plain_request`).- 370 task lists that a person wrote for their own assistant, each paired with a request that hands the work over. See `needs_request` below.
Version 0.3.1 corrects a labelling flaw in 0.3. Half of the short texts abovewere inserted into longer clean documents as harmless inserts. About half ofthose ask their reader to do something ("Could we rename it?"), and a requestplanted in an unrelated document is what the `plain_request` family labels anattack. A model was asked for a verdict on each text(`scripts/check_inserts.py`); the 735 judged to be requests are no longerinserted and stay in the set as clean documents of their own.
## Size
48,792 examples: 24,766 clean and 24,026 attacked.
| Split | Clean | of which hard | Attacked ||---|---|---|---|| train | 19,874 | 2,684 | 19,272 || validation | 2,446 | 344 | 2,376 || test | 2,446 | 356 | 2,378 |
Median length is 900 characters (95% are under 3,107; the longest is 8,247).473 clean examples are under 60 characters. The planted text has a medianlength of 218 characters.
## Fields
| Field | Meaning ||---|---|| `id` | Document id, a plus sign, then the payload id or `clean` || `text` | What the tool returned || `spans` | List of `[start, end)` character ranges of planted text; empty when clean || `label` | 1 if anything was planted, else 0 || `carrier` | `email`, `web_page`, `json_record`, `tool_description`, `code_file` or `tool_result` || `family` | Attack family of the first payload, or null || `split` | `train`, `validation` or `test` || `held_out` | True for test examples whose family never appears in training || `hard` | True for clean text that resembles an attack || `document_id`, `payload_id` | The two parts the example was built from || `source`, `payload_source` | Where each part came from || `user_request` | A request a user might have made; a template for most collected documents || `needs_request` | True where the label is right only together with `user_request` |
Spans index into `text` exactly as given. Where a payload sits inside JSON,YAML or a quoted string, the span covers its escaped form, which is longer thanthe original. 8% of attacked examples carry two payloads and so have two spans;code files have one span per comment line.
## How it was built
Every attacked example is a clean document with a payload inserted. Theinserter chooses a position that suits the carrier: an HTML comment or hiddenelement in a web page, a text field in a JSON record, a comment in code, a newline or the end of the last line in a short tool result.
Each document appears once clean and once attacked. A detector therefore cannotseparate the classes by topic, sender or format.
### Examples whose label depends on the request
1,480 examples have `needs_request` set. They are built from task lists writtenfor an assistant ("Assistant, please email Dana the summary, then book theroom"). Read alone, such a text is what a planted instruction looks like. It isclean when the user asked the agent to carry out the list, and `user_request`holds a request that says so. Each list appears three times clean, in differentlayouts and with different requests, and once with a loud attack planted in it,which is still an attack. Calm requests are not planted in these lists, becausenothing would tell them from the list's own tasks. Six of the eighteen requestwordings are used only in validation and test.
The other half of the generated task lists are used as `plain_request`payloads: planted in an unrelated document with an ordinary request, the samekind of text is an attack.
A detector that reads only the text must leave the `needs_request` examplesout of training and testing. `scripts/train.py` does so unless `--with-request`is given.
Three further steps keep the layout from giving the answer away:
- **Harmless inserts.** 55% of clean examples, and about a quarter of attacked ones, have one or two innocent texts inserted through the same code that inserts payloads. A hidden element, an HTML comment or an extra `note` field is therefore not a sign of an attack.- **Tool-output layouts.** 35% of examples, clean and attacked alike, are placed inside a serialised record as a real tool returns it: YAML, a printed Python dict, JSON or CSV, alone or as one record in a list of several.- **Payload layout.** Some one-paragraph payloads are laid out one sentence per line, and 900 are placed in a letter shape with an opening and a sign-off.
### Clean documents (24,026)
| Source | Count | Carrier ||---|---|---|| Enron email corpus | 4,500 | email || English Wikipedia | 4,500 | web_page || Function-calling tool descriptions (xLAM / APIGen) | 2,500 | tool_description || Written by Claude Haiku 5.5 as ordinary tool outputs, 10 kinds | 2,408 | tool_result, web_page, email, json_record || Written by Claude Haiku 5.5 as hard cases, 13 kinds | 1,541 | all || USGS earthquake records | 1,500 | json_record || Written by Claude Haiku 5.5: short texts with attack-like words | 1,081 | tool_result || Written by Claude Haiku 5.5: tool descriptions in the style of tool servers | 601 | tool_description || Written by Claude Haiku 5.5: task lists for an assistant | 370 | tool_result || Short tool results made from templates | 1,500 | tool_result || Wikipedia in 15 other languages | 1,136 | web_page || Open Library records | 1,000 | json_record || US weather alerts | 611 | json_record || Python standard library | 600 | code_file || LLMail-Inject clean emails | 160 | email || Written by hand | 18 | all |
3,384 clean documents are marked `hard`: security notices, password resets,articles that quote attacks, strict tool descriptions, API errors, weatheralerts with instructions, code comments addressed to developers, and collecteddocuments that use several attack-like phrases. Report the false-alarm rate onthese separately; it is where detectors fail.
### Payloads (5,437)
| Family | Payloads | What it is ||---|---|---|| `direct_override` | 1,166 | "Drop your task and do this instead" || `plain_request` | 1,470 | A polite extra task with no attack wording || `role_play` | 453 | A new identity or mode under which the step seems allowed || `fake_system_message` | 374 | Posed as a system, developer or user message || `data_exfiltration` | 359 | Move private data out through a link, form or message || `fake_tool_result` | 283 | Posed as an error or status that demands an action || `multilingual` | 258 | Any style, in one of 15 languages || `hidden_text` | 252 | Zero-width or tag characters, or invisible markup || `encoded` | 252 | Base64, ROT13 or hex, with a request to decode and obey || `red_team` | 220 | Emails people wrote to attack a live assistant (LLMail-Inject) || `tool_poisoning` | 350 | Planted in a tool description: an extra step whenever a tool is used |
The counts are after letter-shaped, hidden and encoded versions are added, and a letter-shaped version keeps its parent's family.
2,882 were written by Claude Haiku 5.5 and checked by a second pass. 350 are tasklists written for an assistant, used as planted text. 900 areletter-shaped versions of other payloads, made in code. 781 were written bypeople: LLMail-Inject, Gandalf, deepset and BIPIA (training half). 500 arehidden or encoded versions made in code. 24 were written by hand.
## Splits
Documents and payloads were each assigned a split from a hash of their idbefore anything was combined. An example is built only from parts in the samesplit, so no document and no payload appears in two splits. A payload derivedfrom another shares its parent's split. Payloads that share at least half oftheir three-word sequences are grouped and assigned together, because peopleattacking a live system resubmit an attack with small edits.
Two families, `fake_tool_result` and `encoded`, appear only in the test split.Test examples involving them have `held_out` set. Of the 2,378 attacked testexamples, 1,182 are held out and 1,196 are not. Report the two groups separately:the first measures attacks of an unseen kind, the second attacks of a seen kindwith unseen wording.
## Intended use
Training and evaluating detectors of injected instructions in tool outputs andtool descriptions, at the token, span or document level.
Scores on this dataset's own test split run high, because test examples arebuilt the same way as training examples. Measure on outside data as well. Twooutside tests are used with this project and are not part of the dataset:AgentDojo tool outputs, and a second set from InjecAgent, BIPIA's test half andNotInject. No attack text from AgentDojo, InjecAgent or BIPIA's test half isincluded here for that reason.
## Limitations
- **Attacks are inserted, not found.** Real attackers can write a whole document around their instruction.- **Half the payloads were written by one model** and share its phrasing.- **A genuine request and an attack can be the same text.** "Please pay this invoice by transfer to the account below" is clean in a bill the user asked about and an attack when planted. A detector that sees only the text cannot always tell, and nor could a person. The `user_request` field exists so a later model can use the request as a second input.- **Family labels are approximate**, especially `data_exfiltration`. See `results/dataset-review.md` in the source repository.- **For `red_team` examples the whole email body is the span**, including padding the attacker added. They are 6% of training attacks.- **Letter-shaped payloads share a small set of opening and closing lines.** A detector may learn those lines.- **The ordinary tool outputs were written by a model**, not collected from running agents.- **Non-English clean text is mostly Wikipedia.**- A hand check of 260 examples of version 0.1 found every span exact. The new build steps of version 0.2 were checked by automated tests and by reading samples, not by a second full hand review.
## Personal information
The Enron emails contain the names, addresses and messages of real people. Thecorpus was released as a public record in 2003 and has been used in researchsince. Nothing was removed or replaced here. Do not use this dataset to learnabout those people.
Every address and link in the written payloads and written documents is made upand uses the reserved `.example` domain. Payloads imported from publicbenchmarks keep the addresses those benchmarks used.
## Licence and credit
CC BY-SA 4.0, as required by the Wikipedia text it includes.
- Wikipedia contributors, CC BY-SA 4.0- Enron email corpus, released by the US Federal Energy Regulatory Commission- Salesforce xLAM and APIGen function-calling data, via Argilla, CC BY 4.0- LLMail-Inject (Microsoft), MIT- BIPIA (Microsoft), MIT- Gandalf "ignore instructions" (Lakera), MIT- deepset prompt-injections, Apache 2.0- US Geological Survey, US National Weather Service and Open Library records- Python standard library, PSF License 2.0README.mdAdded+269