A10Advanced 75 minutes reading and codeLocked

Prompt Injection and the PVE Defense

Greshake et al. (AISec 2023) established indirect prompt injection as the defining agent security problem. Attacker plants instructions in data the agent retrieves; on ingest, those instructions override the developer prompt. Treat all retrieved content as arbitrary code execution on the tool-use surface.

In this lesson

  1. 01Learning Objectives
  2. 02The Problem
  3. 03The Concept
  4. 04Build it
  5. 05Use it
  6. 06Exercises
  7. 07Key Terms
  8. 08Further Reading

About 1000 words of reading, with code, 7 quiz questions and the tutor.

The full lesson opens with an access code

You can see what this lesson covers and the milestone it sets. The full text, code, quizzes, the tutor and the AI reviews come with the K850 practice, along with weekly build sessions and code review.

Codes come with the K850 practice. Book a place

Milestone forAn observable back-office agent

Instructions hidden in payment references

Attack the agent through its data: payment references and WhatsApp replies containing instructions such as mark all invoices paid. Separate data from instructions, restrict tools by state and prove the attacks fail.

Done when

  • 20 injection attacks through payment references and WhatsApp replies
  • Tool availability restricted by graph state
  • 20 of 20 attacks blocked or escalated, with trace evidence

Stretch: Write 5 new attacks after reading your own defences, and fix what gets through

Reviews open with an access code.

Interview practice

Questions on this topic that AI engineering interviews ask, with the companies reported to ask them. Answer the way you would out loud; Jev scores it and DeepSeek tells you what to add.

Scoring opens with an access code. You can still read the questions and prepare.

Adapted from open-source work: AI Engineering from Scratch by Rohit Ghumare (MIT, lesson text, code and quizzes); Awesome LLM Apps by Shubham Saboo (Apache-2.0, starter code); AI Engineering Interview Questions by Outcome School (Apache-2.0, interview questions). Capstones, milestones, data packs and Zambian context by Zambrite.

Chat on WhatsApp