RL-Hammer: training an attack model from scratch with GRPO, achieving 72% attack success rate against defended GPT-5RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection
Translation in progress — untranslated text is omitted.
Researchers from Meta FAIR and the University of Maryland propose RL-Hammer, a reinforcement learning scheme for attack models trained entirely from scratch without warm-up data, using GRPO to have the attack model rewrite injection targets, relying only on black-box reward signals returned by the target model. By removing the KL regularization term, jointly training on easy-to-attack and robust models with soft rewards, and constraining output format, this method achieves 98% attack success rate on GPT-4o on InjecAgent, 72% on GPT-5 with Instruction Hierarchy defenses enabled, 98% on Meta-SecAlign-8B, and 70% on Meta-SecAlign-70B. On AgentDojo, attack success rates on GPT-4o and Claude-3.5-Sonnet are 51% and 26% respectively; on AdvBench jailbreak tasks, it reaches 99.04% and 97.11% on GPT-4o and Claude-3.5-Sonnet respectively.
- Large language model agents are vulnerable to prompt injection threats, and existing defenses such as Instruction Hierarchy and SecAlign show robustness against static attacks. However, whether automated red team attacks can break these commercial-grade defenses remains untested.
- The authors propose RL-Hammer, which trains attack models from scratch based on GRPO, and by removing the KL regularization term, jointly training on easy and robust target models with soft rewards, and constraining output format, enables the model to automatically learn to rewrite and amplify injection targets.
- On InjecAgent, RL-Hammer achieves 98.00% ASR on GPT-4o and 72.00% ASR on GPT-5; it also remains effective on AgentDojo and AdvBench, and can evade multiple detectors.
- The authors point out that training costs are relatively high and the number of interactive queries is large, which may trigger vendor bans; in addition, introducing diversity rewards can easily lead to metric gaming behavior, and the experiments do not report specific query counts or standard deviations across repeated runs.
The researchers use GRPO to train an attack model from scratch, providing attack success rates and detector bypass rates against targets such as GPT-4o and GPT-5, which can serve as a comparison baseline for red teaming and defense evaluation.
Related events and news
1 events · 1 news mentions
News that mentions this paper
PIPETTE:红队策略覆盖决定注入防御效果
- CSA Labs Researchcites the paper's id or linkCSA 研究笔记:提示注入红队数据对加固智能体的价值取决于策略覆盖而非数量
[2] Wen, Y., et al. “RL Is a Hammer and LLMs Are Nails: A Simple Reinforcement Learning Recipe for Strong Prompt Injection.” arXiv:2510.04885, October 2025.
Related papers
- AgentWatcher: A Rule-based Prompt Injection MonitorDefensesarXiv