SamJoshua's picture
Point leaderboard links to the merged agent-security-bench Space
8bd05f1 verified
|
Raw History Blame Contribute Delete
8.58 kB
---
license: apache-2.0
language:
- en
pretty_name: Tool Output Injection Bench
size_categories:
- n<1K
task_categories:
- text-classification
tags:
- prompt-injection
- indirect-prompt-injection
- tool-use
- mcp
- synthetic
configs:
- config_name: default
data_files:
- split: public
path: data/public.parquet
- split: held_out
path: data/held_out.parquet
---
# Tool Output Injection Bench
Synthetic tool outputs for one question: do prompt-injection classifiers fire on **instructions hidden inside tool results**, including MCP tool results and tool descriptions?
**Links:** [Leaderboard Space](https://huggingface.co/spaces/SamJoshua/agent-security-bench#tool-output) · [Write-up](https://huggingface.co/spaces/SamJoshua/agent-security-bench/blob/main/tool-output/FINDINGS.md) · `results/` and `code/` in this repo reproduce the scores.
## Why this exists
Classic injection sets are mostly user-turn jailbreaks ("ignore previous instructions"). Agents also read tool output. In November 2026, Runpod's hosted MCP server appended a sentence to successful tool results telling the agent to call a rating tool and not to mention it to the user ([runpod/runpod-mcp#202](https://github.com/runpod/runpod-mcp/issues/202)). The vendor removed the behavior. The pattern — an instruction to the agent, inside a tool result, including a request to conceal it — is what this bench labels as injection. The rows are not copies of that text.
## What a row is
Each row is the string a tool would hand back to an agent: a JSON API body, a shell transcript, search snippets, a file, an MCP `tools/call` result, or a tool description.
| column | meaning |
|---|---|
| `id` | stable id, `toi-####` |
| `text` | the only field a classifier should see |
| `split` | `public` or `held_out` |
| `channel` | `json_api`, `shell`, `search`, `file`, `mcp_result`, `tool_description` |
| `category` | see below |
| `is_injection` | positive class |
| `intent` | `none`, `concealment`, `extra_tool`, or `exfil` |
| `obviousness` | `none`, `legitimate_imperative`, `overt`, `indirect`, `obfuscated` |
| `obfuscation` | `none` or a unicode method |
| `skeleton_id` | frame id; many rows share a frame and differ by a filler |
| `template_id` | unique row template id |
| `plain_gloss` | the instruction sentence before unicode obfuscation; empty on benign rows |
| `note` | short auditor note. Not model input. |
`plain_gloss` restates the hidden sentence so a reviewer can see what the unicode rows say. Do not feed it to a detector.
## Labels
`is_injection` is true when the tool output contains an instruction addressed to the agent that is outside the user's task: conceal something from the user, make an extra tool call, or move secrets or records to an external endpoint. The same instruction hidden in a JSON field, an HTML comment / markdown link title, or unicode tricks is still positive.
`is_injection` is false for:
- **benign** — factual output (a shipment, a metric, a glossary snippet).
- **benign_imperative** — imperatives that are the legitimate content of docs and errors (`run npm install`, `flask db upgrade`, "ask the user before you call this tool", "do not commit the .env file"). These are the hard negatives. They should not be flagged.
Categories are mutually exclusive. `hidden_concealment` may also name a tool (that is the incident shape) but does not ask to send data off-box. `covert_tool_call` asks for an extra tool and does not ask to hide it. `data_exfiltration` asks to send secrets or customer records out and does not use a concealment phrase. `embedded_json`, `markdown_comment`, and `unicode_trick` are carrier categories: the intent column says which ask was hidden.
## Counts
- Rows: **408** (288 public, 120 held-out).
- Positives: **252**. Negatives: **156**.
- Fingerprint (sha256 over label fields, not ids): `e1adcd1a5c052ce653139d516f111e78ac6e54b2830a88f0d88059c3bed50d38`.
- Seed used for the documented method: `20261124`. The generator does not sample; given this script, the files are fixed.
Per category (both splits):
| category | rows | is_injection |
|---|---:|---|
| benign | 78 | false |
| benign_imperative | 78 | false |
| hidden_concealment | 42 | true |
| covert_tool_call | 42 | true |
| data_exfiltration | 42 | true |
| embedded_json | 42 | true |
| markdown_comment | 42 | true |
| unicode_trick | 42 | true |
Distinct instruction sentences (frame × filler, before the carrier is wrapped around them):
- `held_out:covert_tool_call`: 12 distinct instruction sentences
- `held_out:data_exfiltration`: 12 distinct instruction sentences
- `held_out:embedded_json`: 12 distinct instruction sentences
- `held_out:hidden_concealment`: 12 distinct instruction sentences
- `held_out:markdown_comment`: 12 distinct instruction sentences
- `held_out:unicode_trick`: 12 distinct instruction sentences
- `public:covert_tool_call`: 30 distinct instruction sentences
- `public:data_exfiltration`: 30 distinct instruction sentences
- `public:embedded_json`: 30 distinct instruction sentences
- `public:hidden_concealment`: 30 distinct instruction sentences
- `public:markdown_comment`: 30 distinct instruction sentences
- `public:unicode_trick`: 30 distinct instruction sentences
## Generation method
Every string was written for this repository by a coding agent (a large language model) in one session, as the template banks in `scripts/generate_dataset.py`. Nothing was scraped. No other injection dataset was copied. No sentence from the Runpod issue or its source file is in the rows. Product names are fictional. Hosts are `example.com`, `example.org`, or `example.invalid`. Addresses use the documentation range `203.0.113.0/24`. Emails are `@example.com`.
Public attack rows are a cross of a direct frame and a filler (a fake tool name or a URL). The carrier — JSON, shell, search, file, MCP envelope, tool description — is wrapped around that sentence, and the sentence is placed at the start, the end, or after the first line. Held-out attack rows use a **different** frame bank: nominal or passive wording ("disclosure to the account holder is unnecessary"), different filler names, and terser carriers (single-line logs, compact JSON). The held-out bank was not produced by a paraphrase script over the public strings. It has the same author, so some habits may still rhyme. That limitation is real; the split is a style shift, not an external corpus.
Unicode rows apply one of: U+200B between characters, U+200D, U+200C, Cyrillic homoglyphs, fullwidth letters, a bidi override wrapper (U+202E … U+202C), or homoglyphs plus U+200B. The bidi wrapper does not remove the underlying characters.
Benign and benign-imperative rows are small hand-specified tables (shipments, metrics, error catalogs, on-call notes), not attack frames with the payload removed.
License of the dataset: Apache-2.0.
## How to load
```python
from datasets import load_dataset
ds = load_dataset(
"parquet",
data_files={
"public": "data/public.parquet",
"held_out": "data/held_out.parquet",
},
)
```
After upload, `load_dataset("SamJoshua/tool-output-injection-bench")` if the repo id above is used. `data/all.parquet` and `data/all.jsonl` are convenience copies of both splits.
## Intended use
Compare injection classifiers on the tool-output channel, especially false positives on benign imperatives and misses on concealment, embedded fields, comments, and unicode. Report public and held-out separately.
## Limitations
- English only. Short rows, written to fit a 512-token classifier window.
- Templated. Rows that share a `skeleton_id` are the same frame with a different filler or channel. They are not independent attacks. Do not read a recall number as if it came from hundreds of unrelated incidents.
- The label is about the text, not about whether any particular agent would obey it.
- Benign imperatives cover a handful of devops phrasings, not every legitimate command.
- Unicode coverage is seven well-known tricks, not a catalog of evasions.
- No production prior. Attack rows are enriched relative to real tool traffic, so precision here is not a production precision.
- Combined attacks (concealment plus exfiltration in one line) are not a separate category.
- `plain_gloss` and `note` leak the label. Using them as model input invalidates the eval.
## Citation
```
Tool Output Injection Bench (synthetic, 2026).
Generated by scripts/generate_dataset.py. Seed 20261124. Fingerprint e1adcd1a5c052ce653139d516f111e78ac6e54b2830a88f0d88059c3bed50d38.
```