Technology1 min read

Replit rebuilt its sandbox engine with microVMs

By · Published by Everything Blog

In short

Replit updated its underlying environment by substituting a legacy Docker setup with lightweight microVMs driven by KVM and Cloud Hypervisor. While internal sandbox processes still use containers, the virtualization layer prevents cross-tenant exposure to the host and neighboring workloads. The platform optimizes deployment speed by leveraging memory snapshots and device hotplugging to swiftly connect user storage to warm virtual machines. Host communications with each sandbox are coordinated using gRPC over vsock channels, completely bypassing the need for an IP network.

Key points

  • Hardware-assisted virtualization provides robust isolation necessary for safely running a…: Hardware-assisted virtualization provides robust isolation necessary for safely running autonomous artificial intelligence agents.
  • The redesigned sandbox infrastructure powers Replit's Bring Your Own Cloud product across…: The redesigned sandbox infrastructure powers Replit's Bring Your Own Cloud product across Amazon Web Services, Google Cloud, and Microsoft Azure.
  • Custom patches to Cloud Hypervisor enable efficient snapshot portability and rapid storag…: Custom patches to Cloud Hypervisor enable efficient snapshot portability and rapid storage attachment using warm-pooled virtual machines.

Sources checked by our analysis pipeline: 1

Agent sandboxes are all the rage. A new sandbox startup is announced every couple of weeks. At Replit, we’ve been running sandboxes for nearly a decade. For years, we’ve run our custom sandbox infrastructure to make it easy for anyone to code online, and now Agents use these sandboxes to build applications without requiring any coding at all.

In the past few months, we finished rolling out a complete rewrite of our sandbox engine to improve security, capabilities, and portability across clouds. Our Bring Your Own Cloud offering brings Replit into customers’ AWS, Google Cloud, or Azure environments. As with most infrastructure work, we had to pull this off without anyone even noticing. We migrated hundreds of millions of projects smoothly, without data loss. In this post, we’ll dive into how we changed the isolation boundary, kept sandboxes fast, and made the new engine work at scale.

In this post, we’ll dive into how we changed the isolation boundary and kept our sandboxes fast. In Part 2, we cover how we orchestrate tens of thousands of microVMs at once on…

Technology