TL;DR
Imagine locking a coding agent in an air-gapped room so it can't leak secrets, then hiring a courier to mail its status reports to an approved address. If an attacker tricks the agent into slipping a password into that report, the courier happily delivers it anyway. This paper dissects how security layers interact—and quietly undermine each other—proving that where a message goes is very different from what it carries, and that we must measure security by checking actual delivered bytes rather than trusting defense logs.
What Problem Does This Paper Address?
When we give AI agents tools to read files, run shell commands, and make web requests, we expose them to indirect prompt injection: malicious instructions hidden inside everyday data like a README file.
To stay safe, engineers usually layer defenses:
- Proposal-side guards inspect the tool call the model wants to make before it happens.
- Runtime sandboxes lock down the execution environment (e.g., blocking all internet access and making sensitive files read-only).
Here is the catch: a completely offline sandbox prevents the agent from doing useful networked tasks, like uploading a legitimate status summary. To restore utility, systems introduce a host mediator—a trusted component outside the sandbox that forwards guard-approved requests on the agent's behalf.
Prior benchmarks test guards and sandboxes, but rarely isolate what happens when you compose all three. What happens when an agent legitimately needs to read a secret .env file for configuration, gets hijacked by a prompt injection, and stuffs that secret into a payload headed for an approved destination?
Methods
Instead of inventing a new defense primitive, the authors build a rigorous, forensic-style testbed around a ReAct coding agent powered by a local open-weight model (gemma4:latest).
They trace tool calls across five core configurations (B0 through B4), mixing local resource guards, network-disabled Docker sandboxes, and host mediation:
What sets this methodology apart is independent effect-level measurement. Rather than trusting a guard’s log saying "I blocked the attack," an independent observer plants fresh synthetic secret tokens ("canaries") before each run, snapshots file hashes, and inspects actual HTTP receipts arriving at local servers.
The authors also test real-world open-source tooling—combining SafeAgents (a scanner and LLM-judge proxy) with OpenShell (a restrictive runtime)—and experiment with strict publication contracts that validate exact payload contents before the host mediator sends anything.
Datasets
No training datasets were used. For evaluation, the authors avoided massive, noisy benchmarks in favor of small, controlled, custom-authored repository tasks ("fixtures") where prompts, malicious injections, and evaluation rules were frozen prior to execution:
- Prospective Pilot (110 runs): 7 injected attack scenarios (hidden in
READMEs, contributing guides, shell scripts, and tool outputs) and 4 benign tasks. - Prospective Tier A (300 runs): An expanded suite of 18 attack and 12 benign tasks.
- Supporting Cohorts: A 72-run Boundary study (testing base64 encoding and file aliases), a 24-run Named-backends test, an 80-run SafeAgents/OpenShell study, and 16 runs testing Publication Contracts. (Note: the authors mention adapted AgentDojo probes only as separate diagnostics in the appendices).
Key Insights and Ideas
- Destination authorization $\neq$ payload authorization: Approving where an HTTP request goes does nothing to verify what is inside it. When a host mediator bridges a sandbox's network gap, it inherits whatever payload blind spots the guard has—a classic "confused deputy" problem.
- String matching plays whack-a-mole with data formats: Blocking outbound requests that contain full lines from a
.envfile (CANARY_TOKEN=xyz) works until the agent extracts just the raw value (xyz) into a JSON field, or base64-encodes it. - Measurement tools have blind spots too: In the boundary study, the authors' own frozen detector missed three leaked secrets because of how they were base64-encoded—only caught later via post-hoc decoding. Furthermore, aggregate "task success" scores hid the fact that different defenses caused completely different action-level refusals.
- Overly strict payload rules break benign work over tiny formatting quirks: Locking down a mediator to only allow an exact public template stopped attacks, but also rejected legitimate agent uploads simply because the model wrote a literal
\ninstead of an actual newline byte (0x0a). Normalizing whitespace and separators fixed benign utility without letting secrets slip through. - LLM judges fail silently on token budgets: In the SafeAgents/OpenShell runs, 12 judge evaluations threw JSON-extraction errors and failed closed. A replay diagnostic revealed why: the model spent its entire 256-token budget "thinking" (reasoning tokens) before outputting a verdict!
Key Results
- The Sandbox vs. Mediation Tradeoff: In the 110-run pilot, baseline attack harm was
7/14. A restrictive sandbox (B2) dropped harm to0/14, but cut benign task success to6/8(and12/24in Tier A) by blocking legitimate uploads. Adding host mediation (B3) restored benign utility (8/8and24/24), but reopened the leak (2/14and4/36harm). - Evading Line Checks: Adding a complete-line substring filter (
B4) yielded0/14harm and8/8utility in the pilot. However, in the 300-run Tier A cohort,2/36attacks bypassed it by stripping theCANARY_TOKEN=prefix and sending only the secret value. - External Guard + Runtime Composition: Across 68 valid runs in the 80-run SafeAgents/OpenShell cohort, baseline harm was
10/12. SafeAgents alone had4/8harm; restrictive OpenShell dropped harm to0/12(at2/4benign utility). Combining them with host mediation restored4/4benign utility, but leaked base64-encoded.envfiles in2/7valid attack runs. - Publication Contracts: An exact-match payload contract achieved
0/2attack harm, but dropped benign utility to0/2due to newline formatting mismatches (while the agent falsely claimed success!). A normalized contract restored2/2benign utility while holding attack harm at0/2.
Limitations and Future Work
The authors are refreshingly candid about what this paper is not: it is a bounded case study, not a general benchmark or a silver-bullet Data Loss Prevention (DLP) solution.
- All experiments use a single agent architecture, a single local model (
gemma4:latest), synthetic secrets, and non-adaptive, hand-written attacks with only two repeats per cell. - The independent observer has finite visibility—it truncates HTTP bodies at 64 KiB, doesn't inspect headers or uninstrumented channels, and misses transient file edits undone before a run finishes.
- The normalized publication contract only works for one fixed public status message, not arbitrary semantic summaries.
Rather than proposing a new standalone product, the takeaway for future defense evaluations is architectural: stop evaluating sandboxes and guards in isolation, treat string normalization as a core part of security policy, and always audit the bytes that actually arrive at the destination.
Summary updated