01Chapter 1: How LLMs read prompts: instructions and data share one contextThis chapter assumes you can read basic Python and have called an LLM through a chat-style API. It also assumes you know the web security idea of untrusted input, such as the input behind XSS or SQL injection.2 min read
02Chapter 2: Mapping trust boundaries in an LLM applicationThis chapter assumes you can call a chat-style LLM API from Python and that you know the web security idea of untrusted input. You should also know why XSS happens. The chapter shows how to find where untrusted text enters an LLM application and what that text can reach.2 min read
03Chapter 3: What prompt injection is and why it worksThis chapter assumes you can write basic Python and have called a chat-style LLM API. It also assumes you know the web security idea of untrusted input, as in SQL injection or XSS.2 min read
04Chapter 4: Direct prompt injectionThis chapter assumes you can write Python, have called a chat-style LLM API, and know the web security idea that untrusted input must not be trusted. It covers direct prompt injection. Indirect injection through documents and web pages comes in the next chapter.2 min read
05Chapter 5: Indirect prompt injection through documents, web pages and emailThis chapter assumes you can call a chat-style LLM API in Python and know why untrusted input is dangerous in web security. It also assumes you have read the earlier chapters on shared context and trust boundaries.2 min read
06Chapter 6: Jailbreaking compared with prompt injectionThis chapter assumes you know that instructions and data share one context window. It also assumes you can tell direct injection from indirect injection. Both terms are easy to mix up with jailbreaking, and the fixes differ.2 min read
07Chapter 7: Tools and agents expand the attack surfaceThis chapter assumes you can call a chat-style LLM API in Python and know the basic idea of untrusted input from web security. It also assumes you have read the earlier chapters on how instructions and data share one context, and on prompt injection.2 min read
08Chapter 8: Excessive agency and the confused deputyThis chapter assumes you know how a chat-style LLM API works, what a tool (function) call is, and the basics of untrusted input from web security. It builds on the earlier chapters on indirect injection and on tools and agents.2 min read
09Chapter 9: Data exfiltration through links, images and tool callsThis chapter assumes you know how a chat-style LLM API works, what untrusted input is, and how XSS (cross-site scripting) abuses content that a browser renders. It builds on indirect prompt injection and on tools and agents.2 min read
11Chapter 11: Poisoned retrieval sources and knowledge basesThis chapter assumes you know how a retrieval-augmented generation (RAG) pipeline works: documents are split into chunks, indexed, and the closest chunks are pasted into the prompt. It also assumes you have read the chapters on indirect injection and trust boundaries.2 min read
12Chapter 12: Defense in depth: assume the injection succeedsThis chapter assumes you know how prompt injection works, including the direct and indirect forms. It also assumes you can read basic Python and know the web security idea of untrusted input.2 min read
13Chapter 13: Input and output filtering and its weaknessesThis chapter assumes you can call a chat-style LLM API in Python and know the web security basics of untrusted input and XSS. It covers two defenses that sit around the model. Neither one is complete, and the chapter explains why.2 min read
14Chapter 14: Least privilege, scoped credentials and isolationThis chapter assumes you can call an LLM through a chat-style API, write basic Python, and know why untrusted input is dangerous in web applications. It also assumes you have read the earlier chapters on excessive agency and data exfiltration.2 min read
15Chapter 15: Human approval for high-impact actionsThis chapter assumes you can call an LLM through a chat-style API, read Python, and understand why untrusted input is dangerous. It also assumes you know the least privilege idea from the previous chapter: give an agent only the tools it needs.2 min read
16Chapter 16: Testing and red teaming with injection payloadsThis chapter assumes you can write Python, have called a chat-style LLM API, and know how untrusted input causes problems in web security. It also assumes you have read the earlier chapters on indirect injection and defense in depth.2 min read
17Chapter 17: Logging, monitoring and incident responseThis chapter assumes you know how an LLM app assembles prompts, how indirect injection works, and the defenses from earlier chapters (least privilege, output sanitization, approval gates). Prevention will sometimes fail. Logging and monitoring tell you when it did, and incident response limits the d2 min read