Skip to content
Tech News
← Back to articles

The agent harness belongs outside the sandbox

read original get Sandbox Environment Testing Kit → more articles
Why This Matters

The placement of the agent harness—inside or outside the sandbox—has significant implications for security, failure modes, and scalability in multi-user environments. External harnesses enhance security by keeping credentials out of the sandbox, making them more suitable for complex, shared systems. Conversely, internal harnesses offer simplicity and ease of reuse, ideal for single-user setups.

Key Takeaways

An agent harness is the loop that drives an LLM. It sends a prompt, gets a response, executes the tool calls the model requested, feeds the results back, and repeats until the model says it's done. Every production agent has one. The question is where it runs.

There are two answers. They have different security properties, different failure modes, and different implications for what the agent can do. The tradeoffs also look different depending on whether you're building a single-user agent (one engineer on a laptop) or a multi-user one (dozens of engineers in the same organization sharing the same agent). We're in the multi-user camp, which surfaces problems single-user builders don't hit.

The two architectures

Harness inside the sandbox

The loop lives in the same container as the code it's working on. LLM calls go out from inside the container. Tool calls (bash, read, write) execute locally. Skills, memories, and anything else the harness tracks are files on the container's filesystem.

This is what claude does when you run it on your laptop, and what it looks like when you spin up Claude Code in a remote container. If you're building a single-user agent, you can grab the Claude Code SDK and ship something that works.

Harness outside the sandbox

The loop runs on your backend. When it needs to execute a tool, it calls into a sandbox over an API. The sandbox runs the tool and returns the result. The loop never enters the sandbox.

Tradeoffs

Running the harness inside the sandbox has a few things going for it. The execution model is simple: one container, one process tree, one filesystem, one lifetime. You can reuse off-the-shelf harnesses as-is. Skills and memories work unchanged because they assume a local filesystem and they get one.

... continue reading