Follow @zbraniecki, the key technical architect of Perplexity Computer agent’s sandbox platform SPACE!

@zbraniecki: Our team had to build a novel sandbox solution to handle the needs of Computer.

One Computer session can run for days and pause while it waits for a user. Keeping its VM alive wastes memory and compute and restoring from the filesystem alone also loses running processes and memory.

SPACE uses two kinds of snapshots. Disk snapshots run frequently without pausing the VM and let us roll back filesystem changes. Full checkpoints are less frequent and capture the paused VM, including its memory and process state.

When a session is suspended, we upload its full checkpoint to object storage. We only mark it restorable after every artifact has landed. Any node can then fetch the filesystem delta and VM state, so recovery does not depend on the original machine.

Btrfs makes this cheap enough to run continuously. Templates, snapshots, and forks share the same extents until something writes to them. Creating a sandbox becomes a copy-on-write metadata operation instead of a full image copy.

On production traffic, median creation latency fell from 185 ms to 60 ms. P90 fell from 447 ms to 89 ms.