Toward a Dynamic Stackelberg Game-Theoretic Framework for Agentic AI Defense Against LLM Jailbreaking

Zhengye Han, Quanyan Zhu

TL;DR

This paper introduces a novel game-theoretic framework, the "Purple Agent," to defend against LLM jailbreaking. By modeling the interaction as a dynamic Stackelberg game and using RRT for exploration, the Purple Agent proactively identifies and blocks adversarial prompt strategies, significantly reducing successful jailbreaks.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly integrated into critical applications, making their safety and security paramount. A significant threat is "jailbreaking," where users craft prompts to bypass LLM safety mechanisms and elicit harmful or restricted content. Traditional defenses often rely on reactive, case-by-case patching, which is insufficient against the sophisticated, multi-turn adversarial tactics employed by attackers. These attacks can be subtle and adaptive, evolving as the LLM is updated. The paper addresses the need for a proactive, theoretically grounded defense that can anticipate and neutralize these evolving jailbreak strategies.

Methods

The core of the paper is a dynamic Stackelberg game-theoretic framework. In this framework, the LLM acts as the leader (Defender) and the prompt engineer as the follower (Attacker). The interaction is modeled as an extensive-form game, where the defender commits to a safety policy, anticipating the attacker's best response.

To handle the immense complexity of natural language prompts, the authors integrate Rapidly-exploring Random Trees (RRT). RRT is used for two purposes:

  1. Attacker Simulation ("Thinking Red"): RRT explores the prompt space to discover potential jailbreak trajectories. The LLM acts as a black-box oracle, classifying responses as "Safe," "Redirect," or "Jailbreak."
  2. Defender Strategy ("Acting Blue"): The "Purple Agent" uses the RRT exploration to build a partial game tree. It employs anticipatory blocking by maintaining "risky memory" (prompts that led to actual jailbreaks) and "simulated memory" (prompts that could lead to jailbreaks based on simulations). A local blocking radius (H) is used to prevent the LLM from responding to prompts semantically close to these risky or simulated ones.

The defense strategy aims to achieve a local ε-equilibrium, where the attacker's incentive to deviate from a safe path is bounded, effectively stabilizing the prompt space.

Datasets

Not discussed in the paper. The paper uses an LLM oracle (DeepSeek-V3, Meta-Llama-3.1-70B, Qwen-Plus, and Gemini-2.5-Flash) for evaluation, treating it as a black box.

Key Insights and Ideas

  • Jailbreaking is a strategic, multi-turn game: The paper moves beyond viewing jailbreaks as isolated incidents and frames them as sequential decision-making processes between an attacker and a defender.
  • Stackelberg game for LLM safety: Modeling the LLM as a leader and the attacker as a follower provides a powerful theoretical lens for designing proactive defenses. The leader (LLM) can commit to a policy that anticipates the follower's (attacker's) optimal response.
  • RRT as a dual-purpose tool: Using RRT for both simulating attacker exploration and informing defender blocking is an elegant way to manage the vast prompt space and synchronize defense with attack discovery.
  • "Thinking Red to Act Blue": The Purple Agent's core idea is to internalize the attacker's reasoning (thinking Red) to proactively deploy safety measures (acting Blue), rather than just reacting to detected threats.
  • Local ε-equilibrium as a defense target: The concept of achieving a local equilibrium, where deviations are no longer profitable, provides a concrete metric for defense effectiveness and explains why the defense works.
  • "Fragile Safety" is a common LLM vulnerability: The paper suggests that many LLMs exhibit "Fragile Safety" regions, where a prompt is technically safe, but nearby prompts can easily lead to jailbreaks, highlighting a fundamental challenge in LLM alignment.

Key Results

  • Significant Reduction in Jailbreaks: The Purple Agent defense reduced successful jailbreaks by approximately 50% compared to attacker-only exploration (e.g., from 79.0% to 39.4% for Reward-Guided RRT at 200 rounds on DeepSeek-V3).
  • High Defensive Precision: This reduction was achieved with a low number of simulated blocks (around 9.6 per run), indicating targeted and efficient defense rather than broad, usability-degrading restrictions.
  • Robustness Across Models: The defense demonstrated strong transferability, effectively mitigating jailbreaks across different LLMs (DeepSeek-V3, Llama-3.1-70B, Qwen-Plus, Gemini-2.5-Flash) without model-specific fine-tuning.
  • Stabilization of Prompt Space: t-SNE visualizations showed a transition from dense, continuous jailbreak clusters (Regime I/II) to sparse, isolated points (Regime III) after Purple Agent defense, visually confirming the achievement of robust local equilibrium.

Limitations and Future Work

  • Computational Intractability: While RRT helps, fully specifying the game tree is still computationally intractable for unbounded prompt spaces. The current approach relies on constructing a partial game tree.
  • Blocking Radius Tuning: The blocking radius (H) is a parameter that needs to be set. While the paper suggests a value (0.35) that works well, its optimal tuning might be task-dependent.
  • Future Work: The authors suggest extending the framework to stochastic and multi-agent settings. They also propose using the equilibrium gap to guide targeted adversarial training and robust policy refinement.

Summary updated

BibTeX
@inproceedings{han2026toward,
  author = {Zhengye Han and Quanyan Zhu},
  title = {{Toward a Dynamic Stackelberg Game-Theoretic Framework for Agentic AI Defense Against LLM Jailbreaking}},
  booktitle = {AIMS @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=w9Ccv7dzHX},
}
Figure