Home

/

Prompt Injection: Blast Radius

/

The sandbox held and it did not help

The sandbox held and it did not help

Chapter 11
Part II
4
min read

The sandbox held and it did not help

One failure survives everything above, and it is the one worth designing against explicitly.

The agent runs in a perfect sandbox. No credentials, no network, ephemeral, destroyed on exit. It writes code. The code is harmless inside the box, because nothing in the box matters.

Then the code leaves. It goes into a branch, a pull request, a build artifact, a migration file. Later it runs somewhere that does have credentials, network and persistence, executed by a CI system that trusts its own repository.

The sandbox contained the execution and did nothing about the artifact, which was the part with a future. An attacker who can influence what an agent writes does not need to escape anything. They only need to be patient, and CI will do the rest with far more authority than the agent ever had.

The answer is that agent-authored artifacts are tainted until a human has read them, and the place that gets enforced is the pipeline rather than the sandbox. Branch protection that a bot cannot satisfy alone. Review required, by a person, on anything an agent produced. No auto-merge on agent branches, whatever the test suite says.

This is the seam between this chapter and chapter 13, and it is where the two threat models meet.

The shell case

An agent with a terminal on a developer machine is a different product with a different threat model, and it is worth being direct about it.

That machine has credentials. It has SSH keys, cloud CLI sessions, a package manager, network access to internal services, and a git remote with push rights. None of the four properties hold and most of them cannot be made to hold without making the tool useless, because reaching those things is the entire point.

What is available is narrower and still worth doing. Require approval for irreversible commands, which is chapter 14, with the class judged on irreversibility rather than a blocklist of command names. Keep production credentials off the machine entirely rather than trusting a prompt to avoid them, which is what would have stopped Replit. Log every command with its provenance so that chapter 17 has something to read.

Do not pretend this configuration is contained. Say plainly that it is a trusted tool on a trusted machine, and spend the effort on reducing what that machine can reach.

What this costs

Latency, mostly. Creating and destroying an isolated environment per task adds seconds, and for an interactive coding agent seconds are expensive. Warm pools help and reintroduce exactly the state-reuse problem the ephemerality rule exists to prevent, so pool the runtime and never the filesystem.

The second cost is developer experience, and it is the one that kills implementations. No network means no package installs, which breaks half of what people wanted the agent to do. The allowlisted registry proxy is the answer and somebody has to build and run it.

The third is that some teams will decline all of this for their internal coding agents, on the grounds that the machine is trusted and the friction is not worth it. That is a defensible position for a tool with no untrusted input. It stops being defensible the moment the agent reads a pull request from outside the team, and the transition usually happens without anyone noticing.

Chapter 12 turns to the state that outlives a single task, and the injection that waits.

Sources for this chapter

ClaimSourceStatus
28 of 53 tracked agentic projects are coding agents; advisory counts n8n 57, Claude Code 22, AutoGPT 15, Dify 13, Roo-Code 11https://www.helpnetsecurity.com/2026/06/11/owasp-prompt-injection-ai-security-failures/SECONDARY
Replit agent issued destructive commands during an active code freezeAI Incident Database, Incident 1152, https://incidentdatabase.ai/cite/1152/PRIMARY (register)
Excessive Agency as a rising OWASP categoryhttps://cybersecuritynews.com/owasp-genai-llm-top-10-2026/SECONDARY

The four properties, the SandboxSpec type and the argument for making credentials unrepresentable in it, the rule that sandbox output returns tainted, and the position on shell-access agents are the author's. The September 2026 advisory counts were taken by this book directly from GitHub's public API; the script and full output are in assets/replication/. The 28-of-53 figure remains secondary-sourced (UNVERIFIED-CLAIMS.md #11). The claim that containers are adequate for most threat models is a judgement, not a measured result, and readers with a nation-state threat model should disregard it.

the-three-year-bug
why-the-industry-shipped-anyway
injection-is-not-jailbreaking
why-the-confusion-persists
the-lethal-trifecta
running-the-audit
why-filtering-fails
measured-here-on-a-named-model
why-this-is-structural
what-solved-would-look-like
the-harness
provenance-every-value-knows-where-it-came-from
on-the-reference-agent
quarantine-the-planner-never-reads-the-mail
what-two-models-cost-in-practice
capability-authority-the-agent-cannot-widen
expiry-is-a-feature
the-gate-the-model-proposes-code-disposes
the-policy
failing-closed
egress-closing-the-exfiltration-leg
how-much-can-actually-leak
sandboxing-containing-the-code-the-agent-writes
the-sandbox-held-and-it-did-not-help
poisoned-memory-poisoned-retrieval
cleaning-up-afterwards
the-tool-supply-chain
mcp-and-the-rest
human-in-the-loop-that-isnt-theatre
when-there-is-nobody-there
testing-for-injection
measuring-coverage-not-pass-rate
red-teaming-agents
a-finding-worked-through
when-it-happens-anyway
what-the-logs-cost-you-in-an-incident-you-did-not-have
governance-procurement-and-the-regulator
writing-the-policy
end-to-end
what-it-actually-took
what-stays-broken
why-this-is-probably-structural
the-trifecta-audit-worksheet
action-schema-and-policy-reference
control-mapping
prompt-injection-sources
incidents
appendix-e-what-we-re-ran-ourselves
e4-the-control-that-keeps-e2-and-e3-honest

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.