Overview of cersei-vms sandbox and VM isolation
maincersei-vms provides a pluggable sandbox runtime layer for Cersei coding agents. It prevents agents from executing shell commands or editing files directly on the host machine, providing isolation and security.
Key Capabilities
- Sandbox Runtimes: Supports different execution environments via the
SandboxRuntimetrait. - Per-sandbox Surface: Each
Sandboxprovides access tocommands()(for running, streaming, or signaling processes) andfilesystem()(for reading, writing, listing, and managing files). - Cross-sandbox Primitives: Allows parallel agents to communicate and share state safely through host-mediated primitives without direct network links:
Volume: Host-mounted directories.Mailbox: Broadcast pub/sub messaging.KvStore: Versioned Content-Addressable Storage (CAS).
- Snapshots: Capture the state of a sandbox using
Sandbox::snapshot() -> SnapshotIdand restore it usingSandboxRuntime::restore(&id). For Docker, this usesdocker commit; for local runtimes, it copies the directory. Manifests are stored in~/.cersei/vms/snapshots/.
use cersei::prelude easily;
use cersei::vms::prelude easily;