월~금 오전 7시, 일요일 오전 8시 — AI 뉴스와 용어를 보내드립니다메일로 받아보기

METAL LAB

AI 에이전트를 속이는 공격을 학습이 아니라 '전략 노트'로 계속 강해지게 만드는 레드팀 시스템

arXiv:2608.051082026-08-04

Agent Against Agent: An Agentic System for Automatic Prompt Injection Red Teaming

AI 에이전트를 속이는 공격을 학습이 아니라 '전략 노트'로 계속 강해지게 만드는 레드팀 시스템

PIMiner는 LLM 에이전트에 악성 지시를 몰래 심는 '프롬프트 인젝션' 공격을 자동으로 찾아내는 시스템이다. 강화학습으로 공격 모델을 새로 훈련하는 대신, 공격 경험을 마크다운 전략 파일로 축적해 새로운 대상 모델에도 재훈련 없이 그대로 적용한다. IPIArena와 AgentDojo 벤치마크에서 강화학습 기반 최신 기법과 맞먹는 공격 성공률을 보였다.

METAL LAB 해설 도표

PIMiner의 4단계 공격-학습 파이프라인

증거 상태측정 결과가 보고됨

  1. 전략 라우터새 샘플이 들어오면 방대한 전략 라이브러리 전체 대신 관련도 높은 상위 K개 전략 파일만 골라 공격 모델에 전달해 비용을 줄인다
  2. 반복 공격 모듈장기 전략, 같은 데이터셋 내 이전 샘플들의 경험, 현재 샘플의 이전 시도 기록 세 가지 기억을 참고해 최대 10회까지 인젝션 프롬프트를 반복 개선한다
  3. 경험 정리기(digester)성공·실패한 공격들을 메커니즘별로 분석해 기존 전략을 다듬거나 새 전략 파일을 만들어 라이브러리를 갱신한다
  4. 전략 라이브러리대상 LLM 범위, 적용 가능한 작업 범위, 인젝션 템플릿, 성공 예시, 실패 조건을 담은 마크다운 파일 묶음으로, 새 대상 모델에도 재훈련 없이 그대로 옮겨 쓸 수 있다
  5. 결과IPIArena·AgentDojo·InjecAgent에서 RL 기반 최신 기법과 맞먹는 공격 성공률을 재훈련 없이 달성했다
METAL LAB이 원문을 바탕으로 재구성한 해설 도표이며, 논문 저자의 원문 figure가 아닙니다.

무엇을 했나

  1. 프롬프트 인젝션은 웹페이지, 검색 결과, 도구 응답 같은 신뢰할 수 없는 텍스트에 악성 지시를 숨겨 AI 에이전트가 원래 목적과 다른 행동을 하게 만드는 공격이다. 이를 미리 찾아내는 '레드팀' 작업은 방어책을 만드는 데 필수적이다.
  2. 기존 방식은 크게 두 갈래다. 강화학습(RL) 기반은 공격 성능은 좋지만 훈련에 수만 번의 질의가 필요하고 새로운 대상 모델로는 잘 옮겨가지 못한다. 탐색 기반(PAIR, TAP 등)은 매번 새 샘플마다 처음부터 다시 시도해서 이전 경험을 재사용하지 못해 성능이 떨어진다.
  3. PIMiner는 이 둘의 장점을 합친다. 전략 라우터, 반복 공격 모듈, 경험 정리기(digester)로 구성되며, 성공한 공격 방식을 전략 라이브러리(마크다운 파일 묶음)에 저장해 다음 공격에 재사용한다. 기억은 세 층으로 나뉜다: 여러 데이터셋과 모델에 걸친 장기 전략 라이브러리, 같은 데이터셋 안에서의 중기 경험, 지금 공격 중인 샘플의 직전 시도 기록.
  4. 라우터는 방대해진 전략 라이브러리 전체를 매번 불러오는 대신 관련 있는 상위 K개 전략만 골라 공격 모델에 전달해 비용을 줄인다. 실험에서 라우터는 입력 길이를 43~61% 줄이면서도 공격 성공률은 거의 그대로 유지하거나 오히려 높였다.
  5. IPIArena와 AgentDojo에서 9개 최신 LLM(GPT, Claude, Gemini, DeepSeek 계열)을 대상으로 평가한 결과, PIMiner는 Gemini-2.5-Pro에 대해 IPIArena 76.2%, AgentDojo 86.7%의 공격 성공률을 기록했고, InjecAgent 벤치마크에서는 최신 RL 기반 기법(RL-Hammer, PISmith)과 동일한 성공률(ASR 1.0)을 보였다.
Figure 1: PIMiner Pipeline. Given a dataset–model pair, PIMiner routes each sample to the most relevant strategies, performs iterative attack optimization, and then digests the resulting experiences to update its strategy library. During iterative attack optimization, an intra-dataset memory is maintained to facilitate knowledge sharing across samples within the same dataset.
Figure 1: PIMiner Pipeline. Given a dataset–model pair, PIMiner routes each sample to the most relevant strategies, performs iterative attack optimization, and then digests the resulting experiences to update its strategy library. During iterative attack optimization, an intra-dataset memory is maintained to facilitate knowledge sharing across samples within the same dataset.
Table 1: ASRs on InjecAgent. RL-based attacks and our PIMiner report ASR@10. Bold: best per row.
StaticSearch-BasedRL-BasedAgent-Based
ModelDirectEnhancedTAPPAIRStrategyGRPORL-Ham.PISmithPIMiner
GPT-4o-mini0.020.030.400.240.380.601.01.01.0
GPT-4.1-nano0.010.020.540.320.650.751.01.01.0
GPT-5-nano0.000.000.080.010.180.240.961.01.0
Figure 2: Evaluation of PIMiner on 9 frontier LLMs on IPIArena [23] and AgentDojo [5]. We report ASR@​1, ASR@​5, and ASR@​10.
Figure 2: Evaluation of PIMiner on 9 frontier LLMs on IPIArena [23] and AgentDojo [5]. We report ASR@​1, ASR@​5, and ASR@​10.
Table 2: ASRs on AgentDojo. PISmith and our PIMiner report ASR@10. Bold: best per row.
ModelDirectIgnore Prev.Sys. MsgInjecagentTool Know.Imp. Instr.PISmithPIMiner
GPT-4o-mini0.030.060.030.040.120.230.780.73
GPT-4.1-nano0.040.130.040.050.200.200.810.63
GPT-5-nano0.020.000.010.000.010.010.380.53
((b))
((b))
Table 3: Composition of the PIMiner training and test sets by domain. These datasets are randomly sampled.
BenchmarkDomain# Train# Test
AgentDojoBanking14
Slack33
Travel66
Workspace1017
Total2030
IPIArenaTool711
Browser35
Coding105
Total2021
Figure 4: The strategy library learned by PIMiner improves attack performance for a wide range of attacker LLMs.
Figure 4: The strategy library learned by PIMiner improves attack performance for a wide range of attacker LLMs.
Table 4: Structure of a PIMiner strategy file, which is specified in _TEMPLATE.md. The last column marks the primary consumer: Router, Attacker, or Digester.
SectionDescriptionConsumer
Title & introOne-line file description plus a 2–4 sentence summary of the attack mechanism, the target task domains it lands on, and how it differs from sibling strategies.A/D
Target-LLM scopePer-target verdicts: confirmed-effective, likely-effective, and not-shown-to-transfer (with run-dir citations), plus a one-line “use when” predicate.R/A/D
Task scopeWhich suites, injection-goal verbs (send_*, schedule_*, …), placeholder surface, and prerequisite conditions the strategy is known to apply to.R/A/D
Mechanism distinction2–5 sentences contrasting the core structural move against each named sibling strategy, so the router can disambiguate superficially similar options.A/D
Strategy templateThe abstract recipe: numbered, named structural moves (not surface text) that every in-context example instantiates.A/D
In-context examplesOne block per confirmed hit: verbatim user task, injection goal, full polluted placeholder context, winning injection text, resulting tool call, and why it worked.R/A/D
Fingerprint tableA compact, one-row-per-example view of the in-context examplesA/D
Failure conditionsDocumented structural failure conditions (not “model refused”), and where possible cite a run-dir / sample that demonstrated the failure, used to steer miss-pattern analysis.A/D
Iterative-attack init notesSeed guidance for the inner attacker: iter-0 framing, iter-to-iter escalation, and failure-mode pivots.A/D
Figure 5: Comparison of PIMiner with and without the router, in terms of the attacker agent’s average input length (a) and the resulting ASR (b).
Figure 5: Comparison of PIMiner with and without the router, in terms of the attacker agent’s average input length (a) and the resulting ASR (b).
Table 5: Prompt-injection strategies learned by PIMiner.
StrategyDescription
Fabricated Procedure GateImpersonates an authoritative website or system protocol that presents the malicious tool call as a mandatory prerequisite before the agent can proceed.
Forged Chat TurnInjects role-delimiter tokens to terminate the tool-output turn and fabricate a new user turn, causing the target to interpret the attacker’s directive as a legitimate user instruction.
Entity Data PoisoningEmbeds the attacker’s payload within a field explicitly requested by the user, making the malicious string load-bearing and encouraging provenance-aware models to reproduce it as part of an otherwise correct response.
Authenticated-Principal Voice ForgeFabricates a continuation message from an already authenticated principal (or from the user), allowing the malicious directive to inherit an authority chain the target already trusts.
Appended Output DirectiveAppends a forged “required answer format” instruction that coerces the model into emitting an attacker-chosen sentence in its final response.
Authority-Shed DocstringDisguises the malicious payload as a structural element of the code (e.g., a docstring or helper definition) rather than an instruction, encouraging the model to treat it as inert program content instead of executable guidance.
False-History ForgeFabricates an entire interaction history (user → assistant tool call → tool failure → user retry), framing the malicious tool invocation as a continuation of a previously authorized workflow rather than a new authorization request.
((b))
((b))
Table 6: An estimate of the training-phase cost. With access to a Claude Code subscription plan, the out-of-pocket cost for model API usage is approximately $20. In (M) and Out (M) denote the numbers of input and output tokens, respectively, measured in millions of tokens. For the attacker agent, In (M) is estimated based on the total number of input tokens, approximately 80% of which are cache hits.
ComponentModelIn (M)Out (M)Est. Cost ($)Use Claude Code
AttackerOpus 4.7∼78.0∼1.60∼115Yes
RouterOpus 4.7∼0.8∼0.08∼7Yes
DigesterOpus 4.7∼0.48∼0.12∼5Yes
Target LLMmixed∼7.9∼0.65∼20No
Figure 6: Distribution of in-context examples from the seven distinct attack strategies across different target LLMs.
Figure 6: Distribution of in-context examples from the seven distinct attack strategies across different target LLMs.

실제로 확인된 결과

  • IPIArena에서 Gemini-2.5-Pro 대상 76.2%, GPT-5.1 대상 61.9%, Claude-Sonnet-4.5 대상 42.9% 공격 성공률(ASR@10)을 기록했다.
  • AgentDojo에서 Gemini-2.5-Pro 대상 86.7%, GPT-5.1 대상 53.3%, Claude-Sonnet-4.5 대상 40.0% 공격 성공률을 기록했다. 반면 Claude-Opus-4.5는 IPIArena 4.8%, AgentDojo 3.3%로 가장 강한 방어력을 보였다.
  • InjecAgent 벤치마크에서 PIMiner는 GPT-4o-mini, GPT-4.1-nano, GPT-5-nano 세 모델 모두에서 ASR 1.0을 기록해 최고 성능의 RL 기반 기법(RL-Hammer, PISmith)과 동일했다. 반면 탐색 기반 PAIR와 TAP는 GPT-5-nano에서 각각 1%, 8%에 그쳤다.
  • AgentDojo에서 PIMiner는 GPT-5-nano에서 PISmith보다 높은 성공률(53% vs 38%)을 보였고, GPT-4o-mini에서는 비슷했으나(73% vs 78%) GPT-4.1-nano에서는 다소 낮았다(63% vs 81%). 단 PISmith는 대상 모델마다 별도 훈련이 필요한 반면 PIMiner는 훈련에 쓰이지 않은 모델에도 그대로 적용됐다.
  • 라우터를 빼면 공격 모델의 입력 길이가 Claude-Haiku-4.5에서 43%, Claude-Sonnet-4.6에서 61% 늘어났지만, 라우터를 넣었을 때 성공률은 거의 유지되거나(1.2% 감소) 오히려 향상됐다(7.5% 증가). 장기 전략 라이브러리와 중기(데이터셋 내) 기억을 모두 사용했을 때 기본 반복 공격 대비 평균 성공률이 17.8~19.8%p 높아졌다.

어디에 쓸 수 있나

  • 배포 전 AI 에이전트의 프롬프트 인젝션 취약점을 낮은 비용으로 점검하는 보안 평가 도구
  • 방어용 가드레일 모델이나 백본 LLM을 훈련시키기 위한 고품질 공격 데이터 수집
  • 새로운 대상 모델이 나올 때마다 공격 모델을 재훈련하지 않고 기존 전략 라이브러리를 재사용하는 반복적 레드팀 운영
  • 제한된 질의 횟수(샘플당 최대 10회)로만 대상 모델을 시험해야 하는 블랙박스 평가 상황

한계와 남은 검증

  • Claude-Opus-4.5처럼 방어력이 매우 강한 모델에는 여전히 공격 성공률이 낮아(4.8%, 3.3%) 모든 모델에 균일하게 통하지는 않는다.
  • 훈련 단계에서는 대상 에이전트의 중간 출력까지 관찰할 수 있는 그레이박스 접근을 가정하는데, 이는 오픈소스이거나 중간 과정을 공개하는 에이전트에서만 현실적인 가정이다.
  • 전략 라이브러리 안의 일부 전략(예: Authority Shed Docstring, False History Forge)은 예시가 1개뿐이라 특정 모델에만 국한된 것일 수 있고, 얼마나 더 일반화되는지는 추가 검증이 필요하다.
  • 평가는 IPIArena, AgentDojo, InjecAgent라는 특정 벤치마크와 훈련에 쓰인 8개 데이터셋-모델 조합에 한정되어 있어, 전혀 다른 유형의 에이전트나 작업 도메인에서의 성능은 확인되지 않았다.
  • 논문은 Claude Code 구독 요금제를 전제로 훈련 비용을 약 20달러로 추정했는데, 이런 구독 없이 API만 사용할 경우 비용 구조가 달라질 수 있다.

왜 중요한가

회사들이 자사 AI 에이전트를 배포하기 전에 보안 취약점을 점검하고 방어 모델 학습용 데이터를 모으는 작업은 반드시 필요한데, 기존 방식은 비용이 크고 새 모델마다 다시 훈련해야 했다. PIMiner처럼 경험을 재사용 가능한 지식으로 축적하는 방식은 훨씬 적은 비용으로 더 많은 모델을 점검할 수 있게 해준다.

이 논문의 용어

  • 프롬프트 인젝션 · 웹페이지나 도구 응답 같은 외부 텍스트에 악성 지시를 몰래 심어 AI 에이전트를 조종하는 공격
  • 레드팀 · 시스템의 취약점을 미리 찾아내기 위해 공격자 역할을 자처해 시험하는 활동
  • 강화학습(RL) 기반 공격 · 보상 신호로 공격 모델을 반복 훈련시켜 점점 더 효과적인 공격을 만들어내는 방식
  • ASR(공격 성공률) · 시도한 공격 중 실제로 성공한 비율을 나타내는 지표, ASR@N은 N번 시도 안에 한 번이라도 성공하면 성공으로 친다
  • 전략 라이브러리 · 성공한 공격 패턴, 적용 조건, 예시를 마크다운 파일로 정리해 두고 재사용하는 지식 저장소

저자 · Yanting Wang

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL LAB 최신 기사

그림 출처: Yanting Wang et al., arXiv:2608.05108, CC BY 4.0