当一个 Coding Agent 开始真正干活,它要做的远不止调用模型——拉取代码、安装依赖、执行测试、修改文件,然后在几小时后的下一轮对话里接着上次的环境继续。这些执行环境从哪里来、彼此如何隔离、空闲时谁来释放?VCI Agent Sandbox 给出的答案是:把 Agent 的执行环境,变成 Kubernetes 原生可声明、可管理、可回收的工作负载。
Agent 执行环境需要云原生管理
从生成答案到执行任务,Agent 面对的不再只是文本输入输出。不同Agent场景需要的数据、权限均不相同,且Agent执行动作都会改变环境,也让权限、数据和网络访问成为必须管理的边界。
Coding Agent场景:需要约束进入生产应用的运行进程。 即使目标任务是正常的数据分析或代码修复,执行过程也可能出现错误的文件操作、依赖冲突或失控的资源消耗。将代码放在独立 VCI Agent Sandbox 中执行,让 Agent 在外部编排任务、接收结果,可以减少执行异常对主应用和其他任务的影响。
Computer-use Agent场景:需要隔离代码及Agent操作权限。 浏览器、桌面与文件系统为 Agent 提供了完成任务的工具,也可能让误操作直接影响业务数据。因此,应为任务准备独立的浏览器或桌面环境,只提供必要的文件和身份凭据,限制可访问的网络目标;涉及交易、授权等高影响操作,仍需人工确认。
Agent RL 与评测场景:需要独立试错的环境。 不同任务和探索分支需要各自的文件、依赖与环境状态,避免上一轮运行留下的修改影响下一轮结果。将环境执行与模型推理、训练流程分开,便于分别管理它们的资源与生命周期:模型服务持续提供决策,执行环境按任务准备、重置或回收。
整合不同场景下的Agent需求,Agent 执行任务,不等于让它拥有业务系统的权限,企业需要同时解决两件事:
- 把Agent执行风险限制在明确边界内;
- 让独立的 VCI Agent Sandbox 与企业现有基础设施联动,进入统一的运维体系。
Agent Sandbox:执行环境独立,基础设施与运维方式统一运行
隔离执行风险,并不意味着企业需要为 Agent Sandbox重新搭建一套孤立的平台。对于已经使用 Kubernetes 承载 Agent 服务、任务编排与业务应用的团队,Agent Sandbox更适合成为企业原有云原生基础设施的一部分:运行边界保持独立,管理方式保持一致。在 Kubernetes 中管理 Agent Sandbox,已经有了社区标准化的资源模型与开源控制器,企业不必再从零自研一套通用生命周期管理逻辑。 kubernetes-sigs/agent-sandbox 将独立执行环境抽象为可声明、可管理的资源,让上一节所说的“执行有边界、管理能联动”有了现成的开源基础。
- 与现有 Agent 基础设施联动。 对于基于 Kubernetes 构建 Agent 基础设施的企业,任务编排服务与沙箱执行环境可以建立在同一套云原生底座之上。Agent Sandbox 以 Kubernetes 资源的形式纳入现有平台,与 Agent 服务协同运行,复用已有的镜像、网络、存储及资源管理体系。企业无需为执行环境另建一套割裂的基础设施,就能在保持任务隔离的同时,实现编排与执行的统一管理。
- 与运维团队的工作方式联动。 用户使用声明式方式定义VCI Agent Sandbox所需的镜像、资源与存储,由管理组件自动对齐到 Agent Sandbox 环境的目标状态,过程中遇到问题自动重试、回滚。能够减少散落在各个业务里的创建、轮询和清理脚本。
企业需要的不是孤立的代码执行容器,而是“执行有边界、管理运维能联动”的 Agent Sandbox 体系。 应用开发者专注 Agent 的任务编排,平台与运维团队统一管理云原生的 Agent Sandbox 执行环境。
VCI Agent Sandbox:为企业提供一套完整的Agent执行环境和运维管理基座
火山引擎弹性容器实例(Volcengine Container Instance,简称 VCI)是一种 Serverless 和容器化的计算服务,无缝集成火山引擎容器服务(VKE),提供 Kubernetes 编排能力。
VCI 基于社区 Agent Sandbox(github.com/kubernetes-… AI Agent 的载体,建设专用于管理 AI Agent 的代码执行环境,使之具备强进程隔离,存储隔离和网络隔离能力。
想了解更多产品能力点击: docs.volcengine.com/docs/vke/Fe…
VCI Agent Sandbox设计理念:
- 原生接入,沿用已有工具与治理机制。 VCI Agent Sandbox资源可以通过 Kubernetes API 与 kubectl 管理,复用 API 层的认证、授权与审计机制,按需配置访问权限。开发/运维团队不用为VCI Agent Sandbox另学一套管理接口,围绕 Kubernetes API 建设的自动化流程也有了对接基础。作为原生扩展,项目可以随 Kubernetes 生态演进持续适配。
- 开放共建,让需求与能力持续迭代。 社区设有公开的讨论、代码评审和子项目会议,发布记录持续覆盖 SDK、预热池、运行时访问和可观测性等方向的改进。企业遇到的共性问题可以进入上游讨论,已经解决的问题也能成为其他团队可复用的成果。相比每家企业独自维护一套私有实现,社区协作有助于减少重复建设,让更多工程投入用于自己的业务差异。
- 厂商中立,为运行环境保留选择权。 项目以公开的资源模型为基础,并支持不同运行时、保持厂商中立为设计目标。企业可以围绕共同接口建设环境模板和管理流程,降低对单一厂商私有 API 的依赖。
对于需要隔离执行的 Agent 任务,VCI 的 microvm 运行时提供虚拟机级隔离环境;在此基础上,企业可通过 Kubernetes RBAC 管理VCI Agent Sandbox资源的操作权限,通过资源配额约束使用规模,并结合网络安全组控制允许的网络访问。运行时隔离、管理权限和网络访问各司其职,让不同租户、不同任务的执行环境具备清晰边界,减少单个任务异常对主应用与其他任务的影响。
在社区编排基础上,让环境准备、恢复与存储适配更高效
1. 镜像缓存: 将镜像准备前置,减少启动等待。通过 ImageCache 提前准备任务所需的镜像数据,降低并发启动时集中拉取镜像对仓库和网络的压力,让环境更快进入可执行状态。
2. 快照管理: 保留工作文件,减少恢复时的重复准备。在社区暂停/恢复机制之上,VCI 引入 SandboxSnapShot 与 SandboxSnapShotClass,统一描述快照、状态与保留策略。VCI Agent Sandbox恢复时可基于保存的工作状态重建环境,不必重新准备已有文件和依赖。
3. 差异化存储挂载: 共用环境模板,认领时接入各自数据。预热池通常基于同一 SandboxTemplate 准备实例,而不同租户或任务的数据需求并不相同。VCI 提供预挂载与动态挂载两种模式:预挂载在固定目录下替换存储卷或子目录;动态挂载则在认领时指定目录并追加挂载。这样,同类任务可以复用环境模板,同时按授权接入各自工作数据。
联动云上资源,将 VCI Agent Sandbox 纳入企业统一运维体系
- 观测与告警: 看见任务运行,也看见资源使用。围绕 VCI Agent Sandbox 的指标、日志与事件,对接企业已有观测体系;结合托管 Prometheus、TLS 云日志和消息通知,建立从运行状态、资源水位到异常排查的运维链路。
- 持久化存储: 将工作数据与计算实例生命周期分开管理。按数据访问方式接入对象存储 TOS、弹性文件存储 EFS:前者用于对象数据与任务产物,后者用于文件目录与共享工作空间。
- 网络与访问: 让调用入口与企业网络架构衔接。通过负载均衡 CLB、API 网关 等组件,按部署方案承接 VCI Agent Sandbox 管理与执行请求,让 Agent 应用在受控链路中访问执行环境。
VCI Agent Sandbox最佳实践
CodingAgent 的云上 AI Coding
企业 Coding Agent 需要在云端执行代码、管理工作文件,并在多轮会话之间延续任务状态。借助 VCI Agent Sandbox,某CodingAgent实现了云上 AI Coding 的代码运行:每个任务获得独立 VCI Agent Sandbox,环境按需创建、用后回收,工作文件随 VCI Agent Sandbox 保留,多轮任务可以接着上次继续。
办公个人助理的云上 AI Docs
某办公个人助理借助 VCI Agent Sandbox 实现云上 AI Docs:用户文件旁路上传至 TOS 云存储,按授权挂载到独立沙箱内,由 Agent 通过 E2B 调用沙箱执行代码与文档处理,生成产物写回云存储并返回客户端,实现任务编排、隔离执行与文档存储的解耦。
回到开头的场景:当 Agent 开始执行代码、产生工作文件、并在下一次对话里继续任务,这些执行环境需要一个统一的答案。VCI Agent Sandbox 的答案可以概括成三句话:
- 对齐社区标准, 资源模型来自 kubernetes-sigs/agent-sandbox,不被单一厂商绑定;
- 先行增强能力, 在兼容之上拓展 imagecache、sandboxsnapshot 等关键特性,并用 E2B SDK 保留熟悉的调用方式;
- 按场景选择算力: 需要企业级计算性能的任务,可选择 vci.n4i;需要长期保留开发环境与工作数据的开发机、多轮 Agent 场景,可选择 vci.u1;对启动时延和并发创建能力要求较高的 RL、批量评测等场景,可选择 vci.s1。
附录:VCI Agent Sandbox资源选型参考
不同 Agent 任务对执行环境的诉求并不相同:有的关注批量启动与并发,有的需要长期保留工作空间,有的依赖指定 CPU 或 GPU。
可以按下面的典型场景选择规格族,再结合实际任务确定资源配置。
如果你所在的团队已经基于 Kubernetes 构建代码执行、Coding Agent 工作空间或批量评测环境,欢迎申请 VCI Agent Sandbox 试用,带着一个真实任务来验证:环境就绪快不快、状态保留是否符合预期、资源账单是否可控、和现有 Kubernetes 平台能否顺利融合。点击这里联系我们。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
When a Coding Agent starts working really, it does much more than just call models — pull codes, install dependencies, perform tests, modify files, and then continue in the next conversation in a few hours. Where do these environments come from, how are they isolated from each other, and who releases them when they are free? The answer given by VCI Agent Sandbox is to turn Agent's implementation environment into a statementable, manageable, recyclable job load for Kubernetes.
Agent, implementing the environment requires cloud seed management
From generating answers to the task, Agent is no longer faced with just text input output. The data required for different Agent scenarios and permission are not the same, and Agent's execution actions change the environment and make permission, data and network access the boundary that must be managed.
Coding Age scenario: The operational process of entering production applications needs to be constrained. Even if the target mission is normal data analysis or code repair, the implementation process may result in incorrect document handling, reliance on conflict or uncontrolled resource consumption. Placing the code in a stand-alone VCI Agent Sandbox allows Agent to organize tasks externally, receive results and reduce the impact of execution anomalies on the main application and other tasks.
Computer-use Agent scenario: Need for quarantine code and Agent operation permission. The browser, desktop and file system provides Agent with a tool to complete the task and may allow error to directly affect business data. The task should therefore be prepared for an independent browser or desktop environment, with only the necessary documentation and identification to limit accessible network objectives; human confirmation is still required for high impact operations involving transactions, authorizations, etc.
Agent RL and the assessment scene: an environment that needs to be tested independently. Different tasks and branches of exploration require their own documents, dependence and state of the environment, so as not to leave behind changes from the previous round of operations to influence the next round of results. Separate environmental implementation from model reasoning, training processes to facilitate the separate management of their resources and life cycles: model services provide continuous decision-making and implement environment-specific preparation, replacement or recovery.
The integration of Agent's needs in different scenarios, and Agent's mandate, does not mean that it has permission in its business system.
- Limiting the risk of Agent ' s execution to a clear border;
- Linking independent VCI Agent Sandbox to the existing infrastructure of the enterprise into a unified transport system.
Agent Sandbox: Implementing environmental independence, integrated infrastructure and business approach
Segregating the risks of implementation does not mean that enterprises need to re-establish an isolated platform for Agent Sandbox. For teams already using Kubernetes to carry Agent services, tasking and business applications, Agent Sandbox is better suited to become part of the original cloud-based infrastructure of the enterprise: operating borders are independent and managed in a consistent manner. Managing Agent Sandbox in Kubernetes has standardized community resource models and open source controllers, and businesses need no longer develop a generic life cycle management logic from zero. The kubernetes-sigs/agent-sandbox abstracted the independent implementation environment as a declarable and manageable resource, giving the “Enforcement with Borders, Regulatory Linkages” as described in the previous section an open-source basis.
- Link to existing Agent infrastructure. For enterprises that build the Agent infrastructure based on Kubernetes, the tasking services and sandbox implementation environment can be built on the same cloud base. Agent Sandbox is integrated into existing platforms in the form of Kubernetes resources, operating in tandem with Agent services, reusing existing mirrors, networks, storage and resource management systems. Without a separate and fragmented infrastructure for the implementation of the environment, enterprises can achieve integrated management of organization and implementation while maintaining segregation of tasks.
- Linked to the way the transport team works. Users define the mirrors, resources and storage required for VCI Agent Sandbox in a declarative manner, with the management component automatically aligning to the target state of the Agent Sandbox environment, with problems encountered in automatic retry, rolling back. The creation, rotation and clean-up of scripts can be reduced from scattered operations.
The business needs not an isolated code-implementing container, but an Agent Sandbox system that “implements a boundary, managed a dynamic energy connection”. Application developers focus on Agent tasking, and the platform manages the cloud-generated Agent Sandbox implementation environment in a unified way with the transport team.
VCI Agent Sandbox: Provide a complete set of Agent's implementation environmental and transport management bases for enterprises
The example of Volcengine elastic packagings (Volcengine Container Institute, short VCI) is a serverless and containerized computing service, seamlessly integrated into the Volcengine container service (VKE), providing Kubernetes organization capability.
VCI based on community Agent Sandbox (github.com/kubernetes----Ai Agent) to build a code implementation environment dedicated to managing AI Agent with strong process isolation, storage isolation and network isolation capabilities.
To learn more about product capabilities: docs.volcengine.com/docs/vke/Fe...
VCI Agent Sandbox design idea:
- Primary access, following existing tools and governance mechanisms. VCI Agent Sandbox resources can be managed through Kubernetes API and kubectl, reuse the API-level authentication, authorization and auditing mechanism, and access permission as needed. The development/transport team did not need to learn another management interface for the VCI Agent Sandbox, and the automated process built around Kubernetes API also had a docking basis. As a native extension, the project can continue to fit with the ecological evolution of Kubernetes.
- Opening up co-building so that needs and capacities continue to overlap. There are open discussions, code reviews and sub-project meetings in the community, and publish records continue to cover improvements in the direction of SDK, preheat pools, operational visits and observables. Cross-cutting issues encountered by enterprises can be discussed upstream and issues that have been addressed can be replicated by other teams. Community collaboration can help to reduce duplication and allow more engineering inputs to be used for their own business differences than if each enterprise were to maintain a separate set of private realizations.
- The vendor is neutral and reserves the right of option for the operating environment. The project is based on an open resource model and supports the design objective of different running times and of maintaining plant neutrality. Enterprises can build environmental templates and management processes around common interfaces to reduce reliance on private API for single manufacturers.
For Agent missions that need to be isolated, VCI's microrovm operates in a virtual-level isolation environment; on this basis, enterprises can manage VCI Agent Sandbox resources through Kubernetes RBAC by operating permission, by limiting the scale of use through resource quotas, and by controlling the permitted network access in conjunction with the Cybersecurity Group. Operational segregation, management of permission and network access are the functions of each division, providing clear boundaries for different tenants, different mission environments and reducing the impact of individual mission anomalies on master applications and other tasks.
Better environmental preparedness, restoration and storage based on community organization
1. Mirror cache: Prepare the mirror to be pre-empted and reduce start-up waiting. By preparing the mirror data required for the ImageCache mission in advance, reduce the pressure on the warehouse and the network to centralize the mirror at launch and bring the environment into an enforceable state.
2. Snapshot management: retention of working papers to reduce duplication in recovery. VCI introduced SandboxSnapShot and SandboxSnapShotClass to describe the snapshot, status and retention strategy on the basis of community pause/restoration mechanisms. When VCI Agent Sandbox is restored, the environment can be rebuilt on the basis of the working state of preservation and there is no need to re-preparate existing documents and reliance.
3. Discrepancies storage mounted: Shared environmental templates, access to respective data upon acceptance. Preheat pools are usually based on the same SandboxTemplate preparation example, while data requirements for different tenants or missions are different. VCI provides both premounting and dynamic mounts: premounting replaces the memory or subdirectories under a fixed directory; and dynamic mounts specify the directory and add a mount to their recognition. This allows for re-use of environmental templates for similar tasks and access to respective work data as mandated.
Linking cloud resources to integrate VCI Agent Sandbox into an integrated business system
- Observation and alarm: see the mission running, see the use of resources. There are observation systems in place for the docking enterprises around VCI Agent Sandbox indicators, logs and events; and the establishment of transport-wide links from operational status, resource level to unusual screening, in conjunction with the hosting of Prometheus, TLS cloud logs and messages.
- Enduring storage: manage work data separately from the life cycle of computing examples. Access to object storage by data access, toOS, flexible file storage, EFS: the former for object data and task products, and the latter for catalogue and shared workspace.
- Networks and access: connect the call point to the enterprise network architecture. The VCI Agent Sandbox management and execution request is carried out by means of load-balanced components such as CLB, API gateway, etc., to allow Agent to access the implementation environment in the controlled link.
VCI Agent Sandbox Best Practices
Al CodingAgent
Corporate Coding Agent needs to perform code, manage working papers in the cloud and continue the task between multiple sessions. By VCI Agent Sandbox, some CodingAgent made it possible to run the code of AI Coding on the cloud: each mission was independent VCI Agent Sandbox, the environment was created and recycled as needed, and the working paper was retained by VCI Agent Sandbox, and the multiple assignments could be continued the last time.
AI Docs
An office personal assistant works with VCI Agent Sandbox to achieve a cloud-based AI Docs: the user file is transported by road to TOS cloud storage, mounted in a separate sandbox as authorized, coded and document processed by Agent via E2B, generate products to write back to cloud storage and return to client, and decoupling tasks, quarantine execution and document storage.
Back to the scene at the beginning: when Agent started to implement code, produce working papers and continue the mission in the next dialogue, these implementation environments needed a unified answer. The answer of VCI Agent Sandbox can be summarized in three sentences:
- Alignment of community standards, resource models from kubernetes-sigs/agent-sandbox, not bound by a single manufacturer;
- Enhancement of capacity to expand key features such as imagecache, sandboxsnapshot on compatibility, and to maintain familiar calls with E2B SDK;
vci.n4i; vci.n4i; vci.u1 for development of environment and work data, multi-wheel Agent; and vci.s1 for start-up of latency and associated creation capacity, mass assessment, etc.
Appendix: VCI Agent Sandbox Resource Selection Reference
Different Agent missions have different demands on the environment: There are concerns about batch start-up and simultaneous distribution, the need to retain workspaces for long periods, and the reliance on designation of CPUs or GPUs.
The profiles below can be selected according to the typical scenarios below, and the resource allocation can be determined in conjunction with the actual tasks.
If your team is already working on the Kubernetes build code, Coding Agent workspace or volume environment, welcome to the VCI Agent Sandbox trial with a real task to verify: Environmental readiness is slow, state retention is in line with expectations, resource bills are manageable, and existing Kubernetes platforms are successfully integrated. Click here to contact us.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.