AI Engineer World's Fair 2026
Sandboxes Aren't Optional: 4 Ways to Isolate Coding Agents — Robert Brennan, OpenHands
Loading slides…
Read the talk
Sandboxes Aren’t Optional: 4 Ways to Isolate Coding Agents
Robert Brennan compares local Docker containers, GitHub Actions, dedicated machines and Kubernetes sessions—and explains why moving an agent off your laptop only helps when its access moves with the task.
From a talk by Robert Brennan
At a glance
Ideas worth remembering
Least privilege starts with the task’s required repository, secrets and tools. Restricting those inputs limits the damage from prompt injection or agent mistakes.
Local Docker preserves an interactive checkout-based workflow; remote jobs make scheduled and event-driven execution independent of the laptop.
A dedicated machine separates agents from your workstation, but colocated agents can still share unnecessary credentials and modify one another’s state.
Disposable session environments avoid carrying broken machine state into later runs. Useful outputs can persist separately in files or external systems.
Sandboxing reduces exposure without eliminating escape risks. Choose the execution environment deliberately, even when a tool makes switching environments easy.
From copying snippets to handing over a terminal
The first workflow was simple: ask ChatGPT for a SQL query, paste it into an IDE, run it, then paste the error back into ChatGPT. Robert Brennan, CEO and co-founder of OpenHands, remembers being astonished when the query worked immediately. But the repeated copying soon suggested an obvious improvement: connect the APIs and let software carry the messages.
AI-powered IDEs brought the model closer to the code. Cursor and GitHub Copilot could use repository context and available variable names rather than generate isolated snippets. Agents added another capability: executing the code they wrote, reading errors and searching for explanations. The development loop now included actions in an environment, so the environment’s permissions became part of the agent’s capabilities.
OpenHands followed that expansion, growing from an MIT-licensed coding agent into a platform spanning the agent harness, execution infrastructure and a control plane for monitoring agents at scale. Brennan frames the next transition as moving manually prompted laptop agents into the cloud. Each agent still needs a terminal and filesystem, but it may now work without a person watching every action.
Event-driven work makes that transition useful. A GitHub event, Datadog incident or Slack message can start an agent; one agent might open a pull request while another reviews it. Brennan’s longer-term forecast is full software-development lifecycle automation, potentially without humans reading source code. The immediate engineering question is narrower: how do you give an unattended agent somewhere to work without giving it everything you can access?
Skipped permissions inherit the reach of your account
Brennan asks who runs a local coding agent, then asks users of “dangerously skip permissions” to keep their hands up. “Somehow more hands than before.” The joke captures the attraction: repeated approval prompts interrupt autonomous work, while skipping them lets the agent continue without supervision.
In the unrestricted local setup he describes, the agent can reach the filesystem, environment-variable secrets and credentials stored in the home directory. If those credentials provide access to a production database or Kubernetes cluster, the agent can use that access too. A mistaken command or malicious instruction can therefore affect resources far beyond the repository being edited.
The corrective mechanism is the principle of least privilege: give the agent only what its job requires. For a repository task, that might mean access to the relevant GitHub repository and a few credentials for a local database. First identify those inputs; then construct an environment containing them. This reduces the blast radius of prompt injection or ordinary confusion by reducing what the agent can read, change or use.
1. Docker keeps the local workflow and narrows its inputs
OpenHands originally created a fresh Docker container for each new conversation. The agent received a disposable environment: if it destroyed that environment with a command such as rm -rf /, the recovery was to discard the container and start another. That reset addresses damage inside the disposable environment; the repository, secrets and other resources deliberately exposed to it still determine the agent’s reach.
Selective connections make the container useful without reproducing the whole laptop inside it:
- Repository access. Mount the local Git repository so the agent edits the working copy you already use.
- Application access. Expose application ports so you can inspect the running app in your browser.
- Credentials. Pass specific secrets and environment variables needed for the task.
- Tool access. Run MCP servers on the laptop or inside the container, depending on where those tools belong.
This preserves a familiar division of work: the agent edits your local checkout, while you inspect the changes and decide when to push. The cost is that execution remains tied to the workstation. A laptop has limited capacity for simultaneous containers, and the local arrangement Brennan describes is oriented around manual work rather than an always-running service receiving Slack or Datadog events.
2. GitHub Actions turns repository events into agent jobs
Running Claude Code in GitHub Actions changes where the working copy lives. An ephemeral job clones the repository, runs the agent and sends its work onward before the execution environment disappears. The agent no longer edits the checkout on your laptop. GitHub Actions supplies the job infrastructure and a built-in place to manage secrets.
Two examples show what becomes possible when a laptop prompt no longer starts every task:
- Scheduled maintenance. Every Monday at 9 a.m., an action starts an agent to update dependencies.
- Pull-request review. Opening a pull request starts an agent that reviews the proposed code.
These are separate triggers for separate jobs. Both let repository work begin without a developer keeping a local process alive.
The capacity tradeoff moves from laptop resources to paid job execution. The integration tradeoff is attachment to GitHub Actions’ workflow system. Brennan describes the straightforward setup as GitHub-centered: it does not directly receive Slack or Datadog webhooks. That limitation applies to the integration presented here; the talk does not establish that external events could never be connected through additional infrastructure.
3. A dedicated VM adds persistence—and shared exposure
Another approach puts the agents on a separate computer: a cloud virtual machine or a dedicated Mac Mini. Unlike a disposable Actions job, this machine survives between runs. An agent can modify the system and find those modifications still present two days later. Unfortunately, a broken configuration can survive just as reliably, leaving someone to investigate and repair it.
A VM also provides a place to run scheduled work and receive incoming webhooks. Brennan’s examples include Twilio text messages, Slack messages, Datadog incidents and GitHub events. This gives agents a broader set of automatic starting points than the GitHub-centered setup, with a long-lived environment available between tasks.
But separating agents from your laptop does not necessarily separate them from each other. Consider a code-review agent and a Datadog incident-triage bot sharing a VM and its resources. The reviewer may inherit Datadog access it does not need. It may even be able to edit the triage bot’s memory. The failure is specific: colocating jobs with different responsibilities can pool their credentials and writable state, recreating the least-privilege problem on another machine.
4. A Kubernetes pod per session starts each job fresh
Brennan’s preferred strategy for scalable autonomous work is an ephemeral environment for every agent session, implemented with Kubernetes or a comparable platform. A pod starts, the agent works in its own repository copy, and the session ends after producing something useful, such as a pull request. The execution environment is then discarded.
Starting fresh prevents one session’s damaged environment from becoming the default starting point for the next. Giving each session its own workspace also avoids the shared-workspace problem of the colocated VM example. Those benefits depend on how the environment is provisioned: the least-privilege requirement still determines which repositories, secrets and external systems each session should receive.
Cloud capacity supports more concurrent sessions than a laptop, with CPU and memory becoming explicit costs. Brennan later contrasts a handful of comfortable local runs with thousands of Kubernetes agents; this is a capacity comparison, not a measured throughput result. Cron jobs can start scheduled sessions, while HTTP events from Slack, GitHub or Jira can initiate event-driven work.
Compare the workspace, persistence and trigger—not just the host
Which differences actually change how you work? Brennan compares five dimensions: local versus remote execution, scale, isolation, persistence and triggers. Local execution lets the agent work on your existing checkout. Remote execution gives it another copy and lets the job continue independently of your workstation. Neither choice alone answers how much access the agent receives.
The comparison below separates two easily confused properties: whether the execution environment survives, and whether agents share access within it.
| Setup described | Working copy and scale | Isolation and persistence | Typical starting point |
|---|---|---|---|
| Local Docker | Local checkout; laptop-limited capacity | Fresh container per conversation; selected local resources exposed | Manual prompt |
| GitHub Actions | Cloned remote checkout; paid job capacity | Disposable job environment | Schedule or GitHub event |
| Dedicated VM or Mac Mini | Separate machine; capacity of that machine | Long-lived state; colocated agents may share resources | Schedule; a VM can receive webhooks |
| Kubernetes session | Session workspace; cloud CPU and memory capacity | Separate workspace per session; environment discarded afterward | Cron job or HTTP event |
The crucial distinction is visible in the dedicated-machine row: remote execution can protect your workstation while still leaving agents able to interfere with one another.
Ephemeral execution does not require throwing away useful results. Files can be saved outside the environment, and agents can write to external systems. The difference is that persistence becomes a deliberate choice instead of an automatic consequence of keeping a laptop or VM alive. Remote execution also solves a more human problem: Brennan jokes about biking home with a laptop open so Claude Code will not stop.
Sandboxes reduce exposure; the environment still needs choosing
A sandbox is not a guarantee of containment. Brennan cites an Anthropic testing incident in which an agent reportedly escaped its sandbox and gained internet access; the recording does not provide the exploit details needed to evaluate that example. He also points to container-escape vulnerabilities, including risks from older Docker versions. Sandboxing remains a useful first restriction on an agent’s reach, while the containment mechanism itself can have flaws.
The closing product example, OpenHands Agent Canvas, separates the coding harness from the execution environment. Brennan describes support for Claude Code, Codex and the OpenHands harness, with controls to switch execution into Docker, a remote VM or Kubernetes. He characterizes its default local mode as comparable to running Claude Code with skipped permissions, making the environment selection consequential rather than cosmetic.
The choice follows the work. Quick back-and-forth development may benefit from the local checkout, where you can inspect code as the agent edits it. An event-triggered task expected to run autonomously for several hours benefits from a remote VM or Kubernetes session. Agent Canvas is presented as a way to move between those arrangements: keep the harness you want, then choose the environment—and the access—that the job needs.
Full transcript
Loading transcript…