opendsec / README.md
zhyb99's picture
OpenDsec: self-hosted sandboxes implementing the DSec paper
07e1f12 verified
|
Raw History Blame Contribute Delete
3.63 kB
---
license: agpl-3.0
title: OpenDsec
emoji: 📦
colorFrom: blue
colorTo: gray
sdk: static
pinned: false
paper:
- arxiv: 2609.22978
short_description: Self-hosted sandboxes for AI agents and RL
---
# OpenDsec
**OpenDsec** is an open-source, self-hosted sandbox platform for reinforcement-learning rollouts and code-executing AI agents. It is an independent implementation of the architecture described in *DeepSeek Elastic Compute (DSec): A Sandbox Infrastructure for Effective Agentic Training at Scale* ([arXiv:2609.22978](https://arxiv.org/abs/2609.22978)).
It is **not** DeepSeek code, not an official release, and not affiliated with or endorsed by the paper's authors. Where the paper leaves something open or the project chose differently, `docs/SPEC.md` marks each design point as either taken from the paper (with its section) or the project's own decision.
## What it does
- **Backends**: Firecracker microVM, container, and full QEMU VM behind one API.
- **Control plane**: a stateless apiserver for auth, quota and placement; a Raft-replicated IAM; a watcher aggregating node health; an edge daemon per compute node that makes the final admission decision. Components use gRPC with mTLS, and the sandbox id encodes its edge, so no per-sandbox routing table is needed.
- **Lifecycle**: pause to a memory snapshot, restore, and fork a running microVM with memory preserved. Same-node forks share pages; cross-node forks pull the snapshot from the source node.
- **Images**: import from any OCI registry, compose layers without copying data, and pack a sandbox's changes into a new image.
- **Network**: default-deny, with per-sandbox domain, CIDR and port rules enforced by nftables and a DNS proxy.
- **Compatibility**: an E2B-compatible gateway, so existing E2B SDK clients can point at a self-hosted deployment.
## Two deviations from the paper
- A generic shared filesystem (NFS, CephFS or JuiceFS) stands in for 3FS.
- Firecracker is the primary backend rather than one option among several.
## Numbers
Every figure below is a measurement on the project's own hardware, not a figure from the paper. Conditions and method are in docs/SPEC.md.
| Measurement | Value |
|---|---|
| microVM cold start | ~0.1 s |
| Restore from memory snapshot | ~55 ms |
| Resume after pause | ~50 ms |
| Burst of microVMs, one 384-thread node | 5,120 |
| Burst of containers, two nodes | 8,192, no failures |
## Known limits
- The image store's availability is whatever the chosen shared filesystem provides.
- A host reboot loses that node's sandboxes, including paused microVMs.
- QEMU PCI passthrough has not been tested on real devices.
- The E2B gateway does not yet cover directory watching, signed file URLs, unauthenticated browser access to sandbox ports, or template building.
## Links
- Source: https://github.com/Kernflux/opendsec
- Website and docs: https://kernflux.github.io/
- Quickstart: https://kernflux.github.io/en/docs/quickstart
- Moving from E2B: https://kernflux.github.io/en/docs/e2b
## Licensing
The server and tools are AGPL-3.0. The client parts (the Python SDK, the Go client, and the API definitions) are Apache-2.0, so programs using OpenDsec are not bound by the AGPL.
## Citation
If you use OpenDsec in research, cite the paper it implements:
```bibtex
@article{dsec2026,
title = {DeepSeek Elastic Compute (DSec): A Sandbox Infrastructure for Effective Agentic Training at Scale},
year = {2026},
eprint = {2609.22978},
archivePrefix = {arXiv}
}
```
"DeepSeek" and "DSec" are names of their respective owners. OpenDsec uses them only to identify the paper it implements.