건초 더미 속의 탈옥
Jailbreaking in the Haystack
November 5, 2025
저자: Rishi Rajesh Shah, Chen Henry Wu, Shashwat Saxena, Ziqian Zhong, Alexander Robey, Aditi Raghunathan
cs.AI
초록
최근 장문맥 언어 모델(LM)의 발전으로 100만 토큰 단위의 입력이 가능해지며 컴퓨터 사용 에이전트와 같은 복잡한 작업에서의 성능이 확장되고 있습니다. 그러나 이러한 확장된 맥락이 안전성에 미치는 영향은 여전히 불분명합니다. 이러한 간극을 메우기 위해 우리는 정렬된 LM을 우회 공격하는 방법인 NINJA(Needle-in-haystack jailbreak attack의 약어)를 소개합니다. 이는 유해한 사용자 목표에 모델이 생성한 무해한 콘텐츠를 추가하는 방식입니다. 우리 방법의 핵심은 유해한 목표의 위치가 안전성에 중요한 역할을 한다는 관찰에 기반합니다. 표준 안전성 벤치마크인 HarmBench에서의 실험 결과, NINJA가 LLaMA, Qwen, Mistral, Gemini를 포함한 최첨단 오픈 소스 및 독점 모델들에서 공격 성공률을 크게 높이는 것으로 나타났습니다. 기존 우회 공격 방법과 달리 우리의 접근법은 낮은 자원을 요구하며, 이전 가능하고 탐지되기 어렵습니다. 더 나아가 NINJA는 컴퓨팅 최적화된 방식입니다. 고정된 컴퓨팅 예산 하에서 맥락 길이를 증가시키는 것이 N-최선 우회 공격(best-of-N jailbreak)에서 시행 횟수를 증가시키는 것보다 더 나은 성능을 보였습니다. 이러한 결과는 신중한 목표 배치로 구성된 무해한 장문맥 조차도 현대 LM에 근본적인 취약점을 야기할 수 있음을 보여줍니다.
English
Recent advances in long-context language models (LMs) have enabled
million-token inputs, expanding their capabilities across complex tasks like
computer-use agents. Yet, the safety implications of these extended contexts
remain unclear. To bridge this gap, we introduce NINJA (short for
Needle-in-haystack jailbreak attack), a method that jailbreaks aligned LMs by
appending benign, model-generated content to harmful user goals. Critical to
our method is the observation that the position of harmful goals play an
important role in safety. Experiments on standard safety benchmark, HarmBench,
show that NINJA significantly increases attack success rates across
state-of-the-art open and proprietary models, including LLaMA, Qwen, Mistral,
and Gemini. Unlike prior jailbreaking methods, our approach is low-resource,
transferable, and less detectable. Moreover, we show that NINJA is
compute-optimal -- under a fixed compute budget, increasing context length can
outperform increasing the number of trials in best-of-N jailbreak. These
findings reveal that even benign long contexts -- when crafted with careful
goal positioning -- introduce fundamental vulnerabilities in modern LMs.