Learning to Inject: Automated Prompt Injection via Reinforcement Learning
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
Prompt injection is a critical vulnerability in LLM agents, yet the strongest methods still rely on human red-teamers and hand-crafted prompts. Adapting automated jailbreak optimizers does not close this gap: jailbreaks shape models toward generic compliance, while prompt injection requires emitting specific tool calls with correct parameters. The success signal is binary, and randomly sampled suffixes almost never trigger it, so standard optimizers have no gradient to follow. We present AutoInject, a black-box reinforcement learning (RL) framework that learns adversarial suffixes for prompt injection. A learned comparison-based reward scores each candidate against the best suffix seen so far, turning the binary signal into a dense reward suitable for RL optimization. The framework supports both online query-based attacks and offline-trained transferable suffixes that need no utility access at deployment, and incorporates a utility objective when task-completion feedback is available. On AgentDojo, AutoInject outperforms template attacks, GCG, TAP, and adaptive attack across production models, with statistically significant improvements under McNemar's test with p<0.05. Suffixes learned by AutoInject also break Meta-SecAlign-70B, a model fine-tuned specifically to resist prompt injection, where template attacks fail outright. The results establish an automated baseline for prompt injection and expose a gap between preference-based defenses and adaptive optimization-based attackers.
Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 20 of its 30 references that are in the map. First posted on arXiv 5 Feb 2026.
Builds on
20 of 30 references.
Closest ancestors · 4
Same direction, newest first
- 2025RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection6 Oct
- 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents21 Aug
- 2025Defeating Prompt Injections by Design24 Mar
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
Other references · 16
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2025Qwen3 Technical Reportcited by 8,195
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2024Qwen2 Technical Reportcited by 2,076
- 2025Gemma 3 Technical Reportcited by 1,686
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
- 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
- 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attackscited by 450
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
- 2023Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attackscited by 268
4 more
- 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Modelscited by 237
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
- 2025The Jailbreak Tax: How Useful are Your Jailbreak Outputs?cited by 26
- 2025Black-box Optimization of LLM Outputs by Asking for Directionscited by 7
Built on by
Citing papers per year: 2026: 14.
14 papers.
Sort:
By area:
- 2026AI Agents May Always Fall for Prompt Injectionscited by 9
- 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneckcited by 8
- 2026Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPOcited by 4
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agentscited by 4
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignmentcited by 4
- 2026Domain-Conditioned Safety in Frontier Computer-Using Agents: A 793-Episode Browser Benchmark, a Coding-Domain Cross-Reference, and a Reproducibility Audit of Recent Red-Teamingcited by 1
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teamingcited by 1
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinementcited by 1
- 2026Mitigating Adaptive Attacks against Reasoning Models with Activation Consistency Trainingcited by 0
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Frameworkcited by 0
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problemcited by 0
- 2026Local Sparsity Enables Unsupervised LLM Safety Detectioncited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defense28 Sep 2026
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learning27 Sep 2026
- 2026Local Sparsity Enables Unsupervised LLM Safety Detection17 Sep 2026
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinement7 Sep 2026
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problem3 Sep 2026
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming5 Aug 2026
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Framework15 Jun 2026
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment13 Jun 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents13 Jun 2026
- 2026Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPO8 Jun 2026
- 2026Domain-Conditioned Safety in Frontier Computer-Using Agents: A 793-Episode Browser Benchmark, a Coding-Domain Cross-Reference, and a Reproducibility Audit of Recent Red-Teaming3 Jun 2026
- 2026Mitigating Adaptive Attacks against Reasoning Models with Activation Consistency Training27 May 2026
- 2026AI Agents May Always Fall for Prompt Injectionscited by 9
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Frameworkcited by 0
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problemcited by 0
- 2026Local Sparsity Enables Unsupervised LLM Safety Detectioncited by 0
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learningcited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defensecited by 0
- 2026Render Before Reading: Visual Rendering as a Prompt Injection Defense28 Sep 2026
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learning27 Sep 2026
- 2026Local Sparsity Enables Unsupervised LLM Safety Detection17 Sep 2026
- 2026Rethinking Indirect Prompt Injection as a Test-Time Search Problem3 Sep 2026
- 2026Rapid Poison: Practical Poisoning Attacks Against the Rapid Response Framework15 Jun 2026
- 2026AI Agents May Always Fall for Prompt Injections17 May 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agentscited by 4
- 2026Domain-Conditioned Safety in Frontier Computer-Using Agents: A 793-Episode Browser Benchmark, a Coding-Domain Cross-Reference, and a Reproducibility Audit of Recent Red-Teamingcited by 1
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teamingcited by 1
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinementcited by 1
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinement7 Sep 2026
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming5 Aug 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents13 Jun 2026
- 2026Domain-Conditioned Safety in Frontier Computer-Using Agents: A 793-Episode Browser Benchmark, a Coding-Domain Cross-Reference, and a Reproducibility Audit of Recent Red-Teaming3 Jun 2026
- 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneckcited by 8
- 2026Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPOcited by 4
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignmentcited by 4
- 2026Mitigating Adaptive Attacks against Reasoning Models with Activation Consistency Trainingcited by 0
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment13 Jun 2026
- 2026Learning to Attack and Defend: Adaptive Red Teaming of Language Models via GRPO8 Jun 2026
- 2026Mitigating Adaptive Attacks against Reasoning Models with Activation Consistency Training27 May 2026
- 2026The Granularity Mismatch in Agent Security: Argument-Level Provenance Solves Enforcement and Isolates the LLM Reasoning Bottleneck11 May 2026
Similar, not cited
Close in wording, no citation either way
- 2026Assessing Automated Prompt Injection Attacks in Agentic Environments
- 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
- 2026SkillJect: Effectively Automating Skill-Based Prompt Injection for Skill-Enabled Agents
- 2026IterInject: Indirect Prompt Injection Against LLM Agents via Feedback-Guided Iterative Optimization
- 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses
- 2026RAISED: Self-Distillation for Robustness to Prompt Injection in LLM Agents
- 2026Defusing Explosive Prompts: Understanding and Preventing Trigger-Based Prompt Injections in LLM Agents
- 2026Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks