PISmith: Reinforcement Learning-based Red Teaming for Prompt Injection Defenses
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Prompt injection poses serious security risks to real-world LLM applications, particularly autonomous agents. Although many defenses have been proposed, their robustness against adaptive attacks remains insufficiently evaluated, potentially creating a false sense of security. In this work, we propose PISmith, a reinforcement learning (RL)-based red-teaming framework that systematically assesses existing prompt-injection defenses by training an attack LLM to optimize injected prompts in a practical black-box setting, where the attacker can only query the defended LLM and observe its outputs. We find that directly applying standard GRPO to attack strong defenses leads to sub-optimal performance due to extreme reward sparsity -- most generated injected prompts are blocked by the defense, causing the policy's entropy to collapse before discovering effective attack strategies, while the rare successes cannot be learned effectively. In response, we introduce adaptive entropy regularization and dynamic advantage weighting to sustain exploration and amplify learning from scarce successes. Extensive evaluation on 13 benchmarks demonstrates that state-of-the-art prompt injection defenses remain vulnerable to adaptive attacks. We also compare PISmith with 7 baselines across static, search-based, and RL-based attack categories, showing that PISmith consistently achieves the highest attack success rates. Furthermore, PISmith achieves strong performance in agentic settings on InjecAgent and AgentDojo against both open-source and closed-source LLMs (e.g., GPT-4o-mini and GPT-5-nano). Our code is available at https://github.com/albert-y1n/PISmith.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 49 of its 67 references that are in the map. First posted on arXiv 13 Mar 2026.
Builds on
49 of 67 references.
Closest ancestors · 23
Same direction, newest first
- 2025PISanitizer: Preventing Prompt Injection to Long-Context LLMs via Prompt Sanitization13 Nov
- 2025Defending Against Prompt Injection with DataFilter22 Oct
- 2025PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features15 Oct
- 2025PromptLocate: Localizing Prompt Injection Attacks14 Oct
- 2025RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection6 Oct
- 2025SecInfer: Preventing Prompt Injection via Inference-time Scaling29 Sep
- 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
- 2025DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents13 Jun
- 2025Lessons from Defending Gemini Against Indirect Prompt Injections20 May
- 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attacks15 Apr
- 2025Defeating Prompt Injections by Design24 Mar
- 2025MELON: Provable Defense Against Indirect Prompt Injection Attacks in AI Agents7 Feb
11 more
- 2025PromptShield: Deployable Detection for Prompt Injection Attacks25 Jan
- 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMs1 Nov
- 2024InjecGuard: Benchmarking and Mitigating Over-defense in Prompt Injection Guardrail Models30 Oct
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
- 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspective27 Sep
- 2024Get my drift? Catching LLM Task Drift with Activation Deltas2 Jun
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions19 Apr
- 2024InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents5 Mar
- 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defenses19 Oct
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 26
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2025Qwen3 Technical Reportcited by 8,195
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,678
- 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,591
- 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,538
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
- 2025OpenAI GPT-5 System Cardcited by 910
14 more
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
- 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 475
- 2025The Entropy Mechanism of Reinforcement Learning for Reasoning Language Modelscited by 463
- 2019Multi-News: a Large-Scale Multi-Document Summarization Dataset and Abstractive Hierarchical Modelcited by 431
- 2021Efficient Attentions for Long Document Summarizationcited by 342
- 2025Reasoning with Exploration: An Entropy Perspectivecited by 277
- 2025Logic-RL: Unleashing LLM Reasoning with Rule-Based Reinforcement Learningcited by 260
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2025Securing AI Agents with Information-Flow Controlcited by 108
- 2025The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against Llm Jailbreaks and Prompt Injectionscited by 108
- 2025Prompt Flow Integrity to Prevent Privilege Escalation in LLM Agentscited by 81
- 2025On Entropy Control in LLM-RL Algorithmscited by 39
- 2025EPO: Entropy-regularized Policy Optimization for LLM Agents Reinforcement Learningcited by 15
Built on by
Citing papers per year: 2026: 13.
13 papers.
Sort:
By area:
- 2026PIArena: A Platform for Prompt Injection Evaluationcited by 10
- 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attackscited by 9
- 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
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillationcited by 2
- 2026How Reliable Is Your Jailbreak Judge? Calibration and Adversarial Robustness of Automated ASR Scoringcited by 1
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teamingcited by 1
- 2026LongPIBench: A Long-Context Benchmark for Prompt Injectioncited by 1
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinementcited by 1
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Studycited by 0
- 2026FlashRT: Towards Computationally and Memory Efficient Red-Teaming for Prompt Injection and Knowledge Corruptioncited by 0
- 2026ContainmentBench: Trace-Based Evaluation of Post-Exposure Containment in Tool-Using LLM Agentscited by 0
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learning27 Sep 2026
- 2026CoER: Defending against Adaptive Indirect Prompt Injection via Adversarial Co-Evolution and Refinement7 Sep 2026
- 2026LongPIBench: A Long-Context Benchmark for Prompt Injection28 Aug 2026
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation21 Aug 2026
- 2026Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming5 Aug 2026
- 2026ContainmentBench: Trace-Based Evaluation of Post-Exposure Containment in Tool-Using LLM Agents27 Jul 2026
- 2026How Reliable Is Your Jailbreak Judge? Calibration and Adversarial Robustness of Automated ASR Scoring24 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
- 2026FlashRT: Towards Computationally and Memory Efficient Red-Teaming for Prompt Injection and Knowledge Corruption30 Apr 2026
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Study30 Apr 2026
- 2026PIArena: A Platform for Prompt Injection Evaluation9 Apr 2026
- 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attackscited by 9
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agentscited by 4
- 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
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Studycited by 0
- 2026ContainmentBench: Trace-Based Evaluation of Post-Exposure Containment in Tool-Using LLM Agentscited by 0
- 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
- 2026ContainmentBench: Trace-Based Evaluation of Post-Exposure Containment in Tool-Using LLM Agents27 Jul 2026
- 2026AutoDojo: Adaptive Black-Box Attacks Reveal the Limits of IPI Defenses and Task-Specification Effects in LLM Agents13 Jun 2026
- 2026Security Attack and Defense Strategies for Autonomous Agent Frameworks: A Layered Review with OpenClaw as a Case Study30 Apr 2026
- 2026Architecting Secure AI Agents: Perspectives on System-Level Defenses Against Indirect Prompt Injection Attacks31 Mar 2026
- 2026PIArena: A Platform for Prompt Injection Evaluationcited by 10
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillationcited by 2
- 2026How Reliable Is Your Jailbreak Judge? Calibration and Adversarial Robustness of Automated ASR Scoringcited by 1
- 2026LongPIBench: A Long-Context Benchmark for Prompt Injectioncited by 1
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learningcited by 0
- 2026Climbing the Hill: Prompt Injection Red-Teaming Against Frontier Models with Curriculum Reinforcement Learning27 Sep 2026
- 2026LongPIBench: A Long-Context Benchmark for Prompt Injection28 Aug 2026
- 2026SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation21 Aug 2026
- 2026How Reliable Is Your Jailbreak Judge? Calibration and Adversarial Robustness of Automated ASR Scoring24 Jun 2026
- 2026PIArena: A Platform for Prompt Injection Evaluation9 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2026GPT-Red: Automated Red Teaming via Self-Play at Scale
- 2026A Red Teaming Framework for Evaluating Robustness of AI-enabled Security Orchestration, Automation, and Response Systems
- 2026CHASE: Adversarial Red-Blue Teaming for Improving LLM Safety using Reinforcement Learning
- 2025Strategize Globally, Adapt Locally: A Multi-Turn Red Teaming Agent with Dual-Level Learning
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis
- 2026Defending against Adaptive Prompt Injection Attacks via Reasoning-enabled Task Alignment
- 2025Jailbreak-R1: Exploring the Jailbreak Capabilities of LLMs via Reinforcement Learning
- 2026PI-Hunter: Automated Red-Teaming for Exposing and Localizing Prompt Injections