r/devops • • 9d ago

Discussion Main use-case of cloud sandboxes and how it works?

Hey guys, I've been seeing a shift in cloud sandboxes being mentioned a lot lately in agent architecture discussions. I'm trying to understand the difference in them compared to say, just using either a standard Docker container or a basic cloud VM.

My very basic level understanding is that these cloud platforms give agents isolated environments to run code without using your local machine. Additionally I've seen a post on Ramp Inspect where they boot a separate remote sandbox for coding sessions with pre-warmed repo snapshots. However, I still don't see what they do that regular Docker containers don't.

Feel free to correct any misconceptions I have here lol, just trying to make sure how it all works. Thanks!

2 Upvotes

7 comments sorted by

13

u/justrunme1 9d ago

A regular Docker container and a cloud sandbox often look the same from the agent's point of view: an exec API and a filesystem. The difference is the boundary around that process, and the control plane that creates and throws away thousands of short sessions.

Docker shares the host kernel. If the agent-generated code escapes the container, it is on the same kernel as everything else on that machine. It also often inherits whatever the host can reach: the Docker socket, ~/.aws, kubeconfig, SSH keys, the office network. A basic cloud VM is a stronger boundary, but it is slow to boot and expensive if you want a fresh box per coding session.

Most sandbox products sit in the middle. They wrap an isolation layer that is stronger than a plain container (often a Firecracker-style microVM, or a userspace kernel like gVisor) and then sell the session API on top: create, run a command, take a snapshot, destroy. That matches what you saw with Ramp Inspect. The useful part is a pre-warmed filesystem snapshot of the repo and its deps, cloned in a second or two, used for one session, then discarded. You can build that yourself with Docker plus a snapshot store, but then you have also built the product.

Credentials stay off the developer's laptop. The sandbox gets a short-lived, narrow identity, not the person's cloud keys. Egress is usually restricted by default, so a compromised session cannot scan your VPC the way a container on a laptop or a VM in your account can. MicroVMs also start fast enough that you can run many isolated sessions, which a full VM per session does not.

A sandbox does not shrink the blast radius of a token you hand the agent. If the session can push to Git or call prod APIs, isolation of the compute only contains the code execution. Treat those permissions the same way you would for a CI job, and keep a log of every tool call.

If you only need to run trusted CI on your own runners, Docker is still fine. The sandbox model starts to pay off when the code or the tool arguments come from a model, and you cannot let that process sit next to host credentials.

1

u/No-Nefariousness-728 9d ago

Holy, thanks a ton for the breakdown

2

u/tanyadev4827 9d ago

worthwhile

1

u/Geraldwelly 9d ago

Adding to the kernel point above: from running agents against real repos, the part that matters day to day is snapshots, not isolation. The slow bit of any agent task is clone, install and build, so booting from a pre-warmed snapshot in a couple of seconds changes how many attempts you can afford per task. Plain Docker gets you most of that with cached layers, right up until the agent starts installing things at runtime. The trade-off nobody mentions is egress: hand the sandbox network access and real credentials and the isolation stops buying you much.