Documentation

Syva Sandbox

Linux sandboxes from TypeScript or Python.

Overview

A sandbox has its own filesystem, process tree, CPU and memory budget, and optional exposed ports. Use it when application code needs to run untrusted commands, generated code, tests, or preview servers without sharing the host process.

Code

TypeScript
import { config } from "dotenv";
config({ path: ".env.local" });

import { Sandbox } from "@syva/sdk";

const sandbox = await Sandbox.create({
  image: "node-22:base",
});

const result = await sandbox.runCommand("printf", ["Hello from Syva Sandbox!\n"]);
console.log(result.stdout.trim());

await sandbox.destroy();

How it works

Reference