Moonshot AI’s Kimi team, in collaboration with the kvcache-ai community, has officially open-sourced AgentENV (AENV), a distributed platform engineered to execute agentic environments at an unprecedented scale. This release marks a significant milestone in the infrastructure supporting large language models (LLMs), as AgentENV serves as the foundational environment for the reinforcement learning (RL) training of Kimi K3, Moonshot AI’s latest Mixture-of-Experts (MoE) model boasting 2.8 trillion parameters. By making the source code available under the permissive MIT license, the developers aim to lower the barrier for researchers and engineers seeking to train sophisticated AI agents that can interact with real-world computing environments.
The emergence of agentic AI represents a shift from static text generation to active problem-solving within digital ecosystems. Unlike traditional LLMs that predict the next token in a sequence, agentic models are trained to perform actions—such as executing code, managing filesystems, or navigating web interfaces—to achieve specific goals. This paradigm shift necessitates a new class of training infrastructure capable of providing millions of isolated, high-performance computing environments. AgentENV addresses this need by leveraging Firecracker microVM technology to bridge the gap between the speed of containers and the security of traditional virtual machines.
The Infrastructure Bottleneck in Agentic Reinforcement Learning
The primary challenge in agentic RL is the requirement for "rollouts," where a model interacts with a computer to test hypotheses and learn from feedback. Each rollout requires a pristine, isolated Linux environment equipped with a full network stack, a filesystem, and live process management. Traditionally, developers have faced a difficult trade-off between two primary technologies: containers and virtual machines (VMs).
Containers, while lightweight and fast to initialize, share the host system’s kernel. This creates a significant security risk when running model-generated code, which may inadvertently or maliciously attempt to break out of the container to access the host. Conversely, full virtual machines provide robust isolation through hardware virtualization but are notoriously resource-intensive. VMs suffer from slow boot times and high memory overhead, making them impractical for the high-concurrency demands of RL training, where thousands of environments must be spun up and torn down every minute.
AgentENV was designed specifically to eliminate this bottleneck. By utilizing Firecracker, the open-source virtualization technology developed by Amazon Web Services for serverless computing, AgentENV provides the security of a VM with the performance characteristics of a container. This allows the Kimi team to run agentic RL at a scale that was previously cost-prohibitive or technically unfeasible.
Technical Architecture: Firecracker and Advanced Storage
At the core of AgentENV is a sophisticated orchestration layer that manages the lifecycle of Firecracker microVMs. Each sandbox is a fully independent unit with its own Linux kernel and network namespace. Requests to the system are handled by an Axum-based HTTP API, which communicates with an orchestrator responsible for provisioning and monitoring the sandboxes.
The storage architecture of AgentENV is particularly innovative, employing a layered approach to minimize latency and disk usage. The system utilizes ublk, a Linux userspace block device framework, backed by overlaybd layered images. This design allows multiple sandboxes to share read-only base layers, such as the core operating system and common libraries. When a sandbox performs a write operation, the data is stored in a unique upper layer specific to that instance. This "copy-on-write" mechanism ensures that thousands of environments can exist simultaneously without duplicating the underlying data of the entire OS.
Inside each guest environment, a specialized daemon called envd operates on port 49983. This daemon is the primary interface for the AI agent, handling command execution, file system operations, and real-time health reporting. To facilitate external access, a reverse proxy routes HTTP and WebSocket traffic from the client directly to the services running within the microVM, allowing the agent to act as if it were operating on a standard remote server.
Optimization for High-Density Training
To support the training of a 2.8-trillion-parameter model like Kimi K3, AgentENV incorporates several density-optimizing mechanisms. One of the most critical is host page cache sharing, which allows the host system to share memory pages across different sandboxes for both storage and memory-snapshot data. This drastically reduces the physical RAM required to run large clusters of environments.
Furthermore, AgentENV utilizes memory ballooning, a technique that allows the host to reclaim unused memory from a guest VM. As agentic environments diverge over time due to different actions taken by the model, memory ballooning ensures that the host can sustain a high level of overcommitment, dynamically allocating resources where they are most needed. These optimizations allow a single physical node to host significantly more active environments than traditional virtualization platforms.
Snapshot, Pause, Resume, and Fork: The RL Power Tools
The true utility of AgentENV for reinforcement learning lies in its ability to manipulate the state of an environment instantaneously. The platform supports four critical operations: snapshot, pause, resume, and fork. Unlike standard backup tools that write full disk images, AgentENV performs incremental snapshots of memory and filesystem changes.
The performance metrics reported by the Kimi team are industry-leading:
- Boot/Resume Time: Under 50 milliseconds.
- Pause Time: Under 100 milliseconds.
- Incremental Snapshot Capture: Under 100 milliseconds, even under heavy disk modification.
The "fork" feature is specifically tailored for RL workflows. It allows a running sandbox to be cloned into up to 16 independent child sandboxes on the same node. During the fork process, the source environment pauses briefly to capture its state and then resumes immediately. Each child inherits the exact memory state, filesystem, and configuration of the parent.

This capability transforms the training process. A team can perform a complex, expensive setup—such as installing deep dependencies or cloning a massive codebase—once. From that "checkpoint," they can branch out into dozens of parallel rollouts, each exploring a different path of action. This eliminates redundant setup time and allows for more efficient exploration of the reinforcement learning state space.
On-Demand Loading and Fleet Management
AgentENV is designed for distributed, multi-node deployments. It solves the problem of image distribution through on-demand loading via overlaybd. Local disks on worker nodes act as a bounded cache, retaining frequently used data while evicting "cold" data to remote storage. This means that nodes do not need to pre-download every possible environment image, allowing the total set of addressable environments to exceed the local storage capacity of any single node.
The platform organizes snapshot state into three distinct layers:
- Builder Staging Workspace: A temporary area for artifacts during the creation of new environment images.
- Committed Snapshot Repository: The durable, central source of truth for all environment states.
- Node-Local Runtime Cache: A cache that holds configurations derived at launch time to speed up subsequent starts.
For repository backends, AgentENV supports standard POSIX filesystems and S3-compatible object storage (OSS). For organizations requiring extreme performance across clusters, the project includes an optional peer-to-peer (P2P) transport mechanism based on the iroh protocol. This allows nodes to share committed artifacts directly with one another, reducing the load on central storage. The documentation suggests a minimum network speed of 1 Gbps, with 10 Gbps or higher recommended for large-scale production use.
Strategic Integration: The E2B Compatibility Lever
In a move to encourage rapid adoption, Moonshot AI has made AgentENV compatible with the E2B API. E2B is a popular cloud-based sandbox for AI agents, and many existing agent frameworks are built on its SDK. By exposing an E2B-compatible HTTP API, AgentENV allows developers to switch from a hosted service to a self-hosted AgentENV cluster by simply changing an environment variable (E2B_API_URL).
This compatibility ensures that teams currently developing agents in Python or TypeScript can leverage the performance of AgentENV without rewriting their core logic. While AgentENV provides its own native aenv CLI for advanced workflows, the ability to "drop in" to existing ecosystems is a strategic choice aimed at making AgentENV the standard for private, high-performance agent infrastructure.
Deployment and System Requirements
Due to its reliance on hardware-level virtualization, AgentENV has specific hardware and software requirements. The server component is strictly Linux-only, requiring access to /dev/kvm and a Linux kernel version of 6.8 or higher. The installation scripts are optimized for Ubuntu 24.04, though the aenv CLI itself is cross-platform, supporting Linux and macOS on both x86_64 and arm64 architectures.
Moonshot AI has documented five primary deployment paths, ranging from a "Quick Start" on a single local machine to a "Multi-Node Production" setup. In a multi-node configuration, the system introduces a gateway component to handle incoming traffic and a scheduler to manage the distribution of sandboxes across the fleet.
Context and Chronology of the Project
The development of AgentENV is closely tied to the meteoric rise of Moonshot AI. Founded in early 2023 by Yang Zhilin, a former researcher at Google and Meta and a co-author of influential papers like Transformer-XL and XLNet, Moonshot AI quickly became a leader in China’s "AI Tiger" race. The company gained widespread attention for its Kimi chatbot, which pioneered long-context processing, capable of handling up to 200,000 Chinese characters in its early iterations.
As the company moved toward the development of Kimi K3, the focus shifted from pure language processing to agentic capabilities. The need for a 2.8-trillion-parameter model to learn how to use tools required a training environment that didn’t exist in the open-source market. Throughout mid-2024, the Kimi team developed AgentENV internally to solve their scaling issues. The decision to open-source the project in late 2024 reflects a broader trend in the AI industry where infrastructure is shared to accelerate the development of the "agent economy."
Broader Impact and Industry Implications
The release of AgentENV is likely to have a profound impact on the AI research community. By providing the tools necessary to train "Computer Use" agents—similar to those recently showcased by Anthropic and OpenAI—Moonshot AI is democratizing the infrastructure required for the next generation of AI.
From a safety perspective, the use of Firecracker microVMs provides a much-needed layer of security. As AI agents become more autonomous, the risk of them executing destructive commands increases. AgentENV’s isolation ensures that even if an agent attempts to delete a root directory or launch a network attack, the damage is contained within a disposable, 50ms-lived microVM.
Furthermore, the efficiency gains provided by AgentENV could significantly reduce the carbon footprint and cost of training large-scale agents. By allowing for massive overcommitment of hardware and reducing idle resource consumption through "auto-pause" features, the platform makes high-end RL training accessible to organizations without the massive budgets of hyperscale cloud providers.
As the industry moves toward "Agentic Workflows," where LLMs act as autonomous employees, the underlying plumbing—the ability to provide a fast, safe, and scalable sandbox—becomes as important as the model weights themselves. AgentENV represents a major contribution to this "plumbing," positioning Moonshot AI and kvcache-ai as key architects of the future of autonomous computing.
