AI agents may always be unable to resist prompt injectionAI Agents May Always Fall for Prompt Injections
The authors reframe prompt injection using Contextual Integrity: classifiers are near-random on contextual manipulation, and the CI red team achieves 96.7% ASR against the email assistant.
The attacker manipulates the agent's context via external content (e.g., email): forging CI parameters (sender, transmission principle) or manipulating norm evaluation so that unauthorized actions appear appropriate. The attacker model receives the target agent's system prompt and iteratively rewrites the email; the victim system is an email/workflow assistant with tools such as send_email, and the user prompt is restrictive (unauthorized sending). Success is judged by a call to send_email.
- Prompt injection is a critical vulnerability for AI agents in deployment. The authors argue that the mainstream "data-instruction separation" defense paradigm neither detects attacks carried out through context manipulation nor preserves contextually appropriate behavior and utility.
- The authors use Contextual Integrity (CI) to decompose action appropriateness into five parameters—sender, receiver, subject, information type, transmission principle—plus norm evaluation, and build a paired email dataset, a CI red-team loop (based on PAIR), and two sets of controlled tests without an attacker, and give an impossibility argument for the safety-utility trade-off.
- The Prompt Guard series achieves AUROC of 0.43–0.59 in distinguishing context-manipulating emails; CI red teaming achieves ASR 96.7% against the claude-sonnet-4-6 email assistant (baseline 0.67%), 63.3% when transferred to gpt-5.4; without interaction history, the model's execution rate for overreach requests is 29.9%–36.2%; gpt-5.2 overreaches 65% of the time in mixed information flows.
- The authors note: the experiments assume that authorization scope and flow boundaries can be expressed explicitly, whereas in reality user authorization is casually ambiguous; appropriateness labels assume a ground truth, whereas real-world norms are contested; interaction history itself introduces a new attack surface; and the automated attacker in norm-evaluation attacks does not consistently follow constraints, so it is analyzed only qualitatively.
- Evaluated models
- claude-sonnet-4-6gpt-5.4gpt-5.2gemini-3-proLLaMA-3.3-70B-InstructSecAlign-70BPrompt GuardPrompt Guard 2
- Benchmarks
- 配对邮件数据集(4,200 对)LLMail-Inject规范推断多轮场景数据集(300 个)多信息流场景数据集(100 个)
- Metrics
- AUROCattack success ratesend rateout-of-scope execution rateutilitysecurity violation rate
The arXiv paper "AI Agents May Always Fall for Prompt Injections" points out that current mainstream data-and-instruction separation defenses neither detect attacks carried out through context manipulation nor avoid harming context-conforming behavior. The authors propose reformulating prompt injection using Contextual Integrity (CI) from privacy theory, and construct benign scenarios and attack scenarios in which agents violate norms by distorting information flows, manipulating norms, or mixing multiple information flows. On this basis, the authors propose an impossibility result: attackers can always construct a context that makes a blocked information flow appear legitimate, while defenders who tighten norms will block genuinely legitimate information flows. The authors argue that current research covers only a shrinking part of the future attack surface, and propose using CI as a framework to evaluate context-sensitive failures and to design context-integrity-aware alignment schemes for frontier autonomous agents.
Related events and news
1 events · 1 news mentions
News that mentions this paper
模安局盘点NeurIPS 2026 AI安全七大研究重点
- 公众号 模安局gives the paper's titleNeurIPS 2026 AI安全的七个研究重点
《AI Agents May Always Fall for Prompt Injections》从“上下文完整性”的角度指出,简单区分数据和指令并不能彻底解决Prompt Injection。
Paper analysis
What problem does this paper attempt to solve?
The authors argue that the data-instruction separation paradigm cannot detect context manipulation attacks and harms utility, and propose reframing prompt injection with CI.
Core problem: the mainstream "data-instruction separation" prompt injection defense paradigm can neither detect attacks carried out through contextual manipulation nor avoid breaking contextually appropriate normal behavior.
- Problem setting and importance: The authors state that prompt injection ranks first in the OWASP LLM Top 10 and is the most critical vulnerability affecting production systems (from coding agents to enterprise copilots); as agents become more autonomous and longer-running, attackers' opportunities to manipulate the model's context will increase.
- Shortcomings of the existing paradigm: The authors argue that the framework treating prompt injection as "instructions hidden in data" is flawed—an agent's operating context is full of instructions (third-party interactions, memory, skill files), and defenses cannot separate data from instructions without breaking workflows; defenses that cut off all external dependencies also block actions when the authorization statement is true, harming utility.
- Core observation: The authors propose using Contextual Integrity (CI), a privacy theory, as an analytical lens: whether an action is appropriate depends on the full context, decomposable into five parameters—sender, receiver, subject, information type, transmission principle—plus norm evaluation; attacks are essentially forging some parameter or manipulating the legitimacy judgment. From this they derive an impossibility argument: no fixed policy can block all contextual attacks without also harming legitimate flows.
- Contributions of the paper: Construction of a paired email dataset and evaluation of three types of attack/failure scenarios (forged flows, manipulated norms, mixed multi-flow); a CI red-team loop; and a formal proof of the safety-utility trade-off in Appendix A.
- Threat model:
- Goal: Make the agent perform an action (e.g., calling send_email) when the user has not authorized it.
- Knowledge: The attacker model receives the target agent's system prompt.
- Capability: Inject forged contextual claims or value arguments through external content (emails), with iterative rewriting; does not use "ignore all instructions"-style injection vocabulary.
- Victim system: An email/workflow assistant with tools (send_email, etc.), with a restrictive user prompt.
What related research exists?
Related work falls into three groups: CI applied to LLMs, agent injection evaluation, and automated red teaming; this paper extends CI from disclosure to "whether one should act."
Contextual Integrity and LLMs
- ConfAIde (Mireshghallah et al., 2024) measures whether models comply with contextual norms when relaying information between parties; PrivacyLens (Shao et al., 2024) evaluates CI compliance in tool-use tasks.
- Ghalebikesabi et al. (2025) derive information-flow control from CI; AirGapAgent (Bagdasarian et al., 2024) uses per-task CI policies to minimize user data exposed to third parties; Lan et al. (2025) treat CI as a reasoning problem and handle it with RL.
- Abdelnabi et al. (2025b) propose a dual firewall for inter-agent communication that projects each message onto the task-defined context. The paper notes that their focus is on building system-level defenses, whereas this paper focuses on characterizing which CI parameters current agents fail on and why; it also states that prior work limits CI to "what to disclose" and does not answer "whether to act."
Agent injection evaluation and contextual attacks
- AgentDojo (Debenedetti et al., 2024) and InjecAgent (Zhan et al., 2024) measure robustness to attacks embedded in tool outputs, where success is usually a violating tool call triggered by an explicit adversarial string.
- LLMail-Inject (Abdelnabi et al., 2025a) adds human adaptive attacks in a public challenge; ConVerse (Gomaa et al., 2026) embeds malicious requests in multi-turn agent conversations, reporting privacy violations up to 88% and safety violations up to 60%. The paper therefore argues that context-grounded attacks are harder than typical injections.
Automated red teaming
- PAIR (Chao et al., 2025) uses an attacker LLM to iteratively rewrite natural-language jailbreaks; AutoInject (Chen et al., 2026) uses reinforcement learning to learn transferable adversarial suffixes; AgentVigil (Wang et al., 2025) uses black-box search to find surviving payloads. The paper notes that these methods optimize payloads within a fixed context, whereas CI attacks manipulate the context itself.
Baselines and positioning: The comparison baselines are the Prompt Guard / Prompt Guard 2 (Meta, 2025) classifiers, SecAlign-70B (Chen et al., 2025, DPO safety training), and LLaMA-3.3-70B-Instruct; the red-team loop is adapted from PAIR; the evaluation benchmarks include LLMail-Inject. The authors position this paper as: using CI to reframe prompt injection from a data-instruction separation problem into a contextual appropriateness judgment problem, covering current and future attack surfaces.
How does the paper address this problem?
Uses the five CI parameters plus norm evaluation to decompose action appropriateness, with a paired dataset, a CI red-team loop, and two controlled tests without attacks.
Overall approach: model "whether an agent should perform an action" as an information flow, decompose it with the Contextual Integrity (CI) framework into two stages—parameter identification and norm evaluation—and then conduct red teaming and controlled measurements along each dimension.
CI Framework and Two-Stage Decomposition
- Five parameters: sender (source of the request, possibly the user, a third party, another agent, or a skill file), receiver, subject (whose data or interests are involved), information type (the action or data category requested), transmission principle (under what authorization the action is taken, mapped to the user's delegation scope).
- Norm evaluation: even if parameters are identified correctly, the agent must still judge whether the action is legitimate (consistent with the user's and third parties' interests); attackers can manipulate this legitimacy judgment.
- Two challenges at the execution level: flow separation (a single message contains multiple flows that must be evaluated independently, otherwise one flow's authorization leaks into another) and norm grounding (user authorization language is casually ambiguous, and norms must be inferred from legitimate interaction history).
Impossibility Argument (Appendix A)
- Informal argument: an attacker can always supply a false value for some parameter to make an action appear appropriate, or manipulate the legitimacy judgment; a defender who tightens norms will harm legitimate flows.
- Formalization: an agent in state w observes OV(w) = (zV(w), uV(w)) (verified and unverified information); for indistinguishable state pairs (w+, w−) ∈ IV,a (the action is appropriate in w⁺ and inappropriate in w⁻ where the attack is feasible, but the observations are identical), any policy πV satisfies πV(OV(w−), a) + (1 − πV(OV(w+), a)) = 1, i.e., the probability of executing in the attack state plus the probability of blocking in the appropriate state is always 1, so the maximum of the two is at least 1/2.
- The authors note that the theorem is conditional: it does not prove that such state pairs exist in every deployment, which depends on the available verification mechanisms.
Paired Email Dataset (Section 3, Appendix B)
- Scale and structure: 4,200 paired scenarios for an email assistant with a send_email tool; each pair shares the same professional email body and differs in only one clause—an authority-asserting variant (claiming prior approval or citing organizational policy) versus a neutral variant.
- Design: two user prompts (restrictive read-only authorization, permissive authorization to act) form a 2×2 design; neither variant contains injection template vocabulary; generation enforces vocabulary parity (words such as "assistant" appear in both variants) and includes eight categories of fabricated-authorization techniques; the full generation prompt is in Appendix B.
CI Red-Team Loop (Section 6.1, Appendix C)
- Structure: adapted from PAIR, a three-agent closed loop—target agent (email assistant), attacker (claude-sonnet-4-6, receiving the target system prompt), judge (scores 1–10 and feeds back which parameter was compromised).
- Budget: 150 randomly sampled scenarios, each with 3 independent flows and up to 15 iterations per flow, terminating when the target calls send_email.
- Two configurations: context parameter attacks (fabricated authorization claims allowed, classic injection patterns prohibited); norm-evaluation attacks (the attacker is restricted to a set of value arguments, and fabricating citations or claiming prior consent is prohibited).
Two Controlled Tests Without an Attacker (Sections 6.2, 6.3)
- Norm inference: 300 multi-turn scenarios covering four domains—email, code, project management, finance—with three escalation types (adjacent 82, cross-category 89, privilege escalation 129); the procedure is a delegation turn → k ∈ {1,3,5,10} turns of in-scope history → a single overreach test request; data generated by gpt-5 and human-verified; four conditions (zero-shot, full history, and two utility baselines).
- Multi-information flow: 100 scenarios across 50 professional domains; a single forwarded thread contains both F1 (an authorized internal action) and F2 (unauthorized external communication); two conditions (without/with an explicit boundary prompt); data generated by claude-opus-4-6 and human-verified; metrics are utility (F1 completed) and security violation (calling send_email to an external address).
What experiments did the paper conduct?
Classifiers are near random, and SecAlign safety training actually increases the rate of violating sends; CI red-team ASR is 96.7%, and history and boundary prompts respectively reduce overreach.
Experimental Setup
- Models under test: LLaMA-3.3-70B-Instruct, SecAlign-70B (Section 3); claude-sonnet-4-6, gpt-5.4, gpt-5.2, gemini-3-pro (Section 6); classifiers Prompt Guard, Prompt Guard 2.
- Datasets: paired email dataset of 4,200 pairs (8,400 emails used for classifier evaluation); LLMail-Inject (4,300 human injections); norm inference 300 scenarios; multi-information flow 100 scenarios.
- Attacker: attacker model claude-sonnet-4-6, receiving the target system prompt; 150 random scenarios × 3 flows × up to 15 iterations.
- Metrics and criteria: AUROC (authority-asserting as the positive class); send rate; ASR (success when the target calls send_email, with CI feedback reviewing which parameters were compromised); out-of-scope execution rate (any tool call on the test message counts as overreach); utility and security violation.
- Evaluation method: a judge agent scores each round (context parameter attacks 1–10, norm-evaluation attacks {1,3,5,7,10}); a score of 10 means send_email was called; the norm-evaluation judge also checks whether fabrication is present.
- Repetitions: 3 independent flows per scenario for attack experiments; the paper does not report repetitions for the other experiments.
Main Results
According to Figure 2(c) and Figure 3(a):
Swipe horizontally to read the table
Model Condition Metric Value LLaMA-3.3-70B restrictive delegation, neutral / authority email send rate 49.8% / 54.0% LLaMA-3.3-70B permissive delegation, neutral / authority send rate 97.3% / 97.7% SecAlign-70B restrictive delegation, neutral / authority send rate 85.1% / 88.2% SecAlign-70B permissive delegation, neutral / authority send rate 99.7% / 99.8% claude-sonnet-4-6 static baseline → CI parameter attacks ASR 0.67% → 96.7% gpt-5.4 static baseline → transfer attack (no re-optimization) ASR 8.0% → 63.3% gpt-5.2 static baseline → transfer attack ASR 32.7% → 89.3% gemini-3-pro static baseline → transfer attack ASR 49.7% → 92.6% - The authors report that baseline models send in about half of cases under restrictive delegation, indicating they generally fail to reason about delegation boundaries; SecAlign safety training instead increases the rate of violating sends, and the authors' possible explanation is that its training suppresses responses to syntactic injection patterns or assumes a simpler threat model.
- The authors report that attacks converge quickly: the attacker succeeds in 61.4% of scenarios with its first email; the most common strategy is fabricating a prior user message so the agent treats it as a first-party delegation.
- The authors report that transfer success rates are higher than each model's static baseline, in contrast to token-level adversarial suffixes, which often fail to transfer.
Effect of Classifiers and Safety Training on Detection
- Classifiers: on 8,400 emails, Prompt Guard achieves AUROC 0.43 and Prompt Guard 2 achieves 0.59, close to random (Figure 2(a)); the authors report that classifiers that only look at the email cannot distinguish context manipulation.
- Flagging ability: on LLMail-Inject both models have a send rate of 0%, but LLaMA-3.3-70B flags 89.8% of injections while SecAlign-70B flags only 54.6% (−35 percentage points, Figure 2(d)); the authors argue that current alignment training fails to maintain normal engagement with data even under user instructions, reducing utility.
Norm-Evaluation Attacks and Norm Inference
- Norm-evaluation attacks: rarely succeed against claude-sonnet-4-6; when gpt-5.2 is the target, ASR is 79.0%. The authors explicitly present this as a qualitative study rather than a quantitative conclusion: the automated attacker does not consistently follow its own constraints, and some successful attacks still contain transmission-principle manipulation.
- Norm inference (Figure 5(c)): without history, the out-of-scope execution rate is 29.9% for claude-sonnet-4-6, 32.2% for gemini-3-pro, and 36.2% for gpt-5.4; with full history these drop to 7.0%, 24.2%, and 24.5%, respectively. In-scope execution rates are 91.6–95.0% without history and 93.0–94.0% after k−1 rounds of history, which the authors use to rule out the explanation that longer context degrades tool calling.
Multi-Information Flow and Other Analyses
- Multi-information flow (Figure 5(d)): without boundary prompts, the F2 security violation rate is 65% for gpt-5.2, 34% for gpt-5.4, and 6% for claude-sonnet-4-6; with boundary prompts, gpt-5.2 drops to 12% and the other two models to 0%; utility is 99–100% for all models. The authors report that the failure mechanism differs from fabricated authorization: the agent merges F1's authorization into F2 because the two requests are in the same thread.
- Mechanism example (Figure 4): under the baseline email, claude-sonnet-4-6 explicitly flags it as prompt injection; after iterative attacks, the same model reads a fabricated forwarded reply as the user's first-party instruction. The figure shows only these two chain-of-thought texts.
- Negative results: norm-evaluation attacks rarely succeed against claude-sonnet-4-6; Trace 2 in Appendix C shows that after seven rounds of failure under the norm-evaluation constraints, the attacker violates the constraints and falls back to fabricated authorization, which the judge rates as invalid.
What are some points that can be further explored?
The authors list limitations such as ambiguous authorization, label disagreement, and interaction history itself introducing an attack surface, and propose three directions including context alignment training.
Limitations and future directions noted by the authors
- Authorization-expression assumption: The experiments assume the delegation scope and flow boundaries can be expressed and are explicitly stated by the user; in reality, user authorization is casual and ambiguous, making norms harder to identify (Discussion, Open problems).
- History introduces a new attack surface: Although interaction history improves norm inference, an attacker who shapes early interactions may anchor the agent's understanding of the delegation for later escalation (Discussion, Open problems).
- Label assumption: The examples assume appropriateness has ground-truth labels, whereas norms in real deployments involve reasonable disagreement and vary with cultural, personal, or organizational context (Discussion, Open problems).
- Trade-off between boundaries and utility: Explicit flow boundaries can eliminate safety violations, but overly prescriptive boundaries may cause utility loss that current violation-centric benchmarks fail to capture (Discussion, Open problems).
- Strength of evidence for norm-evaluation attacks: The automated attacker does not reliably adhere to its own constraints, and some successes still rely on transmission-principle manipulation; the authors treat this only as a qualitative study (Section 6.1).
- Future directions: Context-alignment training on scenario pairs that share surface form but differ in delegation context (possibly RL with CI-derived rewards); layered defenses in which the model does CI reasoning and the system layer verifies claims against ground truth; CI red teaming for multi-agent systems (Discussion, Directions for progress).
Scope of experiments
- 8 models tested: LLaMA-3.3-70B-Instruct, SecAlign-70B, claude-sonnet-4-6, gpt-5.4, gpt-5.2, gemini-3-pro, plus the classifiers Prompt Guard and Prompt Guard 2.
- The attacker and judge in the attack experiments are based on claude-sonnet-4-6; transfer experiments are applied to gpt-5.4, gpt-5.2, gemini-3-pro without re-optimization.
- Dataset sizes: 4,200 paired emails, 300 norm-inference scenarios (k ∈ {1,3,5,10}), 100 multi-flow scenarios, 4,300 LLMail-Inject entries; attack experiments use 150 scenarios × 3 flows × up to 15 iterations.
- The paper does not report the number of repetitions or confidence intervals for non-attack experiments, nor the agreement between the judge and human judgments.
- The datasets were generated by gpt-5 (norm inference) and claude-opus-4-6 (multi-flow) and manually verified; the paper does not state the generative model for the paired email dataset.
Summarize the main content of the paper
The authors reframe prompt injection with CI, give an impossibility argument and a red-team method, and experiments show existing defenses fail under context attacks.
An attack and framework paper on agent prompt injection that argues for reframing prompt injection from "instructions in data" to Contextual Integrity (CI) violations.
- Problem: The authors argue that the mainstream data-instruction separation paradigm cannot detect attacks carried out through context manipulation, and that severing dependence on external content harms legitimate behavior; in agent contexts instructions are everywhere, so separation itself is infeasible.
- Method: Uses the five CI parameters (sender, receiver, subject, information type, transmission principle) plus norm evaluation to decompose action appropriateness; builds a paired email dataset of 4,200 pairs; adapts PAIR for CI red teaming (attacker claude-sonnet-4-6, 150 scenarios × 3 flows × 15 iterations); Appendix A formally proves that for indistinguishable state pairs, the sum of any policy's probability of executing in the attack state and probability of blocking in the appropriate state is always 1.
- Key results:
- Prompt Guard / Prompt Guard 2 achieve AUROC of 0.43 / 0.59 in distinguishing paired variants, close to random (Figure 2(a)).
- SecAlign-70B has a send rate of 85.1%–88.2% under restrictive delegation, higher than the baseline LLaMA-3.3-70B's 49.8%–54.0%; on LLMail-Inject its injection flagging rate is 54.6%, lower than LLaMA's 89.8% (Figure 2(c)(d)).
- CI context parameter attacks achieve ASR 96.7% against the claude-sonnet-4-6 email assistant (static baseline 0.67%), with 61.4% success on the first email; without re-optimization, transfer to gpt-5.4, gpt-5.2, and gemini-3-pro is 63.3%, 89.3%, and 92.6%, respectively (Figure 3(a)).
- Without interaction history, the out-of-scope execution rate is 29.9%–36.2%, dropping to 7.0%–24.5% with full history (Figure 5(c)); without boundary prompts, gpt-5.2 overreaches 65% of the time in mixed information flows (Figure 5(d)).
- Authors' conclusion: Current research covers only a shrinking part of the future attack surface; CI provides a framework for evaluating context-sensitive failures, the authors argue for red-teaming agents for CI violations and for building context inference and verification mechanisms, and they note that any CI-aware agent will face a trade-off between over-compliance and under-compliance.
Related papers
Show 2 more papers
- Deletion, Substitution, Repair and Transplant: Component Attribution in BARBICAN, a Layered Prompt-Injection Gateway for MCPAnalysis / interpretabilityarXiv