cs.CRDec 10, 2024

DYNASHIELD: A Black-Box Moving Target Defense for LLMs via Dynamic Decoding Customization

Authors: Xiaoqun Liu, Weiming Qi, Qiben Yan

Organizations: Michigan State University, East Lansing, MI 48824, USA

Abstract

Large language models (LLMs) remain vulnerable to jailbreak attacks in which adversarial prompts induce harmful outputs. Existing defenses often require access to the model internals or additional training, limiting their applicability for service providers deployed through black-box APIs. In this paper, we propose DYNASHIELD, a moving target defense framework that improves robustness by customizing decoding hyperparameters and system prompts at inference time. DYNASHIELD includes two key steps: (1) it identifies decoding configurations that reduce attack success probability, and (2) it probabilistically samples from a weighted configuration pool to introduce controlled variability in model behavior. We evaluate DYNASHIELD across 7 open-source LLMs under 4 state-of-the-art jailbreak attacks, using adversarial prompts from AdvBench. Results show substantial reductions in attack success rate compared with 7 baseline defenses, while maintaining response quality and incurring minimal inference overhead. Because DYNASHIELD operates solely through exposed runtime controls, it requires no retraining or model-internal access. These results suggest that safety-aware dynamic decoding is a promising and practically lightweight defense mechanism for black-box LLM deployments.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Automated jailbreak attack targeting multiple defense strategies

    Jun 15, 2026Qi Wang, Chengcheng Wan, Weijia He +4Adversarial Prompt GenerationLLM Jailbreak Attacks

  2. Dynamic Deep Prompt Optimization for Defending Against Jailbreak Attacks on LLMs

    Aug 10, 2026Doniyorkhon Obidov, Honggang Yu, Xiaolong Guo +1Jailbreak DefenseLLM Safety

  3. LASH: Adaptive Semantic Hybridization for Black-Box Jailbreaking of Large Language Models

    May 20, 2026Abdullah Al Nomaan Nafi, Fnu Suya, Swarup Bhunia +1Adversarial Prompt GenerationLLM Jailbreak Attacks