Skip to content

[Question] Why retain container semantics inside a microVM sandbox? #1338

Description

@flyflypeng

Background

CubeSandbox already uses a microVM as its isolation boundary. However, container-oriented concepts still appear throughout the internal architecture:

  • CubeShim bridges containerd Shim v2 with the sandbox VM lifecycle.
  • The guest-agent protocol exposes operations such as CreateContainer, StartContainer, and RemoveContainer.
  • The control-plane model retains PodSandbox and container-oriented concepts, including cases where a type=sandbox container represents the sandbox itself.

This architecture is understandable for a Kubernetes/CRI runtime. Kubernetes requires the PodSandbox and Container abstractions, and VM-backed runtimes such as Kata Containers need to map those concepts onto a virtual machine.

For an agent sandbox platform, however, the actual isolation and lifecycle unit is the microVM sandbox. Even if CubeAPI and the SDKs expose a Sandbox to users, much of the internal lifecycle still appears to be modeled as containers inside that sandbox.

Platforms such as E2B and AgentENV appear to place the micro-sandbox itself closer to the center of both the user-facing and internal domain models. This comparison concerns the abstraction boundary rather than suggesting that their implementations are otherwise identical.

Open question

What are the architectural reasons for retaining container semantics inside CubeSandbox after the sandbox has already become a microVM?

More specifically:

  1. Is the container layer primarily required for containerd/CRI and Kubernetes ecosystem compatibility?
  2. Is supporting multiple independently managed containers inside one microVM an intentional product capability or long-term direction?
  3. Which responsibilities still require a container identity and lifecycle rather than a sandbox-level workload or process abstraction?
  4. Is the container model considered part of CubeSandbox's core domain, or is it mainly a compatibility layer inherited from its Kubernetes/runtime lineage?
  5. Would the architecture still retain container concepts if Kubernetes and CRI compatibility were not requirements?

Possible architectural direction

Would it be cleaner to make a microVM-native Sandbox the core abstraction and move Kubernetes/container semantics into an optional adapter layer?

This would not necessarily mean dropping OCI image support. OCI could remain an image and workload packaging format without requiring Container to remain a first-class lifecycle or identity domain throughout the system.

A microVM-native core model could make the following boundaries easier to understand:

  • isolation boundary;
  • lifecycle and ownership;
  • snapshot and restore boundary;
  • API identity;
  • resource accounting;
  • failure handling and cleanup.

It could also prevent a general-purpose agent sandbox from remaining coupled to the secure-container abstraction historically used to integrate VM runtimes with Kubernetes.

The purpose of this issue is to understand the intended abstraction boundary and architectural direction before proposing any concrete refactoring.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions