RoguePrompt: 이중 인코딩 자기복원 프롬프트로 LLM 모더레이션 우회하기
RoguePrompt: Dual-Layer Encoding for Self-Reconstruction to Circumvent LLM Moderation
TL;DR Highlight
이중 인코딩 프롬프트로 3개 모델에서 실행 70.18%, 입력 필터 통과 93.93% 달성
Who Should Read
LLM 입력 필터와 모더레이션을 붙여 서비스를 운영하면서 인코딩·난독화 우회 공격이 걱정되는 백엔드 개발자
Core Mechanics
- 프롬프트를 쪼개고 두 번 암호화한다
- 금지 요청을 짝수·홀수 단어 묶음으로 나눈다.
- 홀수 쪽은 Vigenère(키 반복 암호)로 암호화하고, 전체를 ROT13(알파벳 13칸 밀기)으로 한 번 더 감싼다.
- 모델이 한 번의 응답에서 풀고 합치고 실행하도록 평문 지시문을 붙인다.
- 통과·복원·실행을 따로 쟀다
- 기존 평가는 최종 응답이 유해한지만 봤다.
- 이 논문은 입력 통과(Bypass), 복원(Reconstruction), 실행(Execution)을 단계별로 나눠 측정했다.
- 어느 단계에서 막혔는지 보여 주는 게 방어 쪽 가치다.
- 3회 시도 중 한 번이라도 성공하면 성공으로 쳤다
- 같은 프롬프트를 독립적으로 3번 보냈다.
- RoguePrompt는 Bypass@3 93.93%, Reconstruction@3 79.02%, Execution@3 70.18%였다.
- Base64는 풀어도 실행은 안 한다
- Base64 Raw는 복원 93.29%로 높다.
- 하지만 실행은 16.83%뿐이고, 실패의 88.35%가 복원 후 거절이었다.
- 복원이나 입력 통과만 보면 방어 수준을 잘못 읽는다.
Evidence
- RoguePrompt의 실행률이 가장 높았다
- StrongREJECT 313개 프롬프트, GPT-4o·Claude 3 Opus·Gemini 1.5 Pro 평균 기준이다.
- Execution@3는 70.18%로, 차순위 Paired-Request Concatenation 33.97%의 약 2배다.
- 모델별로도 순위가 같았다
- Execution@3는 Gemini 1.5 Pro 66.13%, GPT-4o 71.25%, Claude 3 Opus 73.16%였다.
- Bypass@3는 90.10~97.13%였다.
- 다른 베이스라인은 단계별로 다르게 실패했다
- Disemvowel은 Bypass@3 3.09%, Execution@3 2.13%였고 실패의 99.02%가 입력 차단이었다.
- Auto Payload Splitting은 복원 76.36%에 실행 12.99%였다.
- PAP(Authority Endorsement)는 실행 25.13%였다.
- 카테고리에 따라 실행률이 달랐다
- 성적 콘텐츠 90.00%와 허위정보 87.33%가 높았다.
- 비폭력 범죄 49.15%와 불법 상품·서비스 51.33%가 낮았다.
- Bypass@3는 91.36~96.67%로 비슷했다.
How to Apply
- 서비스 로그에서 ROT13·Base64 패턴을 찾아보기
- 오늘 최근 프롬프트 로그에 ROT13·Base64 디코드, 조각 합치기, 키 지시가 같이 들어간 입력이 있는지 정규식으로 검색해라.
- 인코딩 문자열과 '풀어서 실행해' 지시가 함께 있으면 플래그를 단다.
- 디코딩 후 재검사 단계 넣기
- 입력 필터는 표면 텍스트만 본다. 흔한 변환(ROT13, Base64)은 서버에서 먼저 풀어 모더레이션을 한 번 더 돌려라.
- 모델이 응답 중에 복원한 내용도 실행 전에 다시 정책 검사해라.
- 모더레이션을 단계별로 평가하기
- 레드팀 테스트에서 차단, 복원, 실행, 복원 후 거절을 따로 라벨링해라.
- 최종 거절률 하나로 보지 말고 어느 레이어를 보강할지 판단해라.
- 출력 모더레이션을 마지막 방어선으로 켜기
- 입력과 모델 거절을 뚫린 경우를 가정하고 응답 전달 직전에 한 번 더 검사해라.
- 인코딩된 다단계 지시를 학습·평가 셋에 넣는 것도 검토 대상에 올려라.
Try It
# 방어 점검용 코드: 로그 속 ROT13·Base64 + 디코드 지시 조합을 찾는다. 파이썬 3 표준 라이브러리만 사용
import re, codecs, base64
DECODE_HINT = re.compile(r"(decode|decrypt|rot13|base64|reverse|interleave|reassemble|key)", re.I)
B64 = re.compile(r"[A-Za-z0-9+/]{24,}={0,2}")
def suspicious(prompt: str) -> bool:
has_hint = bool(DECODE_HINT.search(prompt))
has_b64 = bool(B64.search(prompt))
return has_hint and has_b64
def normalize_views(prompt: str):
views = [prompt, codecs.decode(prompt, 'rot13')]
for m in B64.findall(prompt):
try:
views.append(base64.b64decode(m + '=' * (-len(m) % 4)).decode('utf-8', 'ignore'))
except Exception:
pass
return views
# 사용: 각 view를 기존 모더레이션 함수에 넣어 재검사
# for v in normalize_views({{프롬프트}}): moderate(v)
# 이어서 해 볼 것: 로그 전체에 suspicious()를 돌려 오탐률을 확인한다Terminology
관련 논문
The Judge Can Debias Itself: LLM-as-a-Judge가 스스로 편향을 고치게 하는 법
심사 프롬프트에 편향 경고를 넣거나 스스로 비판시켰더니 21개 중 20개 조합에서 정확도가 올랐다
미국 노동시간의 90%는 AI 벤치마크가 제대로 다루지 못하는 일이다
벤치마크 29개를 직업 과제에 매핑했더니 노동시간 90%가 커버 밖
Postgres 19, AI 코드 리뷰가 버그를 너무 많이 찾아 출시 연기
LLM 코드 리뷰가 버그를 쏟아내 Postgres 19가 11월로 밀리고 기능 8~10개가 빠졌다
StarSkirmish Bench v0.2: LLM이 1시간 만에 짜는 StarCraft 봇 대결
LLM에게 1시간 동안 StarCraft 봇을 짜게 했더니 GPT-6 Astra가 1위
그럴듯한 설명 하나면 멀티모달 LLM 심사위원도 속는다 (JUPE 벤치마크)
정답은 그대로 두고 설명만 붙였더니 MLLM 심사위원의 오답 거절률이 12.7~13.8%p 떨어졌다
신경망은 이미 깔끔하다: polysemanticity의 원인 재해석
뉴런을 직접 들여다봤더니 대부분 한 가지 역할이 있었다는 주장
Linus Torvalds의 첫 LLM 보조 패치 시리즈
Linus가 LLM으로 folio 조회 패치 10개를 만들어 read() 벤치가 10배 빨라졌다
Related Resources
Original Abstract (Expand)
Large language models (LLMs) are becoming increasingly integrated into mainstream development platforms and daily technological workflows, typically behind moderation and safety controls. Despite these controls, preventing prompt-based policy evasion remains challenging, and adversaries continue to "jailbreak" LLMs by crafting prompts that circumvent implemented safety mechanisms. Prior work has established cipher-mediated interaction, code-embedded decryption, prompt decomposition and reconstruction, and layered custom encryption as viable attack primitives. However, reported evaluations generally collapse visible acceptance, successful recovery of the concealed request, and subsequent execution into an aggregate attack-success outcome. This leaves limited evidence about where multistage prompt-transformation attacks fail within an observable black-box interaction. This paper introduces RoguePrompt, a jailbreak pipeline that partitions a forbidden prompt and applies two nested encodings, Vigenere followed by ROT13, along with natural-language reconstruction instructions. RoguePrompt was developed and evaluated under a black-box threat model, with only API or user-interface access to the hosted models, and was tested on 313 real-world, hard-rejected prompts. Success was measured in terms of moderation bypass, instruction reconstruction, and execution when the relevant stage exceeded its automated criterion. RoguePrompt achieved average rates of 93.93% for filter bypass, 79.02% for reconstruction, and 70.18% for execution. These results demonstrate the effectiveness of layered prompt encoding while providing stage-level evidence of where multistage jailbreaks fail during moderation bypass, instruction reconstruction, and execution.