My first cloud agent, and the containers I built for it
November 2026 · 6 min read
The starting point
At Getraline I rewrote Sintesia, our agentic platform, from scratch. The previous version sat on a fixed graph of agents: it could chain tool calls and answer, but it could not really work on data. And the requests we were getting were analysis requests, cross two datasets, find the outliers, hand me a report.
The idea I bet on was simple to state: what makes a coding agent like Claude Code good is not only the model, it is that it has a place to work. A shell, a filesystem, the ability to write code, run it, read the result and try again. I wanted that, in the cloud, for data analysis.
The constraint
An agent that runs code it wrote itself needs a box around it. And the data it works on is customer data, so the box had to live on infrastructure we control. That ruled out the easy path and set the shape of everything else: every session gets its own Docker container, and I own its whole lifecycle.
What I built
A pool that creates containers, reattaches a session to its container on demand, and destroys it when the session goes idle. A registry so that any replica of the API can find which container belongs to which session. The API itself is stateless: sessions, memory and metadata live in PostgreSQL, files and volumes in S3. A container can die and the workspace comes back.
Inside that workspace, the tools follow one rule: never pour data into the context. A tool that fetches three thousand rows writes them to a file and returns only the schema. The agent then does what an analyst would do, it greps, writes a script, runs it. The number in the final report was computed by code, not guessed by a model.
I built this on trpc-agent-go, and ended up contributing the pieces I needed upstream: artifact storage, persistence, and the per-session containerized workspace.
Where it falls short
It works, and it is in production. It is also not how you would build this today, and I would rather say it plainly.
Isolation first. A Docker container is namespaces and cgroups on a kernel shared with the host and with every other session. For code you wrote and reviewed, fine. For code a model writes on the fly, possibly steered by whatever it just read in a document, it is the weakest boundary you can pick: one kernel bug and the wall is gone. The current baseline for untrusted code is a dedicated kernel per workload, a microVM like Firecracker, or at least a user-space kernel like gVisor in front of the real one.
Then the lifecycle. My pool, my registry and my reattach logic are a hand-rolled, slower version of what sandbox runtimes now do natively. I persist a workspace by syncing files to S3 and rebuilding a container around them. A modern sandbox snapshots the machine, pauses it, and resumes it later with its filesystem intact, on some platforms with memory and running processes too. And a cold container is slow next to a microVM restored from a snapshot.
Last, I own all of it. Every edge case of a container that died mid-run, every orphan to clean up, is code I maintain, and none of it is what makes the product valuable.
How I would build it today
The agent would talk to a small workspace interface: run a command, read a file, write a file, snapshot, resume. Behind it, a sandbox built for agents instead of my pool. Managed if the data allows it, E2B, Modal, Daytona and the cloud providers all ship one now. Self-hosted on microVMs if the data has to stay home, which was my case, several of these runtimes are open source.
One sandbox per session, paused when the user goes quiet, resumed on the next message. No registry to keep in sync, no volume choreography, no reattach path to debug. Outbound network closed by default, opened only toward the APIs the tools need. Weeks of infrastructure become a dependency and a config file.
What I would keep exactly as is, because none of it depends on the box: files instead of context, state outside the process, the agent computing in code, prompt caching, and tracing on every run.
What building it the hard way taught me
I do not regret it. Writing the lifecycle myself is why I understand what a sandbox actually is: an isolation boundary, a filesystem that has to outlive it, and a mapping from a conversation to a machine. I can now read the docs of any sandbox product and know which of my problems each feature exists to solve, and which trade-off hides behind a cold start number.
It taught me where the difficulty of agents really is. Not in the loop, which is a few lines. In everything around it: what enters the context, what stays on disk, what gets cached, what you can observe when a run goes wrong. The container was the visible part. The harness was the work, and that part has aged well.
And it changed how I decide what to build. I treated infrastructure as the product because it was the hard, fun part. Building a new kind of system by hand once is a good way to learn its shape. After that, the right move is to buy the commodity and keep your hands on what makes the product yours.