02Chapter 2: Where untrusted content enters: files, issues, comments, docs, dependencies, tool outputThis chapter assumes you can use git and a hosting platform (repositories, issues, pull requests), run commands in a terminal, and read short Python and YAML snippets. It also assumes you know that a coding agent is a language model that can call tools such as a shell or a file editor. The previous 5 min read
03Chapter 3: Why a model cannot cleanly separate instructions from dataThis chapter assumes you know what a coding agent's tool loop looks like, as covered in the first chapter. It also assumes you can read basic Python and have met SQL injection. The aim is to explain why an agent cannot reliably separate the developer's instructions from text it only meant to read, a5 min read
04Chapter 4: Indirect prompt injection explainedThis chapter assumes you have used git and a hosting platform (repositories, issues, pull requests), can read short Python and Markdown, and know roughly what a large language model (LLM) is. Earlier chapters covered the agent's tool loop, where untrusted content enters, and why instructions and dat5 min read
05Chapter 5: What an agent can do: shell, file writes, network, credentialsThis chapter assumes you know the agent loop from the earlier chapters: the model reads context, picks a tool call, and receives the result. It also assumes basic command-line use and the ability to read short Python snippets. Here we look at what those tool calls can reach. An injected instruction 5 min read
07Chapter 7: Rules files, MCP settings, and hooks that live in the repositoryThis chapter assumes you know how a coding agent's tool loop works and how indirect prompt injection works, from the earlier chapters. You should also be comfortable with git pull requests and reading JSON and Python.4 min read
08Chapter 8: How stolen data leaves: URLs, rendered images, commits, comments, and tool callsThis chapter assumes you know how a coding agent's tool loop works, where untrusted text enters its context, and how indirect prompt injection works. It covers the other half of an attack: how data gets out once an injected instruction has told the agent to take it.7 min read
09Chapter 9: The dangerous combination: private data, untrusted input, outbound channelThis chapter assumes you know how the agent tool loop works and where untrusted text enters it. It also assumes you have read the earlier chapters on indirect prompt injection and on exfiltration channels. Here we combine those pieces into one test you can apply to any agent workflow.6 min read
10Chapter 10: Threat modeling a repository workflowThis chapter assumes you know git, issues, and pull requests, and that you have read the earlier chapters on the agent loop, untrusted sources, indirect injection, and the combination of private data, untrusted input, and an outbound channel. Here you turn those ideas into a repeatable method. You w6 min read
11Chapter 11: Least privilege for agents and tokensThis chapter assumes you know git and a hosting platform (repositories, issues, pull requests), the command line, and basic Python and YAML. It also assumes you have read the earlier chapters on indirect prompt injection and the dangerous combination of private data, untrusted input, and an outbound6 min read
12Chapter 12: Running the agent in a sandboxThis chapter assumes you know basic Docker usage, can read short Python and YAML, and have read the earlier chapters on the agent's privileges and the combination of private data, untrusted input, and an outbound channel. Here you will learn how to contain an agent so that a successful injection has5 min read
13Chapter 13: Approval gates and their limitsAn approval gate is a point where an agent must stop and wait for a person to say yes before it takes an action. Most coding agents ship with gates for shell commands, file writes, and network calls. This chapter explains what a gate protects against, why people stop reading prompts, and how to desi6 min read
14Chapter 14: Restricting network egressEgress is traffic that leaves a machine for somewhere else. This chapter covers how to limit what an agent's environment can send out, so an injected instruction has no easy way to deliver stolen data. It assumes you know the earlier chapters on the lethal trifecta (private data, untrusted input, an5 min read
15Chapter 15: Labeling and limiting untrusted inputThis chapter covers what you can do to the text itself before an agent reads it: label it, shrink it, and strip parts of it. These steps help a model and a human reviewer, but they do not stop an attack. They only work when the agent's capabilities are limited by the controls in other chapters.4 min read
16Chapter 16: Agents in CI and issue automationThis chapter assumes you can read GitHub Actions YAML and basic Python. You should also know the earlier ideas: indirect prompt injection, the combination of private data, untrusted input and an outbound channel, and least privilege.4 min read
17Chapter 17: Logging and reviewing agent actionsThis chapter assumes you have read the chapters on least privilege, sandboxing, approval gates, and egress control. It also assumes you can read basic Python and JSON. The earlier defenses try to stop a bad action. Logging covers the cases where they fail. It tells you what the agent did, what it ha5 min read
18Chapter 18: Testing defenses with benign injection attemptsThis chapter assumes you have read the earlier chapters on the agent tool loop, indirect prompt injection, least privilege, sandboxing, approval gates, egress control, and logging. You should be comfortable reading Python and YAML and running commands in a terminal.7 min read
19Chapter 19: Residual risk and secure defaultsThis chapter assumes you have read the earlier chapters on the agent tool loop, indirect prompt injection, the combination of private data, untrusted input and an outbound channel, and the defenses: least privilege, sandboxing, approval gates, egress control, and monitoring. Here you decide what to 6 min read