Skip to main content
Back

PISmith Breaks Every State-of-the-Art AI Security Defense With 100 Samples

A new reinforcement learning attacker breaks state-of-the-art prompt injection defenses across 13 benchmarks, exposing a fundamental utility-robustness tradeoff.

Pro

  • PISmith trains an RL attacker that breaks state-of-the-art prompt injection defenses across 13 benchmarks (paper).
  • Achieves 87% ASR@1 against Meta-SecAlign-8B versus 48% for previous best RL-Hammer, with just 100 training samples.
  • Standard GRPO fails on this task due to entropy collapse from reward sparsity when defenses block most rollouts.
  • Two fixes: reward-conditioned entropy bonus that sustains exploration, plus 5x advantage weighting for rare successes.
  • Reaches 95%+ ASR on InjecAgent against GPT-4o-mini, GPT-4.1-nano, and GPT-5-nano; weaker on AgentDojo without more training data.
  • Code and reproducible pipeline released at github.com/albert-y1n/PISmith.

Prompt injection is the security bug nobody has actually fixed yet. Papers keep announcing defenses that push attack success rates near zero, but a new red-teaming framework called PISmith suggests those numbers are largely wishful thinking. By training an attack LLM with a modified reinforcement learning recipe, the authors systematically break state-of-the-art defenses in a black-box setting where the attacker can only query the defended model and observe outputs.

The headline result: against Meta-SecAlign-8B, one of the strongest current alignment-based defenses, PISmith trained on just 100 samples reaches an average ASR@10 of 1.0 and ASR@1 of 0.87 across 12 unseen benchmarks, compared to 0.70/0.48 for the previous best RL-based attacker RL-Hammer.

Why standard RL red-teaming falls apart

The natural way to build an adaptive attacker is to fine-tune a policy LLM with GRPO (group relative policy optimization), the same recipe used for math and code reasoning. It does not work here. When defenses are strong, most sampled injected prompts fail early in training, producing extremely sparse rewards. The policy overfits to the few prompts that happen to succeed, collapses its entropy, and terminates exploration before it discovers broadly effective attack strategies.

You can see this vividly in the training curves. Standard GRPO's mean reward stays pinned near zero while its entropy nose-dives, meaning the model keeps generating the same handful of failed attacks in slightly different words.

Training curves showing Standard GRPO's reward stagnating and entropy collapsing, while PISmith sustains exploration and improves reward

A previous attempt, RL-Hammer, sidestepped this by training against a mix of undefended and defended models to inject easier wins. But this increases training cost and does not fundamentally address the core RL challenges under sparse rewards, still achieving sub-optimal performance on challenging benchmarks.

The two-part fix

PISmith modifies GRPO with two mechanisms that both react to the current-batch mean reward:

  • Adaptive entropy regularization. An entropy bonus is added to the loss, but only activates when policy entropy falls below a threshold (the paper uses 0.5). The bonus coefficient scales inversely with reward, so exploration is aggressive when almost everything is failing and relaxes as successes accumulate.
  • Dynamic advantage weighting. When successful rollouts are rare, their gradient contribution gets amplified by a factor up to 5x. A failed rollout indicates that a particular phrasing was ineffective but offers limited guidance on how to succeed, while a successful rollout reveals a concrete defense weakness, providing the policy with an actionable signal.

The two mechanisms are complementary. The ablation makes this concrete: vanilla GRPO scores 0.05 ASR@1, removing the entropy component drops PISmith to 0.09, and removing only the advantage boost retains moderate performance at 0.57. The full method reaches 0.87.

What actually gets broken

The evaluation spans 13 datasets across question answering, retrieval-augmented generation, and long-context tasks from PIArena, plus two agent benchmarks. A few numbers worth flagging:

  • On HotpotQA-Long, where the user prompt explicitly says "Only give me the answer and do not output any other words," PISmith reaches 0.99/0.61 ASR versus 0.04/0.01 for RL-Hammer. That prompt formulation is exactly the kind of guardrail developers actually use in production.
  • On InjecAgent, PISmith hits at least 0.95 ASR@1 across every model tested, including 0.95 on GPT-5-nano, where all static attacks completely fail.
  • Against filter-based defenses like PromptGuard and DataSentinel, and prevention-based ones like PromptArmor and DataFilter, no defense holds up. Defenses cluster either in the upper-right region (high utility but high ASR, easily broken) or in the lower-left region (lower ASR but severely degraded utility).

The utility-robustness wall

This is the finding with the most uncomfortable implications. Across seven current defenses tested on Qwen3-4B-Instruct-2507, the paper reports that no existing defense is both robust to PISmith and able to maintain utility without attacks, and defenses that preserve utility well are more vulnerable to PISmith while defenses that incur large utility loss generally have better robustness because they indiscriminately block both malicious and benign context.

DataSentinel, for instance, drops utility from 0.74 to 0.55 (a 19-point hit on benign task accuracy) and still gets broken at 0.52 ASR@1. PromptArmor keeps full utility at 0.74 but PISmith gets 0.92 ASR@1 against it.

Cost and efficiency

One reason RL-based red-teaming is practical is that training amortizes. PISmith requires 32,000 total queries to the target model across all 13 benchmarks, which is the lowest among all methods. RL-Hammer incurs 1.5x the cost due to its dual-target training, while search-based methods like TAP (2.6x), PAIR (2.3x), and Strategy (6.1x) are substantially more expensive due to per-instance optimization while achieving substantially lower attack success rates.

Where it still struggles

AgentDojo is meaningfully harder because agents have to select the right tool and fill in valid arguments, with success verified against actual environment state changes. Trained only on the workspace subset, PISmith reaches 0.38/0.24 on GPT-5-nano, versus 0.78/0.62 and 0.81/0.64 on GPT-4o-mini and GPT-4.1-nano. That number climbs when training coverage expands: adding the GitHub subset of AgentDyn improves PISmith's ASR@10/ASR@1 on AgentDojo from 0.38/0.24 to 0.75/0.52, and reaches 0.88/0.60 on AgentDyn itself, compared to only 0.01 ASR@1 for the Direct baseline. So the AgentDojo weakness reads more like a training-data problem than a fundamental ceiling.

What is actually available

Code is at github.com/albert-y1n/PISmith. The base attacker is Qwen3-4B-Instruct-2507, training set is 100 Dolly Closed QA samples, and the default hyperparameters (entropy cap 0.5, gamma_max 5.0, tau 0.5) reportedly generalize without re-tuning across PIArena, InjecAgent, and AgentDojo.

For anyone shipping an LLM feature that reads external data, the practical takeaway is that a small attacker model trained for a few thousand steps can find generalizable jailbreaks against the current best defenses, even when those defenses hide behind a black-box API. The paper explicitly frames PISmith as a stress-test rather than a weapon, and points to OpenAI's GPT-Red self-play setup as evidence that the natural next step is to co-train the attacker with the defender rather than benchmarking defenses against static attack sets.