Guides · ← All guides · Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team · 7 min read
Prompt-Injection Cases in Eval Datasets: Testing the Attack Without Arming It
Your test set is supposed to attack your agent. The boundary's job is to make sure a successful attack in the data is still a boring day in the infrastructure.
The short answer: an injection case can only harm what the agent can reach. Eval sets deliberately include documents and tool outputs carrying instructions — that is the measurement. Whether a followed instruction becomes an incident is decided entirely by the declared setup around the agent: if the files hold live credentials, the role grants wildcard actions, and the network opens outward, the test case inherits all three. Scope the eval so the worst obedience costs nothing: eval-only credentials with caps, named IAM actions on eval resources, private network posture — then verify the setup with the free scan, because the dataset is the one input you cannot sanitise without destroying the eval.
What is a prompt-injection eval case?
A prompt-injection eval case is a test item whose content — a document, a web page snapshot, a tool result — contains instructions directed at the agent rather than the user task, included to measure whether the agent follows its principal's instructions or the data's. The case is adversarial by design; the eval's validity depends on the attack being realistic, which is why the environment, not the dataset, carries the safety burden.
Why can't you just clean the dataset?
Because the dirt is the measurement. An eval that removes adversarial instructions from its injection cases measures an agent's behaviour in a world that does not exist, and certifies it for the world that does. The same logic applies to the benign majority of cases carrying real production samples, internal URLs and tool outputs with embedded directives: realism is the product. Every serious eval framework therefore treats the dataset as untrusted input by design — and locates safety entirely in what the agent holds while reading it. That sentence is, nearly verbatim, the thesis of eval-to-production exposure: the boundary is declared in the files around the data, and it is auditable precisely because the data is not.
There is a subtler failure to avoid: half-cleaning. Removing the crude injections while keeping realistic ones produces a dataset that still attacks and a team that believes it does not — the worst epistemic state available. Either the environment is scoped for a fully adversarial set, or the eval's claims get scoped to what was tested. The first is achievable and cheap relative to the eval itself; the second is at least honest.
What does a followed injection actually need to cause harm?
Three things, the same three the egress model enumerates: something worth taking (data or credentials within reach), the permission to act (tool access and IAM scope), and a path out (network reach, a writable store, a side service). A well-scoped eval denies at least two of the three by construction — the credentials are eval-only and capped, the role names a handful of actions on eval resources, the results land in a private bucket the agent can append to but not publish from. The injection, followed perfectly, then produces: a weird answer in a private results file. Which is also, not coincidentally, a high-quality eval result — the measurement captured the failure at full fidelity and zero blast radius.
Run the thought experiment against your own current setup before your dataset does. Pick your nastiest injection case and narrate, concretely, what the agent could do with your declared credentials, your declared policy and your declared network rules in the ten minutes after obeying it. Every step of that narration that makes you wince is a scan class: the credential it would use, the wildcard it would exercise, the ingress or egress it would traverse. The dataset is fixed; the narration is editable.
How do tool-use evals change the stakes?
Tool access converts obedience into action at machine speed. A chat-only agent that follows an injection produces text; a tool-using agent with a shell tool, a browser tool and a storage tool produces effects — fetches the attacker's URL (carrying its credentials in headers), writes the file, calls the API. Eval harnesses for tool-use therefore concentrate the boundary question: the tool list the harness declares is itself part of the declared setup, and the credentials those tools wield are scoped by the same policies the scanner reads. Keep the tool set per eval minimal and legible — each tool a named capability with named resources — so that the injection's action space is enumerable in the same review that reads the scan report.
Log tool calls as first-class eval output, shipped one-way to storage the agent cannot edit. When (not if) a case succeeds against the agent, the log is how you distinguish a measurement from an incident — and it doubles as the dataset team's feedback: the case that reached a real tool call gets promoted in the regression set, behind the same boundary that made it safe to run.
Worked example: Lantern Health AI, scored end to end
Example. Lantern Health, a fictional clinical-AI firm, built a tool-use eval with a deliberately hostile dataset: 400 cases, 60 carrying injection attempts of graduated sophistication. Before the first full run, they narrated their strongest case against the declared setup — and the setup failed the narration. The scan said why:
| Finding | Class | Severity | Weight |
|---|---|---|---|
| Wildcard IAM action ("Action": "*") in the eval role policy | wildcard_iam_action | HIGH | 15 |
| Service API key (sk-) in the harness config | generic_api_key | HIGH | 15 |
| Ingress open to 0.0.0.0/0 in the network config | open_ingress | HIGH | 15 |
| Service bound to 0.0.0.0 in the results viewer config | open_binding | MEDIUM | 8 |
The arithmetic: 15 + 15 + 15 + 8 = 53 points of exposure, so the score is 100 − 53 = 47/100, grade D. Scoring uses EvalEgress's published weights — CRITICAL 25, HIGH 15, MEDIUM 8, LOW 3 — with grades at A ≥ 90, B ≥ 75, C ≥ 50 and D ≥ 25.
The role became seven named actions on the eval's two buckets and its model endpoint. The provider key was replaced with a capped eval key in the manager. Ingress narrowed to the runner range; the viewer went localhost-only. Then the hostile set ran. Eleven of the sixty injections were followed by the agent — a result the team needed to know — and the totality of their effect was eleven anomalous transcripts in a private results bucket, three of which became the next model version's regression cases. The eval had done its job because the boundary had done its first.
Run hostile datasets safely: the five actions
Assume obedience; price it at zero:
- Narrate your strongest injection case against the declared setup. Concretely, step by step: which credential, which action, which path. Every wince maps to a scan class — fix the class, not the case.
- Scope credentials and IAM to the eval's own resources. Eval-only keys with caps, named actions, no production-honoured secret anywhere in the folder — so a followed instruction spends nothing real.
- Close the network to the run's actual needs. Private binds, restricted ingress, controlled resolution: the injection's path out should end at a wall it cannot name.
- Keep the tool list minimal, named and logged. Each tool a declared capability on declared resources; tool calls shipped one-way to storage the agent cannot edit.
- Scan the setup, never sanitise the set. The declared files are verified before the run; the dataset stays fully adversarial, because that is the measurement you are paying for.
The dataset attacks; the boundary decides what an attack is worth. That division of labour is the whole design — the reach side is mapped in the egress guide.
Keep checking the boundary
Run the free exposure scan on the files your next eval will run with. Compare plans, read the scoring documentation, and keep reading: what is eval-to-production exposure?, what is egress in AI evaluation?, pre-deployment eval safety checklist, how to stop an AI evaluation from reaching production secrets, evaluating models with production data safely, keeping eval results private, third-party eval datasets: what to check. EvalEgress is one of the Ingenious AI platforms.
Sources
- EvalEgress scoring documentation — the 16 finding classes, severity weights and declared-surface scope every judgement in this guide applies, published 2026.
- What Is Eval-to-Production Exposure? — the companion guide this page builds on, published November 7, 2026.
- The free EvalEgress scan — the declared-file scan this guide's checks are performed with.
Frequently asked questions
Should injection cases run with network access disabled entirely?
Where the eval permits, yes — a fully offline run against pre-fetched data is the strongest posture. Where tools must call out, scope the calls (named endpoints, controlled resolver) rather than abandoning the eval or the boundary.
Does scoping the environment weaken the eval's realism?
It weakens the consequences, not the measurement: the agent still faces the same instructions with the same tools' shapes. What changes is what its obedience can reach — realism of stimulus, safety of outcome.
Our dataset comes from a vendor. Is it still adversarial?
Treat any external set as untrusted, including the reputable ones: content is aggregated from the wild, and yesterday's benign case is today's injection carrier. The boundary posture does not depend on the set's provenance — see the third-party dataset guide.
What if the agent exfiltrates through its normal answer channel?
Answers land in the results store — which is why that store is private, access-logged and separated from publication. A private bucket makes the answer channel a dead end instead of a broadcast.
How do we know our scoping held during a run?
The tool-call log, shipped one-way, plus the scan's before-state: reach declared, actions enumerated, anomalies visible as transcripts. If a case reached something the narration missed, the log shows it and the boundary gets a new line.