# OpenDsec > Open-source sandboxes on your own machines for RL rollouts and code-executing AI agents. Firecracker microVMs in ~0.1 s, fork with memory, and an E2B-compatible API. OpenDsec is open source (AGPL-3.0) and implements the paper DeepSeek Elastic Compute (DSec), arXiv:2609.22978. It is an independent project, not affiliated with DeepSeek. Source code: https://github.com/Kernflux/opendsec. Every page below is also served as Markdown at the linked .md URL; the documentation exists in English and Chinese. Highlights: - microVMs in about 0.1 s: A Firecracker VM cold-starts in about 0.1 s, is created from a memory snapshot in about 55 ms, and resumes from a pause in about 50 ms. - Fork and memory snapshots: fork(count=N) clones a running VM with its memory, pausing the source for about 10 ms. Copies on one node share pages; other nodes pull from the source node. - Pause a whole task: When training is preempted, pause every sandbox of a task and release its memory. The next call to a paused sandbox resumes it. - E2B compatible: Code written for the E2B SDK runs after changing three environment variables, including commands, files, PTY, ports, snapshots and the code interpreter. - Layered images: Import from any OCI registry, compose layers without copying, and save an environment with pack_diff. The store lives on NFS, CephFS or JuiceFS. - Default-deny network: Allow traffic by domain, CIDR and port per sandbox, changeable while it runs. Enforced with nftables and a DNS proxy. - Isolation: A jailer with a uid per VM, core scheduling against SMT side channels, seccomp, read-only agents and per-session users. - Projects and quotas: Nested projects, hierarchical quotas and bounded delegation. Raft-replicated IAM, mTLS between components, short-lived revocable tokens and audit logs. - Operations: Staged fleet rollouts with automatic rollback, an offline bundle, Prometheus metrics and alerts. Upgrading any component leaves running sandboxes alone. ## Docs - [Docs](https://kernflux.github.io/en/docs/index.md): OpenDsec documentation: installation and deployment, the Python SDK and CLI, images and snapshots, network policy, permissions, operations and monitoring, organized by task. - [Get started](https://kernflux.github.io/en/docs/quickstart.md): Install every OpenDsec component on one Linux machine, then create sandboxes with the Python SDK, the E2B SDK or the command line. - [Concepts](https://kernflux.github.io/en/docs/concepts.md): This page introduces every concept you meet when using OpenDsec: sandboxes and their backends, lifecycle and timeouts, sessions, tasks, images and snapshots,… - [FAQ](https://kernflux.github.io/en/docs/faq.md): OpenDsec FAQ: what it is, a self-hosted E2B alternative, microVM vs container isolation, how many sandboxes a cluster runs, RL training, Kubernetes, licensing, KVM, GPUs and production readiness. - [OpenDsec vs E2B, Daytona and Modal](https://kernflux.github.io/en/docs/compare.md): How OpenDsec compares with E2B, Daytona and Modal Sandboxes: where each runs, license, isolation, memory snapshots and fork, pause, GPUs and E2B compatibility, and when to choose which. - [Deployment](https://kernflux.github.io/en/docs/deploy.md): How to deploy OpenDsec: a one-command single-machine install, a multi-node production cluster, air-gapped data centers, or (experimental) Kubernetes. - [Single-node install in detail](https://kernflux.github.io/en/docs/install.md): deploy/quickstart.sh installs every OpenDsec component on one Linux machine. It uses the same tooling as a multi-node cluster (opendsecops), so the single-node… - [Cluster deployment](https://kernflux.github.io/en/docs/cluster.md): This page deploys a production cluster from scratch: planning, infrastructure, installation, handing over to fleet, the first caller, and acceptance. - [OpenDsec caller guide](https://kernflux.github.io/en/docs/user-guide.md): OpenDsec provides isolated environments for running code, called sandboxes. You create sandboxes with the Python SDK, run commands and read and write files in… - [Python SDK reference](https://kernflux.github.io/en/docs/python-sdk.md): opendsec is OpenDsec's asynchronous Python SDK, built on gRPC and asyncio. This page lists all of its classes and methods. - [CLI reference: opendsecctl](https://kernflux.github.io/en/docs/cli.md): opendsecctl is OpenDsec's command-line tool, for administrators and callers alike: create and operate sandboxes, manage images, projects, principals and… - [Images and snapshots](https://kernflux.github.io/en/docs/images.md): Sandboxes start from images. OpenDsec keeps images in an image store shared by every node, each image a stack of read-only layers. - [Network policy](https://kernflux.github.io/en/docs/network.md): Sandbox networking denies everything by default: a sandbox can neither connect out nor be connected to. Callers allow the destinations they need; - [Projects, principals and permissions](https://kernflux.github.io/en/docs/iam.md): OpenDsec organizes resources in a project tree, authenticates callers as principals holding tokens, controls who may do what with permissions granted on… - [Moving from E2B to OpenDsec](https://kernflux.github.io/en/docs/e2b.md): OpenDsec's E2B gateway (opendsec-e2b) serves the API that E2B's SDKs talk to. Code written for E2B, and agent frameworks built on its SDKs, run on your own… - [Configuration reference](https://kernflux.github.io/en/docs/configuration.md): The whole cluster shares one JSON configuration file, deployed to /etc/opendsec/opendsec.json on every node. - [OpenDsec operations manual](https://kernflux.github.io/en/docs/operations.md): This manual covers installing a multi-node production cluster, day-to-day operations and handling failures. - [Monitoring and alerts](https://kernflux.github.io/en/docs/monitoring.md): Every OpenDsec component serves Prometheus metrics and health checks. opendsecops monitor sets up node_exporter, Prometheus, Alertmanager and the alert rules. - [Troubleshooting](https://kernflux.github.io/en/docs/troubleshooting.md): Find the symptom, then the cause and the fix. Every entry comes from a problem we actually hit. - [Security model](https://kernflux.github.io/en/docs/security.md): OpenDsec runs untrusted code: commands a model generates during RL, scripts an agent runs. - [OpenDsec service level objectives (SLO)](https://kernflux.github.io/en/docs/slo.md): This document defines what an OpenDsec cluster promises its callers, how that is measured, and what to do when it is missed. - [Versioning and compatibility](https://kernflux.github.io/en/docs/versioning.md): This page says what stays compatible between OpenDsec releases, and what an upgrade or a rollback needs. Changes are listed per release in CHANGELOG.md. - [How the components work](https://kernflux.github.io/en/docs/components.md): This document goes through how each OpenDsec component is built: what it does, where its code is, how it works inside, where its state lives, and what happens… - [License and commercial use](https://kernflux.github.io/en/docs/license.md): OpenDsec's servers are AGPL-3.0 and its Python SDK and clients Apache-2.0, so programs that call it are not bound by the AGPL. Commercial licenses and an enterprise edition are available. ## Blog - [Acceptance-testing the open-source release on fresh machines: 22 issues](https://kernflux.github.io/en/blog/posts/fresh-machine-acceptance.md): Before the release we followed the README on fresh Ubuntu 24.04 VMs through every feature a user would touch, and found and fixed 22 issues, two of them serious. - [OpenDsec is open source](https://kernflux.github.io/en/blog/posts/opendsec-open-source.md): Sandbox infrastructure built from DeepSeek's DSec paper, now open source under AGPL-3.0, with Firecracker microVMs, fork with memory, task-level pause and an E2B-compatible API. ## 中文文档 (Chinese docs) - [文档](https://kernflux.github.io/docs/index.md): OpenDsec 文档:安装和部署、Python SDK 与命令行、镜像与快照、网络策略、权限、运维与监控,按要做的事查找。 - [快速开始](https://kernflux.github.io/docs/quickstart.md): 在一台 Linux 机器上装好 OpenDsec 的全部组件,并用 Python SDK、E2B SDK 或命令行创建 sandbox。 - [核心概念](https://kernflux.github.io/docs/concepts.md): 这一页介绍使用 OpenDsec 时会遇到的全部概念:sandbox 和它的后端、生命周期与超时、会话、任务、镜像与快照、网络、项目与权限、错误。 - [常见问题](https://kernflux.github.io/docs/faq.md): OpenDsec 常见问题:它是什么、能自建的 E2B 替代、microVM 与容器怎么选、能跑多少 sandbox、强化学习、Kubernetes、商用许可、KVM、GPU 和生产可用性。 - [OpenDsec 与 E2B、Daytona、Modal 对比](https://kernflux.github.io/docs/compare.md): OpenDsec 与 E2B、Daytona、Modal Sandboxes 的对比:部署位置、许可证、隔离方式、连同内存的快照和 fork、暂停、GPU、E2B 兼容,以及各自适合什么场景。 - [部署方式](https://kernflux.github.io/docs/deploy.md): OpenDsec 的部署方式:单机一条命令安装、多机生产集群、不能上网的离线环境,以及实验性的 Kubernetes。 - [单机安装详解](https://kernflux.github.io/docs/install.md): deploy/quickstart.sh 在一台 Linux 机器上装好 OpenDsec 的全部组件。 - [多机集群部署](https://kernflux.github.io/docs/cluster.md): 这一页从零开始部署一个生产集群:规划、准备基础设施、安装、交给 fleet 管理、开通第一个调用方,以及验收。 - [OpenDsec 接入指南(调用方)](https://kernflux.github.io/docs/user-guide.md): OpenDsec 提供隔离的代码执行环境,叫做 sandbox。你可以通过 Python SDK 创建 sandbox,在里面执行命令、读写文件,用完后停止。 - [Python SDK 参考](https://kernflux.github.io/docs/python-sdk.md): opendsec 是 OpenDsec 的异步 Python SDK,基于 gRPC 和 asyncio。这一页列出它的全部类和方法。 - [命令行参考:opendsecctl](https://kernflux.github.io/docs/cli.md): opendsecctl 是 OpenDsec 的命令行工具,管理员和调用方都用它:创建和操作 sandbox、管理镜像、项目、身份和 token、查看集群… - [镜像与快照](https://kernflux.github.io/docs/images.md): sandbox 从镜像启动。OpenDsec 的镜像存放在一个所有节点共享的镜像库里,由一组只读的层叠成。 - [网络策略](https://kernflux.github.io/docs/network.md): sandbox 的网络默认拒绝一切:既不能主动连出去,也不能被别人连进来。调用方按需放行要访问的目标,管理员定义规则集和全集群的默认规则。 - [项目、身份与权限](https://kernflux.github.io/docs/iam.md): OpenDsec 用一棵项目树组织资源,用身份和 token 认证调用方,用授予在项目上的权限控制谁能做什么,用配额限制每个项目能用多少资源。 - [从 E2B 迁移到 OpenDsec](https://kernflux.github.io/docs/e2b.md): OpenDsec 的 E2B 网关(opendsec-e2b)提供 E2B SDK 调用的那套 API。 - [集群配置参考](https://kernflux.github.io/docs/configuration.md): 整个集群共用一份 JSON 配置文件,部署后在每台节点的 /etc/opendsec/opendsec.json。所有组件都读它,各自取用与自己相关的部分。 - [OpenDsec 生产运维手册](https://kernflux.github.io/docs/operations.md): 本文是多机生产集群的安装、日常操作和故障处理手册。设计背景见 SPEC §27,组件说明见 deploy/README.md。 - [监控与告警](https://kernflux.github.io/docs/monitoring.md): 每个 OpenDsec 组件都提供 Prometheus 指标和健康检查。opendsecops monitor 会装好 node_exporter… - [故障排查](https://kernflux.github.io/docs/troubleshooting.md): 按现象查找原因和处理方法。每一条都来自实际遇到过的问题。还没找到的,按 §1 收集信息后提 issue。 - [安全模型](https://kernflux.github.io/docs/security.md): OpenDsec 运行的是不可信的代码:强化学习里模型生成的命令、agent 执行的脚本。 - [OpenDsec 服务目标(SLO)](https://kernflux.github.io/docs/slo.md): 本文定义 OpenDsec 集群对调用方承诺什么、怎么测、没达到时怎么办。目标值是建议的起点,运维方可以按自己的业务调整,但调整后要同步改… - [版本与兼容](https://kernflux.github.io/docs/versioning.md): 这一页说明 OpenDsec 各版本之间哪些保持兼容,以及升级和回滚需要注意什么。各版本的变更见 CHANGELOG.md。 - [组件实现说明](https://kernflux.github.io/docs/components.md): 本文逐个说明 OpenDsec 各组件是怎么实现的:职责、代码位置、内部机制、状态存在哪、出故障时怎么办。 - [OpenDsec 复现实现规划 (Spec v0.1)](https://kernflux.github.io/docs/spec.md): OpenDsec 的设计规划和实测记录:各组件的设计、microVM 与容器后端、fork 与快照、规模测试和生产验证的数据。 - [许可与商业授权](https://kernflux.github.io/docs/license.md): OpenDsec 的服务端以 AGPL-3.0 开源,Python SDK 和客户端是 Apache-2.0,调用它的程序不受 AGPL 约束;也提供商业授权和企业版。 ## Optional - [All English docs and posts in one file](https://kernflux.github.io/llms-full.txt) - [全部中文文档和博客(一个文件)](https://kernflux.github.io/llms-full.zh.txt) - [Source code and changelog](https://github.com/Kernflux/opendsec)