Engrain by ByteRush

AGT.10.02 Mid-levelCore — asked often

Prompt injection in depth

Comes up in: AI engineering, AI system design

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • direct vs indirect injection (via web pages, emails, documents, tool results)
  • why it cannot be fully solved by prompting
  • defence in depth: least-privilege tools, separating data from instructions, approval gates, output filtering, sandboxing, monitoring
  • the "lethal trifecta" idea (private data + untrusted content + exfiltration channel — cite Simon Willison 2025)

Words you will know

prompt injectionindirect prompt injectionexfiltration

What you will practise

  • red-team a demo agent
  • fix with defence in depth

Interview questions this answers

  • How would you secure an agent that reads emails and can send messages?