comp-work/gke-sandboxes
DevOps & Self-hostingRun isolated Linux workspace sandboxes on GKE with gVisor, snapshots, and sleep/wake control.
Project overview
gke-sandboxes runs each cloud agent in a dedicated Linux sandbox inside your own Google Cloud project. Sandboxes keep files, run commands, and can sleep when idle; reopening the same ID wakes the sandbox from a snapshot. Isolation comes from one gVisor pod per sandbox, with incoming traffic blocked and no access to your cloud credentials. The project targets teams that already operate GKE and want an alternative to managed sandbox providers, for which the README lists 16.6¢/hour at 2 vCPU/4 GB versus an estimated 1.9¢/hour for its own cluster.
The TypeScript client is published as @getenergy/gke-sandboxes and works with Node.js 22+ or Bun. Sandboxes accept any container image that has a POSIX shell.
Setup
Deployment is automated through a skill for coding agents. Paste the instruction into Claude Code, Cursor, Codex, or a similar agent:
Set up gke-sandboxes in my Google Cloud project. Follow these instructions step by step:
https://raw.githubusercontent.com/comp-work/gke-sandboxes/main/skills/setup-gke-sandboxes/SKILL.md
The agent deploys the cluster with Terraform, runs a verifier, and shows how to connect a backend. A manual path is available in the deploy guide.
Use from your backend
After deployment, install the client:
npm install @getenergy/gke-sandboxes
Create a client pointed at the cluster, then acquire a sandbox by ID and run commands:
import { GkeSandboxes, KubernetesApi } from '@getenergy/gke-sandboxes';
const sandboxes = new GkeSandboxes(new KubernetesApi(clusterUrl, getGoogleAccessToken), {
namespace: 'sandboxes',
serviceAccount: 'sandbox',
image: 'docker.io/library/debian:bookworm-slim',
});
const { sandbox } = await sandboxes.acquire('session-42', AbortSignal.timeout(300_000));
const { exitCode, result } = await sandbox.process.executeCommand('echo hello');
await sandboxes.sleep(sandbox.id);
clusterUrl and getGoogleAccessToken are placeholders for the endpoint and token function for your cluster. The call returns a running sandbox or wakes one from its snapshot. The client guide covers commands, file upload/download, hooks, and preview links in more detail.
Operating constraints
Sleeping preserves files as a Cloud Storage snapshot, not running processes; this differs from providers such as E2B that can keep memory through sleep. A sweeper stops sandboxes after five minutes of inactivity, and a memory guard terminates a runaway program before it takes down the sandbox. Start time is about 0.5 s when two sandboxes are kept warm; without a warm pool it is roughly 2.7 s. Waking with about 25,000 files takes around 6.5 s. The published 1.9¢/hour cost assumes a large cluster: 520 awake sandboxes spread across machines, with spare machines, disks, system nodes, and snapshot storage included. Small clusters still pay for minimum machines, so the per-sandbox figure does not apply at low scale. Running the cluster, including capacity and upgrades, remains your responsibility. The repository is Apache-2.0 licensed.
HotRepo's take
On the HotRepo new-project list for 2026-11-19, gke-sandboxes recorded 11 new stars and 11 new forks in an observation window of about 1.5 hours, reaching 112 stars. That is early activity in the new-project board and not a GitHub daily rank. The stated cost comparison deserves scrutiny at small scale: the README itself notes the 1.9¢/hour estimate requires roughly 520 awake sandboxes to hold, so readers evaluating it against Daytona or E2B should first size their own cluster floor.
Written by AI from the project's README, updated . The project's own docs are the source of truth.