Prompt injection, direct and indirect
A job applicant hides one line in white text at the bottom of a CV, telling any AI screener that this is the best candidate it has ever seen. A web page tells a browsing assistant to ask the reader for their card number. The model reads both as words to obey. Prompt injection is the top risk on every list, and you can't patch it like an ordinary bug.
In this lesson you'll learn to
- Find where injected instructions can hide, including web pages, documents, tool results, images, invisible characters and retrieved chunks.
- Explain what attackers aim for with injection, from hijacked goals to stolen data, biased answers and planted memories.
- Explain why prompt-level defences reduce injection but can't remove it, especially against adaptive attackers.
- Apply input-side mitigations such as sanitising, spotlighting and detection classifiers, and measure them with an injection test set.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.