Safety, Security & Responsible AI·Question 59 of 70Quick-fire

What is prompt injection, and how is indirect injection different and worse?

Quick-fire answer from the Awesome Generative AI Guide (MIT)

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Prompt injection is when input text overrides your instructions and makes the model do something unintended. Direct injection comes from the user typing a malicious prompt. Indirect injection is more dangerous: the malicious instructions hide inside content the model ingests from elsewhere (a retrieved document, a web page, a tool result, an email), so the attack rides in through data the user never sees and the model treats as trusted. It is worse because your attack surface is every external source your RAG or agent touches, and the user is not the attacker.

Full worked answer

Prompt injection is when input text overrides your instructions and makes the model do something unintended. Direct injection comes from the user typing a malicious prompt. Indirect injection is more dangerous: the malicious instructions hide inside content the model ingests from elsewhere (a retrieved document, a web page, a tool result, an email), so the attack rides in through data the user never sees and the model treats as trusted. It is worse because your attack surface is every external source your RAG or agent touches, and the user is not the attacker.

Learn more: Simon Willison: Prompt injection series

What a good answer covers

  • Prompt injection is when input text overrides your instructions and makes the model do something unintended
  • Direct injection comes from the user typing a malicious prompt
  • Indirect injection is more dangerous
  • It is worse because your attack surface is every external source your RAG or agent touches, and the user…

Key terms: Learn more

Quick-fire answer from the Awesome Generative AI Guide (MIT) · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep