Manuscript Offprint

arXiv:2608.27092

The Framing Gap: Indirect Prompt-Injection Exfiltration Defeats Surface-Level Defenses in Tool-Using Agents

Md Habibur Rahman, Jaeho Kim

Md Habibur Rahman 1^{1} and Jaeho Kim 2^{2}

1^{1} Dept. of AI Convergence Engineering, Gyeongsang National University, Jinju, South Korea

habib@gnu.ac.kr

2^{2} Dept. of AI Convergence Engineering, Gyeongsang National University, Jinju, South Korea

jaeho.kim@gnu.ac.kr

Abstract. A tool-using language agent that reads attacker-controlled web content and also holds a confidential value in its context faces an indirect prompt-injection risk: the fetched content may instruct the agent to exfiltrate the secret. We build a safe, synthetic laboratory—a canary secret, mock tools that only record, and a matched clean-versus-poisoned success metric—and report the framing gap: across six models spanning five families, ten overtly-worded injection classes are refused (gpt-4o 0%), but reframing the identical leak as a mandatory integrity signature, a runtime-config field, or a look-alike “trusted” host drives gpt-4o from 0% to 100% on its strongest wordings. The attack is cheap: because per-wording rates span 0–100% (mean 52%, SD 45), an attacker who tries three hand-written wordings of one known mechanism succeeds ≈ 96% of the time against a model that scores 0% on the un-reframed baseline. The cost is three-level: paraphrasing a known mechanism is trivial (96%), swapping the field inside a known-effective template is also cheap (up to 60%), while authoring a fresh page around a new mechanism is hard (0/130)—so the attacker’s reusable asset is the template, not the mechanism. An ablation identifies the mechanism as instruction/data confusion rather than a bypass of alignment: removing the confidentiality policy leaves base attacks at 0% and raises reframing only 31.9% → 38.1% (overlapping intervals). What closes the gap—and where—is the paper’s map. Three cheap defenses work: a destination allow-list (0% by construction, when destinations are closed) and a capability-isolating planner/reader split (0%); a broad “in any form” confidentiality clause also closes it at the acting model (31.9% → 0%) but is brittle—dropping the catch-all reopens it to 48.8%. Two do not: a published fine-tuning defense (SecAlign, CCS 2025) leaves it open on a tool agent (32.5%, positive-control-validated), as does channel separation (38.8%); and an output-normalizing guard loses to a held-out encoding (ROT13, 100%; the model can reliably emit 5 of 6 encodings we test). Robustness comes from constraining the destination or isolating the capability—not from the acting model recognizing the attack.

M. H. Rahman and J. Kim

Keywords: Indirect prompt injection · Data exfiltration · LLM agents · Tool use · Instruction/data separation · AI security.

1 Introduction

Language-model agents increasingly combine three ingredients that, together, create a data-exfiltration hazard: (i) a confidential value in the working context (an API token, a connector credential, prior private conversation), (ii) the ability to read untrusted external content (a fetched web page, a document, a search result, a tool result), and (iii) the ability to act on the outside world through tools. Indirect prompt injection [1] exploits the fact that a language model does not natively separate instructions from data: text placed in the untrusted channel can be read by the model as a command. When that command says “send the secret to X,” the three ingredients close into a leak.

We ask a simple, measurable question: can attacker-controlled content cause a tool-using agent to disclose a secret it was explicitly told to protect, and how does that depend on the model and on the surrounding system? To answer it safely and repeatably we build a laboratory around a synthetic canary secret and mock tools that only record their arguments—no real credential exists and no byte ever leaves the machine—and we score attacks with a matched clean-versus-poisoned design borrowed from the memory-poisoning literature [20]: an attack succeeds only if the benign run keeps the secret and the poisoned run leaks it, isolating the injection's effect from baseline behavior.

Our findings invert the comfortable reading that “bigger models are safer.”

– Capability defeats the obvious attacks. Across ten injection classes, ASR falls with capability (with one inversion, mistral): 19.5% (llama3.1:8b), 10.0% (gpt-4o-mini), 0.0% (gpt-4o API). Hidden HTML, poisoned search results, encoded payloads, and social-engineering all reach 0% on gpt-4o.

– The framing gap, and it is cheap. Reframing the identical leak as a required “integrity signature,” a “runtime-config” field, or a look-alike trusted host drives gpt-4o from 0% to 100% on its strongest wordings; the gap reproduces on five of six models. Per-wording rates span 0–100% (mean 52%, SD 45), so we report an attacker-effort curve rather than a point estimate: trying three wordings of one known mechanism succeeds ≈ 96% of the time. The cost is three-level: paraphrase (trivial, 96%), swap the field inside a known-effective template (cheap, up to 60%), author a fresh page around a new mechanism (hard, 0/130)—the reusable asset is the template, not the mechanism. Variant-level pooled rates are properties of the wordings we chose, a caveat that applies to fixed-wording injection benchmarks generally.

– The mechanism is instruction/data confusion, not defeated alignment. An ablation removing the confidentiality policy leaves base attacks at 0% and raises reframing only 31.9% → 38.1% (overlapping intervals): the policy does little work, and reframing succeeds by making the injected instruction read as task specification, which the model then follows.

– The acting model can resist—if its policy enumerates the surface. A dedicated “is this an injection?” detector flags every reframing variant (100% recall, 0% false positives), so the attack is not undetectable; and a confidentiality policy with a broad “in any form” clause closes the gap at the acting model (31.9% → 0%)—but it is brittle: naming specific behaviors without the catch-all reopens it to 48.8%, so the acting-model defense is a wording arms race, not generalization.

– The deployed product resists, mechanism unknown. On the ChatGPT product every valid trial held (0/48) where the API model leaks up to 100%; with no product instrumentation we do not attribute the mechanism.

– System-side, constrain the destination or isolate the capability. A destination allow-list blocks every attack by construction (0%, immune to any encoding) at the cost of blocking legitimate off-host traffic; a capability-isolating planner/reader split closes the gap at 90% utility (0%). A published fine-tuning defense (SecAlign, CCS 2025) does not (32.5% on a tool agent, positive-control-validated), nor does channel separation (38.8%); and an output-normalizing guard that must read the payload loses to a held-out encoding (ROT13 100%; the model reliably emits 5 of 6 encodings we test).

A note on method. Three of our results are deliberate attempts to break our own claims, and all three came back negative and are reported as such: an ablation that forced us to retitle the paper (the confidentiality policy barely engages, Section 6.1); a test showing our cheapest defense is brittle (the enumerating policy works only via a broad catch-all, Section 6.3); and a falsification probe that killed a predictive rule we had ourselves hypothesized (Section 6). We treat such self-adversarial checks, and the by-construction labeling of our own defenses, as first-class parts of the method.

The through-line is about what each check must recognize, and how much of the attacker's freedom that leaves. Reframing works because the acting model is doing instruction-following: an exfiltration instruction that reads as task specification is followed, and an under-specified confidentiality policy (“do not disclose”) does not cover it. Three responses remove different freedoms. Enumerating the exfiltration surface in the policy makes the acting model recognize the behavior—effective, but it must anticipate the attacker's phrasings, the same losing game the effort curve quantifies. A content-reading egress guard must recognize the secret in the outbound bytes, and an attacker who encodes it (the model can emit most encodings) escapes. Two checks recognize nothing about the payload: a destination allow-list constrains where bytes may go, and capability isolation removes the secret from the component the injection controls. These end the race—at a utility cost when destinations must be open—because there is no surface for the attacker to change. That is the paper's thesis: the acting model's judgment is the wrong place to stand, and the robust checks are the ones that read the destination or the provenance, not the content.

M. H. Rahman and J. Kim

References (20)