Skip to content
Sandweave documentation

Sandboxes for your agents

Run code, control a desktop, or interact with a VR game. Create a sandbox with Python and scale to a pool across your own machines.

Sandweave runs Linux sandboxes without host sudo or KVM. Templates supply the software and controls; you choose the resources, setup scripts, and lifetime.

Run your first command

uv pip install sandweave
from sandweave import Sandbox

with Sandbox() as env:
    result = env.run("python -c 'print(2 + 2)'")
    print(result.stdout)

This prints 4. Sandweave prepares the coding template on first use, then terminates the sandbox when the with block ends. The worker needs Linux x86-64 and Python 3.11+. See installation for host requirements.

What do you want to run?

Three things to know

A template is a recipe. It defines installed software, startup services, and controls. Extend a built-in template or provide your own setup script.

A sandbox is a running environment. Run commands and interact with its files and controls. Save a cache when you want to reuse installed software.

A cluster connects workers. Weave assigns sandboxes to machines with available resources. The same Sandbox(...) API works locally or with a cluster address.

Common tasks

Task Start here
Give a sandbox more CPU or memory Resources
Turn off its internet access Networking
Keep it running after Python exits Lifetime and cleanup
Reuse installed packages Caches and snapshots
Keep several sandboxes ready Pools and evaluation
Find a Python method or CLI command Python API · CLI