- Home
- Image Attacks Lab
- Data Poisoning Lab
- Evasion Attacks Lab
- Defense Lab
- LLM Red Teaming Lab
- Model Privacy Lab
- Backdoor / Trojan Lab
- Robustness Evaluation Lab
- My experiments
- Scientific references
- Glossary and FAQ
Direct and indirect prompt injection
LLM Red Teaming Lab · llm
Level 1: idea and analogy
The idea
Input text (from the user or from a document/page) carrying instructions that try to override the developer's; the indirect kind comes from data the system retrieves.
Analogy
A message hidden in a file the secretary summarises that becomes an order.
Level 2: how it works and when to use it
Steps
1) Decide who gives instructions and who supplies data. 2) Put the attacker text in an untrusted channel. 3) Watch for leakage, tools, unsafe output.
When to use it
Designing apps that use documents, browsing and tools.
Strengths
A clear threat model for layered defence design.
Level 3: mathematics, assumptions, limits
Mathematical form
\text{ISR}=\frac{\#\{\text{attacks whose goal is achieved}\}}{\#\{\text{attacks}\}}\quad(\text{over a stated scenario set})Assumptions
The model does not always separate instructions from data (Greshake et al.).
Limitations
This simulator is a set of transparent rules, not a language model: its numbers describe the rules, not real models.
Metrics
Injection success rate, leakage, tool misuse and false alarms.
Defenses
Instruction hierarchy, data separation, input/output filters, tool allow-lists, user confirmation.
Level 4: pitfalls and references for researchers
Common pitfalls
Relying on a single filter; ignoring false alarms; generalising from few scenarios.
References
- Perez, F. et al. (2022). Ignore Previous Prompt: Attack Techniques For Language Models. arXiv preprint. Link
- Greshake, K. et al. (2023). Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. arXiv preprint. Link
- Vassilev, A. et al. (2025). Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations (NIST AI 100-2e2025). National Institute of Standards and Technology. doi:10.6028/nist.ai.100-2e2025
