Skip to content
IAM Insights

Briefing · Paper · source · updated · Boston Identity

A line hidden in a product review made GPT-4 agents obey an attacker 24% of the time, 47% with a forceful opener

InjecAgent, from four University of Illinois researchers and published at ACL 2024, was the first benchmark of agents that read tool output an attacker can edit, such as reviews, emails and notes. Over 1,054 cases, a prompted GPT-4 agent followed the planted instruction 24% of the time, and 47% when it opened with "Ignore all previous instructions". The models are from 2023 and early 2024, so the numbers are a baseline, not today's rate.

arXiv (ACL 2024 Findings) · Qiusi Zhan, Zhixiang Liang, Zifan Ying, Daniel Kang · March 5, 2024 · read

share
2 findings4 sectionsAI trustAgentic identity
17,722 words. With Qiusi Zhan, author, University of Illinois Urbana-Champaign; Zhixiang Liang, author, University of Illinois Urbana-Champaign; Zifan Ying, author, University of Illinois Urbana-Champaign; Daniel Kang, author, University of Illinois Urbana-Champaign.
01

What's happening

Finding2
BI-FIND-2024-0001Lead finding

A GPT-4 agent obeyed an attacker's instruction hidden in a tool's output in 23.6% of 1,054 cases, and in 47.0% when it said to ignore all previous instructions.

When an attacker's instruction sat inside content a tool returned, such as a product review, an email or a note, a GPT-4 agent run with a standard ReAct prompt carried it out in 23.6% of 1,054 cases, and in 47.0% when the instruction opened with an "IMPORTANT!!! Ignore all previous instructions" line. The prompt already told the agent to ask the user before risky tool calls. Llama2-70B followed it in 86.9% of the runs where it produced valid output, though that was under half of its runs. What the agent happened to read was more strongly tied to success than what the attacker asked for, and the authors' probable explanation is that fields allowing more free-form content let the instruction blend in.

high confidencebest source: independent researchobserved Mar 2024 – Jun 2024EvidenceBenchmark designSection 2Section 3
Also reported in +1 briefing
flag a problem with BI-FIND-2024-0001
BI-FIND-2024-0002

Fine-tuned for function calling, GPT-4 followed the planted instruction 6.6% of the time, against 23.6% for the prompted version.

Fine-tuning helped: GPT-4 trained for function calling followed the planted instruction 6.6% of the time, and 7.1% with the hacking prefix, against 23.6% and 47.0% for the prompted version. Among agents that produced valid output more than half the time, Claude-2 was the only one whose rate fell under the hacking prefix, from 11.4% to 3.4%; the authors' hypothesis is that it refused more often, citing the need for the user's confirmation. The paper tests no defence of its own, and every model in it dates from 2023 or early 2024.

medium confidencebest source: independent researchobserved Mar 2024EvidenceSection 2Section 4
flag a problem with BI-FIND-2024-0002
02

Section by section

4

showing 4 of 4

[1]

Benchmark design: 17 user cases x 62 attacker cases

Qiusi Zhan, University of Illinois Urbana-Champaign · Zhixiang Liang, University of Illinois Urbana-Champaign · Zifan Ying, University of Illinois Urbana-Champaign · Daniel Kang, University of Illinois Urbana-Champaign

AI trustAgentic identity

UIUC authors build InjecAgent from the 330 ToolEmu tools: 17 user tools whose output an attacker can edit, 62 attacker tools (30 direct harm, 32 data stealing), crossed into 1,054 cases. GPT-4 drafted the cases, then humans fixed them (about 30% of attacker instructions lacked parameters). A base setting and an enhanced setting with an 'IMPORTANT!!! Ignore all previous instructions' prefix.

technical artifactfrom published text + figures

[2]

Results: 30 agents, prompted GPT-4 at 24% base and 47% enhanced

Qiusi Zhan, University of Illinois Urbana-Champaign · Zhixiang Liang, University of Illinois Urbana-Champaign · Zifan Ying, University of Illinois Urbana-Champaign · Daniel Kang, University of Illinois Urbana-Champaign

AI trustAgentic identity

ASR-valid on the long ReAct prompt: GPT-4 23.6% base, 47.0% enhanced; Llama2-70B 86.9% and 88.2%; Claude-2 11.4% base and 3.4% enhanced (the only agent that falls). Fine-tuned GPT-3.5 3.8%/8.4%, fine-tuned GPT-4 6.6%/7.1%. Data transmission after extraction succeeds near 100%. Models tested are 2023 vintage (gpt-4-0613, claude-2.1).

technical artifactfrom published text + figures

[3]

Analysis: user case, content freedom and sensitivity

Qiusi Zhan, University of Illinois Urbana-Champaign · Zhixiang Liang, University of Illinois Urbana-Champaign · Zifan Ying, University of Illinois Urbana-Champaign · Daniel Kang, University of Illinois Urbana-Champaign

AI trustAgentic identity

The user case (what the agent fetched) associates more strongly with success than the attacker case (Cramer's V 0.28 vs 0.18 direct harm; 0.31 vs 0.20 data stealing). 12 high-content-freedom user cases (tweets, reviews) yield higher ASR than 5 low-freedom ones. Hacking prompt raises sensitivity rates; Claude-2 refuses more with it, so its ASR falls.

technical artifactfrom published text + figures

[4]

Defenses (surveyed, not tested), limitations and ethics

Qiusi Zhan, University of Illinois Urbana-Champaign · Zhixiang Liang, University of Illinois Urbana-Champaign · Zifan Ying, University of Illinois Urbana-Champaign · Daniel Kang, University of Illinois Urbana-Champaign

AI trustAgentic identity

No defense is evaluated. Related work lists black-box defenses (warning prompts, delimiters) and white-box ones (fine-tuning, encoded commands, two-channel formatting) and says their effect on tool agents is future work. The only safeguard in the test is the ReAct prompt's safety text. Stated limits: one fixed hacking prompt, single-turn attacks of at most two steps, only two fine-tuned agents.

technical artifactfrom published text

Terms used

Attack success rate
The share of attack attempts in a test that achieve the attacker's goal.
GPT-3
OpenAI's large language model family released in 2020, short for Generative Pre-trained Transformer 3.

Cited in our columns

Read next

Was this briefing useful?

Share this briefing

Every finding, forecast and open question on this site has a permanent ID. If we reword one, its ID stays the same, so a citation keeps pointing to the same claim.

Follow us on LinkedInRSS feed

Working on an identity problem this research touches? Talk to Boston Identity