Isolated agent environments (devbox model)

The devbox model gives each agent task its own isolated environment, created at task start and destroyed at task end, in which the agent never holds the key: a broker or egress proxy attaches credentials per request, so nothing secret sits in prompts, files, env vars or a third-party key store.

L3 · SYSTEMATICWhat this level takes
MUSTNot met, not at this level
  • Isolated agent environments (devbox model) prevent agents from accessing other projects
  • Pre-warmed containers with codebase at HEAD and dependencies installed are available
  • Network isolation prevents agents from reaching production systems
SHOULDExpected in practice, not required
  • Container warm pool size matches team's agent usage patterns
  • Network isolation rules are tested and audited quarterly
  • Credentials are injected at run time from a vault or broker, never stored in prompts, files or evaluation sandboxes
  • The agent never holds credentials directly; a broker or egress proxy attaches them per request
  • Extensions, mods and plugins that run beside the sandbox are inventoried and allowlisted
EVIDENCEHow you would check
  • Devbox configuration showing per-project isolation boundaries
  • Pre-warmed container pool metrics (pool size, warm hit rate, cold start rate)
  • Network policy configuration (Kubernetes NetworkPolicy, firewall rules) blocking production access
  • Credential broker or egress proxy configuration showing per-request credential injection
DEPENDS ON
  • Infrastructure L2 (Agent Runtime & Sandboxing) - basic sandboxing must be in place before isolation layering
  • Infrastructure L2 (Build System) - build caching required for pre-warmed container efficiency

What It Is

The devbox model is the architectural pattern where each agent task gets its own isolated environment, created at task start and destroyed at task end. Instead of running agents in long-lived shared environments (a developer's laptop, a persistent Codespace), you create a fresh environment for each task, give it exactly the resources and credentials the task needs, run the task, and then destroy the environment. The environment is the task's container - it lives exactly as long as the task and no longer.

The term "devbox" was popularized by Stripe's internal agent infrastructure, where every agent task gets a dedicated compute environment with the codebase pre-cloned, dependencies pre-installed, MCP tools available, and network access restricted to what the task needs. The environment spins up, the agent works, the environment tears down. No state persists between tasks except what is explicitly committed to the repository or saved to an artifact store.

The devbox model solves two problems that earlier approaches leave open. First, it eliminates long-lived credential exposure: credentials are injected at task creation time and revoked when the environment is destroyed, so there is no credential that accumulates risk by existing indefinitely. Second, it enables true parallelism: because each task has its own isolated environment with its own filesystem and network space, ten tasks can run simultaneously without any risk of interference.

The technical implementation can range from Docker containers (accessible, good enough for L3) to Firecracker microVMs (near-VM isolation with container-speed startup) to full VMs (maximum isolation at higher startup cost). At L3, Docker containers are the standard implementation. At L4, Firecracker becomes relevant because it provides stronger isolation without sacrificing the speed that makes the per-task model practical.

Commercial realizations of the devbox model are now shipping. Cursor 3's self-hosted cloud agents (March 25, 2026) represent a turnkey implementation - code and tool execution stay in the organization's own network while the IDE manages environment lifecycle. Claude Code Computer Use (March 23, 2026) adds a new dimension: agents can now interact with desktop applications, not just terminal and filesystem, which extends the devbox model's isolation requirements beyond code execution to GUI-level sandboxing.

The credential half of the model has one non-negotiable rule: credentials are injected at run time from a vault or broker, and never live in prompts, files baked into the image, or evaluation sandboxes. Anthropic's September 2026 threat report describes why. An attacker used prompt injection against an AI vendor's automated evaluation sandbox, and the sandbox handed over production API keys for several providers; the follow-on campaign hit around 30 AI companies in about four days. The sandbox was isolated in every sense except the one that mattered - it held long-lived production credentials that the agent inside it could read and repeat. A devbox that receives a short-lived token from a broker at start-up, and loses it at teardown, has nothing comparable to give away. The same rule covers eval and test environments: they run agent-controlled input by design, so they get the same brokered, task-scoped credentials as any production devbox, not a convenient shared key.

October 2026 turned that rule into a stronger one: the agent never holds the key at all. Injecting a short-lived token into the devbox is better than baking a long-lived one into the image, but the token still sits in an environment variable the agent can read, print or send. The pattern that spread in October keeps the secret outside the sandbox entirely: a credential broker or egress proxy that the agent cannot reconfigure attaches the credential to each outbound request on the way out. Infisical raised $40M (27 October) for exactly this "Agent Vault" proxy; Alibaba's OpenSandbox 1.2.0 (28 October) shipped a Credential Vault held by the egress sidecar; strands-agents/box injects credentials "without exposing secrets to the LLM"; rudderlabs/devbox runs "one sandbox per task, no real secrets inside"; trigger.dev replaced long-lived environment keys with short-lived run tokens, and Buildkite moved to pipeline-scoped secrets. The pattern went from one mention in the radar in September to more than a dozen in October.

The counter-example came the same month. Attackers breached an older system behind OpenCode Console, where users could store AI provider keys; the stored keys of 1.4% of Console users were stolen and burned, with unauthorised charges in the hundreds of dollars and a few over $1,000 (the open-source CLI was not affected). A SaaS that "stores your keys" for convenience is a vault you did not choose and cannot audit. LiteLLM's backdoored 1.107.0 release (21 October) made the same point from the other side: its payload went straight for cloud credentials, provider keys and the upstream keys stored in LiteLLM Proxy's database, and stolen AWS credentials were used for Bedrock within about three hours (Wiz). Wherever keys accumulate, someone will come for them.

Why It Matters

  • True task isolation - each devbox sees only its own filesystem and credentials, so tasks cannot accidentally or intentionally interfere with each other's state, eliminating a class of bugs that are very hard to debug in shared environments
  • Credential lifecycle matches task lifecycle - credentials exist only for the duration of the task; there is no credential that becomes stale, forgotten, or accumulated by multiple historical tasks
  • Nothing for an injected prompt to steal - when keys arrive from a broker at run time and never appear in the prompt, the repository or the image, a prompt injection that takes over the agent finds no production key to hand over; in September an injected evaluation sandbox did exactly that for several providers' keys
  • A hijacked agent has no key to leak - when a proxy outside the sandbox attaches credentials per request, a prompt injection, a malicious dependency or a trojanized extension inside the devbox can make calls the proxy allows, but cannot copy a reusable key to use elsewhere
  • Enables high-velocity parallel execution - ten simultaneous agent tasks in ten isolated devboxes is the natural execution model at L4-L5; this parallelism is only safe in isolated environments
  • Post-task forensics are straightforward - if a devbox produced unexpected behavior, you can snapshot the environment before destruction and investigate it independently; this is impossible in shared long-lived environments
  • Reproducible from the same inputs - given the same codebase state, same task specification, and same environment definition, a devbox will produce the same result every time; this reproducibility is the foundation of reliable automated agent pipelines

Getting Started

  1. Define the devbox specification - Write a YAML or JSON specification that defines what a devbox needs: base image, codebase to clone, credentials to inject, network access to permit, and resource limits (CPU, memory, disk). This specification is the single source of truth for what an agent task environment looks like.
  2. Build the base image - Create a Docker image that has the agent runtime, language dependencies, and common tools pre-installed. This image is the foundation of every devbox. Keep it under 1 GB and tag it with a specific version so all devboxes use the same base.
  3. Implement task-scoped credential injection - Write a service (or use HashiCorp Vault) that generates short-lived, task-scoped credentials at devbox creation time and revokes them at destruction time. Each devbox gets a unique set of credentials that are valid only for its lifetime. Treat this as the floor, not the target.
  4. Move the key out of the agent's reach - Route the devbox's outbound calls through a credential broker or egress proxy the agent cannot reconfigure (Infisical Agent Vault, OpenSandbox Credential Vault, microsandbox scoped secret substitution, or your own proxy on Vault), and have it attach the credential per request and per destination. Inside the devbox the agent sees a placeholder or nothing. Check with env, the process list and the filesystem that no usable secret is reachable from inside the sandbox.
  5. Stop storing provider keys in third-party tools - Inventory every SaaS, console or gateway where developers have pasted AI provider keys "so the agent can use them". Move those keys behind your own broker, rotate the ones that were stored elsewhere, and put a hard spend cap on every provider account so a stolen key has a ceiling.
  6. Put eval and test sandboxes under the same rule - Audit every environment where an agent or model processes untrusted input - evaluation harnesses, benchmark runners, test sandboxes - for long-lived production keys in environment variables, config files or system prompts. Replace them with brokered, task-scoped credentials or with keys to a separate, spend-capped account that has no production reach.
  7. Build the devbox lifecycle manager - Create a service that handles devbox creation, monitoring, and destruction. At minimum: create a container from the base image, inject credentials, clone the codebase at the specified commit, start the agent process, and destroy the container when the agent exits or a timeout is reached.
  8. Integrate with your task queue - Agent tasks should be submitted to a queue and picked up by the devbox manager. The queue provides backpressure (limit the number of simultaneous devboxes), retry logic (restart failed tasks), and observability (track task status, duration, and outcome).
  9. Validate isolation - After building the devbox infrastructure, verify isolation with adversarial tests: can a process in devbox A read files in devbox B's filesystem? Can a process in devbox A make network calls to internal systems that should be blocked? Can a process escape the container and access host resources? These tests should be run as part of the infrastructure validation suite.
TIP

Build devbox destruction into the task lifecycle from day one, not as an afterthought. Environments that are "temporary" but never actually destroyed accumulate credentials, disk space, and running processes. A hard timeout (4 hours for interactive tasks, 24 hours for batch tasks) and automatic destruction on timeout is not optional - it is the mechanism that makes the model work.

Common Pitfalls

Making the environment too fat to spin up quickly. A devbox that takes 5 minutes to start is not a devbox - it is a slow dev environment. Target under 60 seconds for devbox spin-up and invest engineering time in reducing startup time. The biggest levers are pre-warming (covered in the pre-warmed containers guide) and image optimization (removing unnecessary dependencies).

Not destroying environments on agent failure. Agents that fail midway through a task leave behind partially-modified environments. If these environments are not destroyed, they accumulate. Worse, if they are reused for new tasks, the partial state from the failed task can corrupt the new task's execution. Treat agent failure as a destruction trigger, not a pause signal.

Sharing a devbox between tasks. The performance temptation to reuse a running environment for a subsequent task undermines the isolation model. If you need to reuse environments for performance, implement a "clean slate" operation that reverts all changes, re-injects fresh credentials, and verifies the environment state before starting the new task. This is operationally complex and usually not worth the complexity compared to pre-warmed containers.

Logging everything the agent does without filtering sensitive data. Devbox logs are valuable for debugging, but agents read files (including files that contain secrets) and those file contents can appear in logs. Implement log scrubbing that removes known secret patterns before logs are written to the log store. Common patterns to scrub: API keys matching known formats, connection strings, private key material.

Treating the eval sandbox as outside the security perimeter. Evaluation and test environments exist to run adversarial or untrusted input, yet they are often wired with a real provider key "because it is only for testing". Anthropic's September threat report describes an evaluation sandbox that, once prompt-injected, handed over production API keys for several providers and seeded a campaign against about 30 AI companies. If an environment runs agent-controlled input, it is inside the boundary and gets devbox credential rules.

Treating an injected environment variable as "out of reach". A short-lived token in $GITHUB_TOKEN is still a token the agent can read, echo into a log or send to an attacker-controlled URL, and October's tensorlake worm and LiteLLM backdoor both harvested exactly these. Short lifetimes limit the damage; a proxy that keeps the secret outside the sandbox removes the thing to steal.

Letting a convenience tool hold the keys. The OpenCode Console breach stole provider keys that users had stored in a hosted console, and the bills arrived before anyone noticed. If a tool asks you to paste a provider key so it can run agents for you, that tool is now part of your secret-management perimeter, whether or not you audit it.

No resource limits on devboxes. An agent task that runs in a container with no CPU or memory limits can consume all available resources on the host, starving other devboxes. Always set CPU and memory limits. A reasonable baseline is 2 CPU cores and 4 GB RAM per devbox, adjustable per task type.

How Different Roles See It

BobHEAD OF ENGINEERING

Bob's team has adopted Docker sandboxing at L2 and it is working well for individual developers. But as the team starts running more parallel agent tasks, they are seeing conflicts: two developers running agents on the same file at the same time, an agent in one context picking up changes from an agent in another context. The shared-environment model is starting to show its limits.

What Bob should do: Bob should recognize that the shared-environment conflicts are the forcing function to move to the devbox model. He should assign an infrastructure engineer to design the per-task isolation architecture using the team's existing Docker infrastructure as a starting point. The design does not need to be perfect - a simple per-task container manager with basic credential injection and automatic cleanup is enough to solve the conflict problem. Bob should time-box the design to two weeks and the initial implementation to four weeks, with a goal of running the team's most active agent pipeline in devboxes by the end of the sprint.

SarahPRODUCTIVITY LEAD

Sarah has noticed that developers are serializing agent tasks that could be parallelized because they are worried about conflicts in shared environments. The theoretical throughput of parallel execution is not being realized because the infrastructure does not safely support it. Developers who could be running 3-5 parallel agents are running 1-2 out of caution.

What Sarah should do: Sarah should quantify the parallelism gap. If developers are running agents sequentially out of conflict avoidance, how many hours per week are being lost to that serialization? The calculation is not hard: estimate tasks per day, average task duration, and the fraction that could have run in parallel. Even conservative assumptions will show a significant lost-throughput number that justifies the devbox infrastructure investment. Sarah should present this calculation alongside the devbox proposal: "here is what parallel execution would give us, here is what it costs to build the isolation that makes it safe."

VictorSTAFF ENGINEER - AI CHAMPION

Victor has been running multi-agent workflows using git worktrees for isolation and it works reasonably well for his personal workflow. But he can see the fundamental limitation: worktrees are isolated in terms of the codebase, but the surrounding environment (credentials, network access, running services) is still shared. Two agents running in different worktrees can still interfere at the environment level.

What Victor should do: Victor should build a local devbox manager as a weekend project - a simple script that creates a Docker container for each agent task with its own isolated filesystem (not just a separate worktree) and its own credentials. The script should accept a task specification, spin up the container, run the agent, and clean up. Running this for a week will reveal the operational challenges (what happens when a task fails? how do you inspect a running devbox? what are the right resource limits?) that the infrastructure team needs to solve for the org-wide implementation. Victor's operational learnings should feed directly into the infrastructure design.

How This Guide Changed

What each edition changed in this guide, newest first.

  1. V1.8November 2026LATEST

    Raised the credential rule from "inject short-lived keys at run time" to "the agent never holds the key". A broker or egress proxy outside the sandbox now attaches credentials per request, a pattern that went from one radar mention to more than a dozen in October (Infisical's Agent Vault, OpenSandbox's Credential Vault). The OpenCode Console breach, where stored provider keys were stolen and burned, added a warning about SaaS tools that hold your keys for you.

  2. V1.7October 2026

    Made run-time credential injection from a vault or broker an explicit part of the level, with a hard rule that keys never sit in prompts, files or evaluation sandboxes. Anthropic's September threat report described a prompt-injected evaluation sandbox handing over production keys for several providers, which seeded attacks on about 30 AI companies in four days - an isolated environment that still leaked because it held credentials worth stealing.

  3. V1.3June 2026

    A light month. The dynamic-credentials reference now points at Vault's database secrets engine, which is the concrete case most teams reach for first when they stop baking long-lived tokens into task environments.

  4. V1.1April 2026

    Recorded the first commercial realizations of the devbox model. Cursor 3's self-hosted cloud agents (March 25) keep code and tool execution inside the organization's own network while the IDE manages environment lifecycle, and Claude Code Computer Use (March 23) extended the isolation requirement beyond code execution to GUI-level sandboxing, because agents can now drive desktop applications rather than only terminal and filesystem.

  5. V1.0March 2026

    Named the pattern and the discipline it demands: the environment lives exactly as long as the task and not a moment longer. The first version took the term from Stripe's internal agent infrastructure and drew out what makes it work - codebase pre-cloned, tools pre-authenticated, network access scoped to the task, and nothing surviving teardown except what was deliberately committed.

Where does your team actually sit on this?

This guide describes one level of one area. Run the assessment to place your team across all 16 areas, see which gates you have passed, and get a report you can take to your stakeholders.

Start the assessment