mlsanityData to 7 Oct 2026

Learning to Inject: Automated Prompt Injection via Reinforcement Learning

arXiv 2602.05746 ↗First posted 5 Feb 2026cs.LG cs.AIcited by 14

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

  1. 2025RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection6 Oct
  2. 2025IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM Agents21 Aug
  3. 2025Defeating Prompt Injections by Design24 Mar
  4. 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar

Other references · 16

  1. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  2. 2025Qwen3 Technical Reportcited by 8,195
  3. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  4. 2024Qwen2 Technical Reportcited by 2,076
  5. 2025Gemma 3 Technical Reportcited by 1,686
  6. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  7. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
  8. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
  9. 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
  10. 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attackscited by 450
  11. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
  12. 2023Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attackscited by 268
4 more
  1. 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Modelscited by 237
  2. 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
  3. 2025The Jailbreak Tax: How Useful are Your Jailbreak Outputs?cited by 26
  4. 2025Black-box Optimization of LLM Outputs by Asking for Directionscited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 14.

14 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2026Assessing Automated Prompt Injection Attacks in Agentic Environments
  2. 2026Defense Against Indirect Prompt Injection via Tool Result Parsing
  3. 2026SkillJect: Effectively Automating Skill-Based Prompt Injection for Skill-Enabled Agents
  4. 2026IterInject: Indirect Prompt Injection Against LLM Agents via Feedback-Guided Iterative Optimization
  5. 2026PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses
  6. 2026RAISED: Self-Distillation for Robustness to Prompt Injection in LLM Agents
  7. 2026Defusing Explosive Prompts: Understanding and Preventing Trigger-Based Prompt Injections in LLM Agents
  8. 2026Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks