Raccoon: Prompt Extraction Benchmark of LLM-Integrated Applications

Junlin Wang, Tianyi Yang, Roy Xie, Bhuwan Dhingra · DOI

TL;DR

LLM-integrated applications rely on proprietary system prompts that act as their "secret sauce," but these prompts are highly vulnerable to extraction attacks. The authors introduce Raccoon, a comprehensive benchmark that reveals a "capability paradox": more advanced models are often easier to exploit because they follow instructions too well, though specific safety-tuned models like GPT-4-1106 show significant resilience when paired with robust in-context defenses.

What Problem Does This Paper Address?

As Large Language Model (LLM) ecosystems like OpenAI’s GPT Store and LlamaIndex flourish, the "instruction prompt"—the hidden set of rules that define an AI's behavior—has become valuable intellectual property. However, these prompts are susceptible to prompt extraction attacks, where a malicious user crafts a query to trick the model into revealing its internal instructions.

While prompt injection (getting a model to ignore rules) is well-studied, prompt extraction (stealing the rules themselves) lacks a systematic evaluation framework. This paper fills that gap by providing a rigorous benchmark to measure how easily different models surrender their "secrets" and how effective current defense strategies actually are.

Methods

The researchers developed a dual-pronged evaluation method:

  1. Attack Categorization: They identified 14 distinct categories of extraction attacks, ranging from "Cognitive Hacking" (tricking the model into a hypothetical scenario) to "Payload Splitting" (breaking the attack into fragments the model reassembles). They also tested compound attacks, which combine multiple potent strategies to bypass defenses.
  2. Defense Evaluation: They tested 14 defense templates categorized by length (Short, Medium, Long). These are "in-context" instructions added to the system prompt to explicitly forbid the model from revealing its instructions.
  3. Scoring Metrics: Success is measured by the Attack Success Rate (ASR), calculated using the RougeL recall score between the original prompt and the model's output. They also introduced "Model Susceptibility Scores" to provide a balanced view of a model's vulnerability across different attack categories.
Figure 1: An example of a prompt extraction attack on LLM-integrated Application with a defense.

Datasets

The authors introduced the Raccoon benchmark, which consists of:

  • 197 Real-world Prompts: Manually acquired from a pool of 48,000 scraped custom GPTs to serve as the targets for extraction.
  • 42 Singular Attacks: Three exemplary attacks for each of the 14 categories.
  • 10 Compound Attacks: Strategically mixed attacks designed to be more potent.
  • 14 Defense Templates: A diverse collection of community-sourced and original defense mechanisms.

Key Insights and Ideas

  • The Capability Paradox: There is a strong linear correlation between a model's instruction-following capability (e.g., AlpacaEval 2.0 scores) and its vulnerability. Because advanced models are better at following complex user requests, they are ironically more likely to follow a "malicious" instruction to reveal their prompt.
  • Defense Length Matters: Longer, more complex defense templates are significantly more effective than short ones. For instance, GPT-4-1106 achieved near-total robustness when equipped with extensive defense mechanisms.
  • Compound Potency: While singular attacks are often enough for undefended models, compound attacks are much more effective at breaking through defenses.
  • Universal Vulnerability: In a "defenseless" state, every model tested—proprietary or open-source—was highly susceptible to at least one category of attack, often with ASRs exceeding 90%.
Figure 2: Model susceptibility scores under four set- tings: DefenselessSingular, DefenselessCompound, DefendedSingular, DefendedCompound. Under the defended setting, there is an in-context defense safe- guarding the instruction prompt. A larger area means the model is more susceptible to prompt thefts.

Key Results

  • OpenAI Resilience: GPT-4-1106 and GPT-3.5-1106 demonstrated the best resilience when defended. GPT-4-1106’s worst-case susceptibility dropped from 99% (undefended) to just 3% (defended) for singular attacks.
  • Open-Source Vulnerability: Popular open-source models like Llama-2-70b-chat and Mixtral-8x7B remained highly vulnerable even with defenses, suggesting a lack of specific safety instruction tuning for extraction threats.
  • Attack Efficacy: "Prefix Injection" (asking the model to start with a specific string like "Sure, here is...") and "Distractor Instructions" were among the most universally successful attack types.
Figure 3: The matrices show ASRs for each prompt extraction attack category and each model. Each attack category has three attack prompts and we show the maximum ASR here. (a) shows corresponding ASR for each singular attacks. (b) demonstrate the ASR for each compound attacks. Here compound attacks are constructed by picking the five singular attack categories and combined manually. We use abbreviations defined in Table 1.

Limitations and Future Work

The authors acknowledge that their compound attacks were limited to combinations of two strategies due to resource constraints; more complex, multi-stage attacks might be even more effective. Additionally, the study focused on large-scale models; the susceptibility of smaller, "edge" LLMs remains an open question.

Future research directions include developing automated attack systems that use generative models to iterate on attack vectors and exploring more robust, non-textual defense mechanisms that go beyond simple in-context prompting.

Summary updated

BibTeX
@inproceedings{wang2024raccoon,
  author = {Junlin Wang and Tianyi Yang and Roy Xie and Bhuwan Dhingra},
  title = {{Raccoon: Prompt Extraction Benchmark of LLM-Integrated Applications}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.791},
}
Figure