arXiv(opens in a new tab)cs.CRAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.26008

A Self-Evolving Multi-Agent Framework Defense against LLM Jailbreak Attacks

Tongyan Hu, Bryan Hooi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language models (LLMs) remain vulnerable to jailbreak attacks that exploit techniques such as role-playing, obfuscation, code transformation, and multi-step indirection to elicit harmful outputs. As jailbreak strategies keep emerging, defenses have proliferated in an ongoing cat-and-mouse game, yet most remain static: their safety behavior is fixed at deployment, so they cannot accumulate defensive experience or adapt to unseen strategies. We propose a self-evolving test-time defense built around a persistent, cross-interaction rule memory: when an attack succeeds, the framework abstracts that failure into a method-level rule capturing the structural attack wrapper rather than the harmful topic, and reuses it against future inputs. Because rules are method-level, one induced rule generalizes across an entire attack family, and the label space expands as novel wrappers appear. The mechanism operates entirely through external memory and prompting, with no parameter updates, and applies to both open-weight and black-box API models. We realize it as four cooperating modules, but the contribution is the memory-based adaptation mechanism, not the module decomposition. Across four black-box jailbreak families and multiple models, our method substantially reduces attack success rates while preserving benign utility, remains robust under an adaptive composite-wrapper attack, and does not increase over-refusal as the memory grows.

1 Introduction

Large language models (LLMs) (OpenAI et al., 2024; Dubey et al., 2024; Yang et al., 2025; Anil et al., 2023) have demonstrated strong capabilities across a wide range of tasks but remain vulnerable to jailbreak attacks that elicit harmful or policy-violating outputs. These attacks (Zou et al., 2023; Li et al., 2024; Ding et al., 2024; Jiang et al., 2024; Liu et al., 2024b; Zhu et al., 2023; Qin et al., 2022; Yu et al., 2023; Yuan et al., 2023; Wei et al., 2024a; Chao et al., 2023; Mehrotra et al., 2023; Liu et al., 2024c, 2025) often exploit the model's instruction-following nature through various attacking techniques, allowing malicious intent to be hidden within seemingly benign prompts. As new attack strategies continuously emerge, designing robust and adaptive defenses remains a significant challenge.

Existing approaches to LLM safety primarily rely on static alignment or filtering mechanisms, including fixed system prompts, supervised safety fine-tuning, preference-based alignment methods such as Reinforcement Learning from Human Feedback (RLHF), and external safety classifiers (Bai et al., 2022; Xu et al., 2024b; Zheng et al., 2024; Ge et al., 2023; Xu et al., 2024a). While these methods can be effective against known attack patterns, they are fundamentally limited by their static nature. In particular, these approaches encode safety behaviors into fixed parameters, prompts, or classifiers that do not change during inference. As a result, they lack the ability to adapt to newly emerging jailbreak strategies, especially those that are compositional, obfuscated, or outside the training distribution. As attack techniques continue to evolve rapidly, adversaries can exploit previously unseen patterns to bypass existing defenses. This mismatch between evolving attacks and static defenses exposes a critical limitation: current safety mechanisms do not accumulate defensive experience over time, nor can they update their behavior based on past failures. Consequently, they remain vulnerable to repeated jailbreaks whenever a novel attack strategy appears.

To address this limitation, we propose a self-evolving test-time defense centered on a persistent, cross-interaction rule memory. Rather than assuming the model can already defend against all previously unseen jailbreak strategies, our frame-

∗^{*}Corresponding author.

work learns from its own failures during inference: when an attack succeeds, it abstracts that failure into a reusable defense rule and applies it to future inputs. Crucially, each rule captures the structural attack wrapper (e.g., nested role-play, code-based obfuscation) rather than the harmful topic, so a single rule induced from one instance generalizes across an entire attack family, and the set of attack labels expands automatically as structurally novel wrappers are encountered. All adaptation occurs through this external memory rather than through parameter updates, making the framework directly applicable to both open-weight and black-box API models where white-box defenses are inapplicable.

Concretely, given an input and the model’s response, a reflection step analyzes the interaction, detects whether the attack succeeded, and, if so, distills the underlying attack wrapper into a structured rule stored in the persistent memory. A dynamic rule-triggering mechanism then selectively activates only the rules most relevant to the current input’s inferred attack pattern, rather than naively appending all learned rules, enabling precise safety control with minimal interference on benign queries. An adaptive policy decision determines whether to issue a strict refusal or a constrained safe response, balancing safety and utility.

Unlike prior self-reflection defenses, which use feedback only transiently to revise the current output, and prior multi-agent defenses, which treat each interaction independently and accumulate no cross-interaction knowledge, our framework converts each failure into persistent, reusable defense knowledge. The contribution should therefore be understood at the mechanism level — a persistent, self-evolving rule memory with selective triggering — rather than as the particular decomposition into prompted modules.

We evaluate the framework across four black-box jailbreak families and multiple open- and closed-source models. Our method substantially reduces attack success rates while preserving benign-task utility, and a self-evolving analysis shows robustness improving as the memory accumulates over the interaction stream. We further show that it remains robust under an adaptive composite-wrapper attack designed to evade rule triggering, and that it does not increase over-refusal on benign prompts as the memory grows.

Our contributions are summarized as follows:

• We propose a self-evolving test-time defense centered on a persistent, cross-interaction rule memory that converts observed jailbreak failures into reusable, method-level defense rules, enabling continual adaptation without any parameter updates.

• We design a dynamic rule-triggering mechanism that abstracts attacks at the wrapper level, so that a single induced rule generalizes across an attack family, with an automatically expanding label space for structurally novel attacks.

• We show, across four jailbreak families and both open- and closed-source models, that the framework substantially reduces attack success rates while preserving benign utility, remains robust under an adaptive composite-wrapper attack, and does not amplify over-refusal as the memory grows.

References (1)

  • I'm sorry, but I can't assist with that