Prompt injection attacks vary widely across nine key differences
The Devil is in the Context: Nine Dimensions of Prompt Injection Attacks
Cryptography and Security
Summary
Prompt injection attacks happen when someone tricks an AI system by sending malicious instructions that look normal but change how the AI behaves. This paper shows that these attacks are not all the same, but differ in nine important ways, including what the instruction says and how it fits with the user's goal. The authors studied real examples and common tests, finding many types of attacks are not covered well. They also created a way to label and find gaps in current tests, helping improve defenses and better match protections to attack types.
What this means in practice
- •For ai security engineers: Identify which types of prompt injection attacks their systems face and select matched defenses using the proposed nine-dimension taxonomy.
- •For benchmark developers: Create more comprehensive prompt injection test suites by targeting untested attack category combinations identified by the taxonomy.
Authors
Jiamin Chang, Kristina Nikolić, Rishi Sharma, Giovanni Cherubin, Vasilios Mavroudis, Jose Sanchez Vicarte, Arnav Garg, Hammond Pearce, Andrew Paverd, Ahmed Salem
Abstract
Prompt injection is usually discussed and evaluated as a single, homogeneous type of attack. However, vulnerabilities reported in real-world systems show that prompt injections vary widely. Moreover, the same instruction can be a prompt injection in one context and a legitimate request in another, depending on the user's intent and the system's policies. Ignoring this variation leaves gaps in how defenses are evaluated, and can give a false sense of security against real-world attacks. We identify nine dimensions along which prompt injection attacks differ. Together, they form a taxonomy that describes the injected instruction itself, its relation to the user's task, and how it manifests in the target system. Each dimension affects which defenses can detect or prevent an attack. We first use the taxonomy to characterize six real-world prompt injection vulnerabilities, showing how much these attacks differ. We then apply it to nine prompt injection benchmarks and find that most cover only a small region of this space. Combining benchmarks helps, but 13% of pairwise category combinations remain untested, mostly among the less commonly represented categories. Finally, we show that the taxonomy supports automated annotation of benchmarks and targeted generation of new test cases to fill these gaps. The taxonomy is also useful beyond benchmarks. Defense authors can use it to state which types of prompt injection they evaluated against, and system operators can use it to identify which attacks apply to their system and choose defenses to match.