Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks

Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion

arXiv:2404.02151 · 2026-07-27 공개 · arXiv · PDF

in-context-learning llm-safety adaptive-attacks prompt-templates trojan-detection random-search model-vulnerability jailbreakbench

Abstract

We show that even the most recent safety-aligned LLMs are not robust to simple adaptive jailbreaking attacks. First, we demonstrate how to successfully leverage access to logprobs for jailbreaking: we initially design an adversarial prompt template (sometimes adapted to the target LLM), and then we apply random search on a suffix to maximize a target logprob (e.g., of the token"Sure"), potentially with multiple restarts. In this way, we achieve 100% attack success rate -- according to GPT-4 as a judge -- on Vicuna-13B, Mistral-7B, Phi-3-Mini, Nemotron-4-340B, Llama-2-Chat-7B/13B/70B, Llama-3-Instruct-8B, Gemma-7B, GPT-3.5, GPT-4o, and R2D2 from HarmBench that was adversarially trained against the GCG attack. We also show how to jailbreak all Claude models -- that do not expose logprobs -- via either a transfer or prefilling attack with a 100% success rate. In addition, we show how to use random search on a restricted set of tokens for finding trojan strings in poisoned models -- a task that shares many similarities with jailbreaking -- which is the algorithm that brought us the first place in the SaTML'24 Trojan Detection Competition. The common theme behind these attacks is that adaptivity is crucial: different models are vulnerable to different prompting templates (e.g., R2D2 is very sensitive to in-context learning prompts), some models have unique vulnerabilities based on their APIs (e.g., prefilling for Claude), and in some settings, it is crucial to restrict the token search space based on prior knowledge (e.g., for trojan detection). For reproducibility purposes, we provide the code, logs, and jailbreak artifacts in the JailbreakBench format at https://github.com/tml-epfl/llm-adaptive-attacks.

한국어 요약

한 줄 요약

최신 안전 정렬된 LLM도 간단한 적응형 공격으로 제한 해제가 가능하다는 것을 보여준다.

핵심 기여도

핵심 아이디어

기존 연구는 대부분 기울기 정보나 보조 LLM을 필요로 했으나, 본 연구는 **로그확률에 기반한 랜덤 탐색(Random Search, RS)**을 사용하여 공격을 단순화하고, 모델에 따라 **적응형 템플릿**을 설계함으로써 공격 성능을 극대화했다. 예를 들어, R2D2는 **in-context learning 템플릿**에 매우 민감하며, Claude는 **API 기반 프리필 공격**이 효과적이다. 또한, **Trojan 탐지**와 유사한 문제를 해결하기 위해 토큰 탐색 공간을 제한한 RS를 사용하여 성능을 높였다. 이는 공격의 **적응성(adaptivity)**이 핵심이라는 통찰을 제공한다.

기술적 접근법

주요 결과

의의 및 한계

본 연구는 **안전 정렬된 LLM이 적응형 공격에 취약하다는 사실**을 입증하며, 기존 방어 메커니즘의 한계를 드러낸다. 특히, **모델별 취약점이 다름**으로 인해 단일 공격 방법이 모든 모델에 일반화되지 않음을 보여준다. 그러나, **공격 템플릿 설계**는 모델에 따라 수동 조정이 필요하며, **API 제약**이 있는 모델에는 특정 공격 방식만 적용 가능하다는 한계가 있다. 또한, **GPT-4 판단자**는 일부 모델에 대해 **오기**(false positive)를 보일 수 있다.

실용적 활용

본 연구는 **LLM의 안전성 평가 프레임워크 개선**, **적응형 공격 방어 기술 개발**, **모델 취약점 분석** 등에 활용 가능하다. 특히, **보안 연구자**와 **LLM 개발자**가 모델의 실제 취약점을 이해하고, **더 강력한 방어 전략**을 설계하는 데 기여할 수 있다.