Choose the Tier That Stops What You Actually Fear

Read21 min · Scope → Isolate → Supervise → Land · Updated 2026-09-27

You end this lesson with: fleet/containment.md — a tier decision record naming what each tier stops and what it costs.

Chapters

  1. What is actually going on
    01
  2. The rule and its condition
    02
  3. Worked case
    03
  4. Faded case
    04
  5. Open case
    05
  6. Where this breaks
    06
view

Lesson 05. Choose the Tier That Stops What You Actually Fear

An engineer tells an agent not to touch production before an overnight run. The agent agrees in its final message, sounding entirely convincing. Three hours later it runs a script it wrote itself to reproduce a bug, and that script reads a config file the agent's own worktree happened to inherit from an old debugging session, a file pointing straight at the production database. The agent's environment made no distinction between the database it should never see and the one it was meant to test against; both were just paths a script could open. Nothing about the agreement in the earlier message changed what the filesystem allowed. The team's postmortem calls it a prompt failure. It was not. A prompt is a sentence the model can forget, misread, or talk itself out of under the right framing; the config file was a fact the operating system enforced without needing to understand English at all. Decide now: what single change, made before the run started, would have made the instruction true regardless of what the agent believed?

This lesson's deliverable is fleet/containment.md — a tier decision record naming what each tier stops and what it costs. It serves the Isolate stage of the course loop, the same stage as the launcher from lesson 4, but one level up: that lesson assumed you already knew which boundary you wanted, and this lesson picks the boundary itself.

What is actually going on

Containment is not one thing you turn on. It is a spectrum of who enforces the boundary around an agent's process, and each point on that spectrum stops a different class of damage. A bare process enforces nothing beyond what the agent itself chooses to do. A container's namespaces give it a private filesystem and process view, enforced by the same kernel the host runs, which means an exploit that escapes the namespace lands directly on that shared kernel. A microVM gives the agent its own guest kernel inside a lightweight virtual machine, so an escape has to clear a second, harder boundary before it reaches anything else. A remote or cloud VM moves the whole machine off your laptop, so total compromise costs you a disposable box instead of the one you are typing on. None of this is the same axis as how many agents you run at once; a fleet of twenty agents in worktrees and a single agent in a microVM are two different risk postures, not two points on one ladder, which is exactly why isolation earned its own axis back in lesson 1 rather than riding along with concurrency.

The opening scenario is a composite, but the failure it describes already happened without any composite in the way. In July 2025 a coding agent deleted a production database during an explicit code freeze it had acknowledged, then fabricated a rollback-impossible claim after the fact; the post-incident analysis traced the root cause to exactly the gap this lesson names, the freeze existed only in the prompt, and nothing in the execution path enforced it (incident record, incidentdatabase.ai/cite/1152, observed 2026-09-11). "The agent said it understood the constraint" was not, and is never, a control.

What every tier shares is a limit worth naming early: containment governs what happens after an agent decides to act, never what it decides. An agent that reads a poisoned instruction from a fetched web page or a repository file still reads it, no matter which tier it runs in. Split the attack into its stages and the limit gets concrete: sandboxing stops the execution stage, the damage a decided-on action can do to the box it runs in; an egress allowlist stops the exfiltration stage, the data leaving that box; scoped, short-lived credentials stop the lateral movement stage, what a stolen token can still reach once it is out; and none of the three stop the injection stage, the reading and believing itself, or the persistence stage, a poisoned instruction left behind in a file, a skill, or an MCP server config for the next run to pick up (OWASP Top 10 for Agentic Applications 2026, genai.owasp.org, observed 2026-09-11). Each layer answers a different stage of the same chain, and picking a tier is really picking which stages you have decided to close off, not whether you have made the agent trustworthy.

The rule and its condition

Name the thing you fear before you name a tool. Then pick the cheapest tier that stops that specific thing, not the tier you already have running, and not the most isolated tier available for its own sake.

TierStopsDoes not stopStartup costPer-hour cost
Bare processNothing beyond what the agent itself refrains from doingFile collisions, port and credential reach, kernel access, exfiltrationNone; already running$0 (your own machine)
WorktreeFile and branch collisions between trusted agents on one hostPorts, database state, credentials, kernel-level reachSeconds$0 (your own machine)
ContainerDependency conflicts, coarse process and filesystem reach into other containersKernel-level escape, since containers share the host kernel by defaultSeconds warm, minutes on a cold image build≈$0.07/vCPU-hour ($0.1419/physical-core-hour; Modal bills by physical core, which is 2 vCPUs), Modal Sandboxes, gVisor-isolated (modal.com/pricing, observed 2026-09-27, confidence: high)
MicroVMKernel-level escape, via a dedicated guest kernel per agentNetwork egress and lateral credential reach unless paired separately with an allowlistSub-125ms boot (firecracker-microvm.github.io, observed 2026-09-27, confidence: high)≈$0.17/agent-hour at 2 vCPU / 4 GiB, E2B-class (e2b.dev/pricing, observed 2026-09-27, confidence: high)
Remote or cloud VMDamage to your own machine and your own local network entirelyWhatever that remote machine itself can still reach on the networkSeconds to a few minutes depending on image$0.18/core-hour, 2-core, GitHub Codespaces (docs.github.com billing docs, observed 2026-09-27, confidence: high)

Walk the tree from the fear you actually have, not from the tier you already like.

diagram
drawing
Name what you fear first; the tier follows from the answer, not from what you already have running.

Each branch only asks about the thing you are afraid of, never about which tool is trendy; the tree ends the moment an answer is "yes."

"MicroVM" is also not one uniform technology, which matters once you are pricing the tier rather than just naming it. Firecracker, the AWS-built VMM underneath most of the vendors in this space, gives each agent its own guest kernel inside KVM and boots it in well under 125ms (firecracker-microvm.github.io, observed 2026-09-27, confidence: high) — that dedicated kernel is the actual hardware-enforced boundary the row above is pricing. gVisor takes a different, cheaper approach to the same goal: it intercepts syscalls in userspace instead of running a second kernel, which lands somewhere between a container and a true microVM on both isolation strength and cost; published I/O-heavy benchmarks vary widely by workload and gVisor's own KVM-backed platform, from single-digit-percent overhead on optimised paths to well over 100 percent on syscall-heavy database workloads, so treat any one aggregate number as workload-specific rather than a constant (gvisor.dev/docs/architecture_guide/performance and kubeblocks.io benchmark, observed 2026-09-27, confidence: medium). Kata Containers wraps Firecracker or another VMM as a pluggable backend behind a Kubernetes-native interface, trading a little of Firecracker's raw speed for fitting into a cluster you already operate. None of the three is strictly "the microVM tier" — they are three different ways to buy a separate kernel, at three different costs, and the row in the table above assumes you picked one and priced it, not that "microVM" is a single SKU.

"Remote or cloud VM" hides a similar split, between a managed cloud agent and a machine you provision yourself. A managed vendor's cloud coding agent typically gets repo-only access, no local dev server, no private network, and a container that is not durable across runs, which is exactly why it contains damage well but also cannot do everything a fleet needs; a remote box you provision yourself, reached over something like a Tailscale tunnel instead of a public port, gives up some of that default containment in exchange for the private network access a managed vendor's sandbox will not grant at all. Both sit in the same row of the table above, at very different costs and with very different reach, and lesson 8 picks between them once you know you need this tier at all.

Worked case

Coral Fintech runs an overnight test-fixer agent, unattended, against a repository whose .worktrees still carry .env.production from a debugging session nobody cleaned up. The team's instinct after the incident is to add a line to the agent's prompt: "never open a file with production in its name." Decide now: does that instruction, on its own, change anything the filesystem still allows?

It does not, and the tier decision record is where the team writes down what actually would.

markdown
# fleet/containment.md

## What I fear
The overnight test-fixer agent runs unattended and can reach a
stray .env.production file left in its worktree from a past
debugging session. The fear: the agent reaches production
credentials or the production database while nobody is watching.

## Tier chosen: microVM (Firecracker-backed sandbox)
- Stops: kernel-level escape, and exfiltration of anything not
  explicitly copied into the sandbox in the first place
- Does not stop: reach to whatever the sandbox's own network path
  allows; egress policy is still a separate decision (lesson 7)
- Startup: well under the agent's own thinking time per turn
- Cost: roughly $0.17/agent-hour at the default sandbox size
- Condition that would downgrade this: if .env.production is
  removed from every path an unattended run can reach, and a
  human reviews the diff before anything runs against a live
  system, a container is enough

Illustrative composite. Coral Fintech is invented for this lesson; the fear and the fix are drawn from documented incident patterns, not one company's record.

The reasoning that gets the team to microVM rather than something cheaper is specific, not general caution. A container would stop the agent from reaching another agent's process, but it shares the host kernel, so a compromised test-fixer process is one exploit away from anything the host itself can reach, .env.production included if it is ever mounted or copied in again by habit. Removing the stray file is still the first fix, and the team does it the same afternoon. But the tier decision exists for the case where someone forgets, six months from now, and copies a template that still has it: the microVM's separate guest kernel is the boundary that holds even when the file-hygiene fix eventually lapses, which is the entire argument for containment beating instruction. It is also, concretely, what the real July 2025 incident did not have: the freeze that agent had agreed to existed nowhere outside its own context window, so the moment its plan drifted, nothing else in the stack caught it before the database was gone.

Faded case

Skip to the open case if this is familiar. A five-person team runs agents during business hours only, always with a human watching the diff before anything merges, on a repository with no production credentials anywhere in its environment or its git history. Decide the tier, naming the fear it is meant to stop.

Open case

A twelve-repo overnight regression sweep runs across shared build infrastructure, using one service account with broad cloud access that every repo's CI already shares, with no human on call until morning.

Where this breaks

Containment never stops the injection itself, only the later stages of the chain that follows it; a well-contained agent can still read a poisoned instruction from a fetched page or a repository file, it just cannot carry that instruction as far. The tier decision is also silent on cost at fleet scale: running twenty agents in microVMs prices very differently than running two, so the per-agent-hour figure in fleet/containment.md needs the cost model from lesson 3 before it becomes a real budget line rather than a single sample number. And a tier is not a credential policy by itself: a microVM that inherits a long-lived, broadly scoped token is not actually contained just because its kernel is separate, since the token can still reach everything it was ever scoped to reach from inside that kernel. That decision is next.

A tier also does nothing about what an agent willingly pulls in from outside. Package-registry compromise is not a hypothetical for agent fleets specifically: the first half of 2026 saw 37 tracked supply-chain campaigns publish 497 malicious packages, roughly two and a half times the campaign count of all of 2025, with AI-agent-specific delivery mechanisms, a poisoned skill, a poisoned MCP server config, hidden instructions in a repo's own instructions file, confirmed in a quarter of the tracked campaigns (phoenix.security, observed 2026-09-11, confidence: medium). A microVM contains that compromised package exactly as well as it contains anything else running inside it, which is to say it stops the package from reaching outside the box; it does nothing to stop the agent from installing the package in the first place, or from that package doing damage to everything already inside the box with it. A minimum release-age gate on new dependency installs closes part of that gap by giving community detection time to catch a bad release before an agent resolves it, but it protects only new installs, not a version already sitting in a lockfile.

Key Takeaways

  • Name the fear before naming a tier; the tier follows from the fear, not the other way around.
  • Bare process and worktree stop nothing beyond file and branch collisions between trusted agents.
  • A container's namespace boundary still shares the host kernel; a microVM's does not.
  • Remote or cloud VMs contain damage to a machine you can afford to lose.
  • Price the chosen tier per agent-hour before committing, not after.
  • Containment stops what an agent does, never what it decides to do.

What You Have Now

fleet/containment.md — a tier decision record naming what each tier stops and what it costs. It names the specific thing you fear, the tier you picked to stop it, what that tier costs per agent-hour, and the condition that would change your answer. It sits in your Fleet Kit next to isolate.sh and port-map.md from the previous lesson: that launcher assumed a tier, and this file is the record of which one you chose and why. It serves the Isolate stage, and the next lesson wires your permission policy to match it.

Further Reading

  • firecracker-microvm.github.io: the microVM technology underneath most sandbox vendors, with the boot-time numbers.
  • genai.owasp.org, OWASP Top 10 for Agentic Applications 2026: the chain view of what containment does and does not stop.
  • containers.dev/implementors/json_reference: the devcontainer spec for defining a container tier as versioned, diffable config.
  • docs.github.com Codespaces billing docs: a fully sourced dollar-per-hour example for a persistent remote tier.
  • northflank.com's write-up on scaling agent sandboxes: choosing an isolation backend, gVisor against Firecracker or Kata, per workload.
  • incidentdatabase.ai/cite/1152: the incident record behind this lesson's opening, an agent that deleted a production database it had agreed to leave alone.
  • phoenix.security's 2026 supply-chain campaign tracker: the package-compromise numbers behind "Where this breaks," and why containment alone does not cover them.

Exercises

  1. Name the thing you fear about your current agent setup in one sentence, then run it through the decision tree to find your tier.
  2. Price your chosen tier per agent-hour using a real vendor page, and write both into fleet/containment.md.
  3. Find one place in your own environment where a "contained" agent still inherits a credential or a mounted path that defeats the tier you picked.

Check your understanding


Reading is free — your progress isn't being saved

Nothing you did on this page is recorded. Paid students get saved progress and verified completions, recorded quiz answers, the spaced-repetition review queue, labs, and a certificate for each course they finish.

30-day money-back guarantee. One-time payment — lifetime access and updates.