Run AI-generated code without crashing.

When an LLM writes an infinite loop, Trytet traps it in microseconds. Every Wasm instruction is metered. Every memory allocation is capped. The sandbox dies — your process doesn't.

Get started GitHub

Why Trytet

Running AI-generated code means choosing between speed, safety, and control. Each approach makes a different trade-off. Trytet adds fuel metering and snapshot/fork — two primitives the other options don't have.

Bash Docker Firecracker V8 isolates Wasmtime Trytet
Fuel metering no timeout only timeout only timeout only yes yes
Memory caps no cgroups cgroups V8 heap limit yes yes
Startup <1ms ~500ms ~125ms <1ms <1ms <500µs cached
Snapshot / fork no no snapshot only no no yes
Zero config yes no no yes no tet setup

If you're running your own code, Bash is already there. If you're running LLM-generated code in production, fuel metering turns hangs into errors, and snapshot/fork lets agents checkpoint state and explore branches. That's the trade-off.

How it works

Code runs in a WebAssembly sandbox backed by Wasmtime. Every CPU instruction burns fuel from a budget. When fuel hits zero, execution traps deterministically. Memory is capped per sandbox. The caller gets a structured error instead of a hung process.

<500µs
Cached cartridge call
~50ms
MCP server boot
8
MCP tools
0
CI test failures

Install

macOS

curl -sL https://github.com/bneb/trytet/releases/latest/download/tet-darwin-aarch64.tar.gz | tar xz
./tet doctor
./tet setup                # registers with Claude Desktop, Cursor, and agy
./tet mcp --list-tools     # lists 8 available tools

Docker

docker pull ghcr.io/bneb/trytet:latest

SDK

npm install trytet-client     # TypeScript
pip install trytet-client     # Python

Tools

trytet_executeExecute JavaScript or Python in a sandboxshipped
trytet_snapshotCapture agent memory and filesystem stateshipped
trytet_forkBranch a new agent from a saved snapshotshipped
trytet_js_evaluatorExecute JavaScript with fuel and memory limitsshipped
trytet_regex_evaluatorRun regex patterns (ReDoS-protected)shipped
trytet_jmespath_evaluatorQuery JSON with JMESPath expressionsshipped
trytet_scraperParse HTML with CSS selectorsexperimental
trytet_structured_dataSQLite queries over JSON arraysexperimental

Snapshot & Fork

Snapshot captures an agent's memory and filesystem state. Fork branches that state into a new, independent agent. Checkpoint before risky operations. Explore branches without repeating setup.

# Start the API server
tet up

# Execute a Wasm payload
curl -X POST http://localhost:3000/v1/tet/execute \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <boot-key>" \
  -d '{"payload":[...],"allocated_fuel":1000000,"max_memory_mb":10}'

# Snapshot the agent
curl -X POST http://localhost:3000/v1/tet/snapshot/{tet_id} \
  -H "Authorization: Bearer <boot-key>"

# Fork from the snapshot
curl -X POST http://localhost:3000/v1/tet/fork/{snapshot_id} \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <boot-key>" \
  -d '{"allocated_fuel":1000000,"max_memory_mb":10}'