Blog

How we used the Codex App Server to give AI agents a shared computer

, founder ·

Devlog-01: the questions we kept asking, from taking the Codex App Server off the shelf instead of inventing a protocol, to keeping a computer the whole team shares hard to break.

What did we need in the first place?

We wanted AI agents to have a computer a whole team can share, not a laptop that stops when the lid closes. That meant talking to the harness, ideally in a way that already exists, running it in the cloud, and making it hard to break, even with a whole team and an agent working on it at once.

On the left, a laptop asleep, the work stopped. On the right, a computer in the cloud with the AI your team already uses on it, and the team around it.

Could we take a protocol off the shelf instead of building one?

Before building our own way to talk to the harness, we looked at what was already out there. OpenAI had built the Codex App Server to power Codex’s own apps, such as its VS Code extension, and documented it in the open. It already covered most of the protocol we expected to build ourselves: the conversation lifecycle, streamed work, file changes and approvals, already designed and already in use. And it can run over a websocket, which, behind our gateway, lets us reach it across the internet.

What would we have had to build ourselves?

The Codex App Server is the interface behind those apps. Like MCP, it’s JSON-RPC 2.0 and it goes both ways: the client sends requests, and the server streams the agent’s work back as events and sends requests of its own, such as asking the client to approve a command or a file change. It’s built around threads, turns and items. A thread is a conversation between a user and the agent. A turn is one request and the work that follows. An item is one unit of input or output: a message, a command run, a file change, a tool call.

Beyond the agent itself, it has methods to run commands (command/exec) and to read and write files (fs/readFile, fs/writeFile and more), so a client can work with the computer directly. The CLI can also generate a TypeScript or JSON Schema for the exact Codex version you run. OpenAI is clear about the edges: the WebSocket transport is marked experimental and unsupported, and some methods sit behind an explicit experimental opt-in. The implementation is open source, with the server’s README on GitHub.

With a protocol like that, every client is a bridge at most. The web app we’re building speaks it directly; a phone app or a Discord bot needs a small bridge.

The Codex App Server as one line from Codex to the computer in the cloud: the web app plugs in directly, a phone and Discord through small bridges.

What if a team doesn’t use Codex?

The catch is that Codex is the only harness that speaks it, for now. We want teams to bring the AI they already use: ChatGPT, Claude, you name it.

The protocol itself points the way. Running commands and handling files don’t involve the model, so that work can stay with Codex. Claude, or any harness we add to MyManagedAgents later, only has to bridge the AI itself, the conversation with the model, not rebuild everything around it.

Codex handles the commands and the files on the computer. Claude, and any harness after it, plugs in through a short bridge for the AI part only.

What can users break?

We put Codex on a virtual machine in the cloud and added a simple web app on top. It felt good to use. Then we looked at what one wrong command could reach. Anyone with access could delete the wrong folder, read a credential, or knock over the parts that keep the computer running. A computer a whole team shares can’t rely on everyone being careful.

How do we keep them from breaking it?

The first line of defence is the gateway, the only door into the computer. It authenticates every connection, and it forwards only the methods we’ve listed. A new method that shows up upstream is refused until we allow it, which matters because parts of the protocol are still experimental.

Behind it, we moved each part of the computer into its own Docker app, with a narrow job. Secrets and credentials stay outside the agent’s container and are never mounted into it. Each app gets only the folders it needs, read-only where it only reads, and writes only to its own volume. A wrong command can only reach so far.

Locking it down had a cost we didn’t see coming. Every command the agent runs is wrapped in a small sandbox, and on the cloud machines Docker’s default security profile blocked that sandbox outright: commands that worked on our laptops failed on every cloud computer. The fix was to relax the profile for the agent’s container alone, which still runs unprivileged and without access to Docker itself, and let the per-command sandbox be the boundary.

Inside the cloud VM: the gateway at the door, the credentials locked in their own app, and the agent's container reading from allowed folders and writing only to its own volume. The programs it installs sit in the container, marked as not covered.

What doesn’t Docker keep?

Files were safe. Installed programs weren’t. Docker was made to run sealed, packaged apps, not software that keeps changing its own filesystem, and that’s what an agent does all day. Whatever the agent or the team installs lands in the container’s own writable layer, because package managers install into system paths, not onto a volume. A plain update replaces the container, and that layer goes with it.

How does it survive an update?

So we keep the layer. When an update comes, we pause the agent’s container, commit its writable layer into an image, build the new version on top of it, and start the new container. In Dockerfile terms, the new version starts FROM the frozen image. The files on its volume were never in the layer, so they’re untouched.

That only works because the agent’s container carries almost nothing of ours. Our own services each run in a container of their own, and the agent’s holds little more than a small client. So an update copies that client on top and restarts: a few seconds, and it waits until the agent isn’t in the middle of a task.

The update: the agent's container paused and committed into an image, our client built on top as a thin layer, and the container back up a few seconds later.

Would microVMs be cleaner?

Yes. A microVM is a whole small machine, not a sealed app, so it fits a computer people and agents change all day. It gives the agent a disk of its own, so the whole system stays the way the agent left it, with no commit-and-rebuild step. It boots in a fraction of a second, where a new cloud VM with its containers takes minutes. And it can save what’s in memory, so a computer can pause and come back where it was.

Is it worth rebuilding for them? Not yet. It would mean rebuilding how computers start, stop and update, for a gain we can live without for now. It’s something we’ll come back to.

A dashed microVM outline with its own disk and a memory chip, next to two cards: "cleaner than Docker? yes" and "rebuild on it now? no".

What’s next?

Next, we bring the whole team onto the same computer, working together with the AI. That’s the part we care about most, and the next devlog.

If you’ve run agents in containers or microVMs, we’d like to hear what broke for you.

The best way to support us right now: join the waitlist.


For the technical reader

  • Protocol: the Codex App Server speaks JSON-RPC over a websocket (it also runs over stdio). It never faces the internet: our gateway is the only public endpoint. It verifies each caller’s token against Supabase’s published keys, and it routes every request through a deny-by-default allowlist of App Server methods. Thread methods are checked against who may read or send in that chat.
  • Creating a computer: a durable workflow (Upstash Workflow) calls a provisioner service, which runs Terraform for one Compute Engine VM with a separate, protected data disk. Each stage finishes before it returns and is checkpointed, so a retry replays from the last finished stage.
  • The sandbox: each command the agent runs is wrapped in Bubblewrap. On Container-Optimized OS, Docker’s default AppArmor profile blocked Bubblewrap’s mounts (Docker Desktop on our laptops has no AppArmor, so we didn’t see it locally). The agent’s container alone runs with AppArmor and seccomp unconfined, still unprivileged and with no Docker socket, and Bubblewrap’s per-command policy is the boundary.
  • Keeping installed software: the gateway commits the agent’s container, its overlayFS upper layer, as a checkpoint image and keeps the last few generations. The next image is built on the VM from that checkpoint, copying only our binaries on top, so an update is a short restart rather than a rebuild. Updates skip a computer while the agent is busy with a task.
  • microVMs: what they’d add is a writable root disk the agent owns, fast boot, and memory snapshots for pause and resume. Running one inside a cloud VM brings its own questions, which we’ll write up if we go there.