Skip to content
Preptima
hardConceptDesignScenarioMidSeniorStaff

What is indirect prompt injection, and how would you defend an assistant that reads user-supplied documents?

5 min readUpdated 2026-08-15

Answer

Short answer

Indirect prompt injection is when instructions hidden in content the model reads are followed as if they came from you. Instructions and data share one token sequence, so there is no complete fix and the defence is architectural: least-privilege tools, filtered output, and human approval for side effects.

Was this answer helpful?

Likely follow-ups

  • You add a guardrail model that scans documents for injected instructions. What does an attacker do next?
  • How would you handle a document that is legitimately full of instructions, such as a runbook?
  • The assistant can search the web and also read the user's mail. Why is that combination worse than either alone?
  • What would you log so that you could reconstruct an injection incident afterwards?

Related questions

Masterclass guide

Further reading