
~/sandbox.ts
1// npm install @luxorai/sandbox2import { LuxorSandbox } from "@luxorai/sandbox";34const sandbox = new LuxorSandbox();56await using session = await sandbox.createAndWait({7cpuCores: 2,8memoryMb: 4096,9});1011const result = await session.exec("bash", {12args: ["-lc", "uname -a && whoami"],13});1415console.log(result.stdout);
~/sandbox.go
1// go get go.luxor.ai/sandbox2package main34import (5"context"6"log"7"time"89luxorsandbox "go.luxor.ai/sandbox"10)1112func main() {13ctx := context.Background()1415client, err := luxorsandbox.New()16if err != nil {17log.Fatal(err)18}19defer client.Close()2021session, err := client.CreateAndWait(22ctx,233*time.Minute,24luxorsandbox.WithCPUCores(2),25luxorsandbox.WithMemoryMB(4096),26)27if err != nil {28log.Fatal(err)29}30defer session.Close(ctx)3132result, err := session.Exec(33ctx,34"bash",35luxorsandbox.WithArgs("-lc", "uname -a && whoami"),36)37if err != nil {38log.Fatal(err)39}4041log.Println(result.StdoutString())42}
~/sandbox.py
1# pip install luxor-ai2from luxor_ai import Sandbox34with Sandbox.create(name="demo", cpu_cores=2, memory_mb=4096) as sb:5result = sb.exec("bash", "-lc", "uname -a && whoami")6print(f"exit={result.exit_code}\n{result.stdout_text}")
~/sandbox.sh
1# Spin up a sandbox2luxor sandbox create3# Run a command4luxor sandbox exec -c 'uname -a && whoami'5# Connect over SSH6luxor sandbox ssh7# Pause compute billing8luxor sandbox pause9# Resume the sandbox10luxor sandbox resume11# Terminate the sandbox12luxor sandbox terminate13# See all sandboxes14luxor sandbox list
Fleet96 sandboxes
Active
96Time to running
0.84sp50Sandboxes
Isolated Linux VMs for AI agents. They boot in under a second and never cold start. Give your agent root without giving it yours.
Learn more about Sandboxes