Open-source fork-on-write microVM sandbox primitive (E2B-compatible surface)
Project description
forkd — Python SDK
E2B-compatible sandbox API backed by forkd.
from forkd import Sandbox
with Sandbox() as sandbox:
result = sandbox.commands.run("python3 -c 'import numpy; print(numpy.zeros(3))'")
print(result.stdout) # [0. 0. 0.]
print(result.exit_code) # 0
Or with explicit lifecycle:
sandbox = Sandbox()
result = sandbox.commands.run("echo hello")
sandbox.kill()
Bonus: warmed-state eval
If your snapshot parent imported numpy, you can skip subprocess overhead and use the warmed PID-1 interpreter directly:
with Sandbox() as sandbox:
out = sandbox.eval("numpy.zeros(5).tolist()") # ~8 ms
# vs commands.run("python3 -c '...'") which is ~108 ms (fresh subprocess)
Requirements
The forkd Rust CLI must be installed and on PATH, plus a parent snapshot
must already exist (forkd snapshot --tag pyagent ...). See the main
README for the full setup.
Status
Pre-alpha. Currently supports:
Sandbox()/Sandbox.create()— spawn one sandboxsandbox.commands.run(cmd)— run command, get stdout/stderr/exit_codesandbox.eval(expr)— eval Python in warmed PID 1sandbox.kill()— terminate
Not yet (blocked on issues #1 + #4):
- Multiple concurrent
Sandbox()instances (all share parent's MAC/IP) sandbox.files.read/write— filesystem operations- Streaming output
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forkd-0.1.2.tar.gz.
File metadata
- Download URL: forkd-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6549ef08fa1578b2e929c884dc891952ad00f342ddb87522e9c12f3c5995bc18
|
|
| MD5 |
c2fbd04fb85170fb257a95720581062e
|
|
| BLAKE2b-256 |
f969a451791f53dcf19ad6bdbe3b83fb9bb6509776a4b8f158a5fd59c30b744e
|
Provenance
The following attestation bundles were made for forkd-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on deeplethe/forkd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forkd-0.1.2.tar.gz -
Subject digest:
6549ef08fa1578b2e929c884dc891952ad00f342ddb87522e9c12f3c5995bc18 - Sigstore transparency entry: 1519834415
- Sigstore integration time:
-
Permalink:
deeplethe/forkd@70bb131f45b582497407e47215f386ace7610cb2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deeplethe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@70bb131f45b582497407e47215f386ace7610cb2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file forkd-0.1.2-py3-none-any.whl.
File metadata
- Download URL: forkd-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772113e966bd43a9456e1bd26a203f11a0d8780f75fce447454b66d90d995b8d
|
|
| MD5 |
638a123bedd831b9cf04001a5e909298
|
|
| BLAKE2b-256 |
762a82aa75908d814645a33d0f71b5e38e5ac0481d90675e9a51030c5c1a997f
|
Provenance
The following attestation bundles were made for forkd-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on deeplethe/forkd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
forkd-0.1.2-py3-none-any.whl -
Subject digest:
772113e966bd43a9456e1bd26a203f11a0d8780f75fce447454b66d90d995b8d - Sigstore transparency entry: 1519834422
- Sigstore integration time:
-
Permalink:
deeplethe/forkd@70bb131f45b582497407e47215f386ace7610cb2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deeplethe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@70bb131f45b582497407e47215f386ace7610cb2 -
Trigger Event:
workflow_dispatch
-
Statement type: