Kubernetes Orchestration for AI Agent Workloads
Agent Sandbox brings Kubernetes native controls for stateful, long-running AI workloads.

Kubernetes orchestration for AI agent workloads begins with an abstraction gap. A platform built around replicated services must support agents that need long-running, stateful, singleton runtimes. Reliable production operation depends on closing that gap with explicit controls for isolation, persistent state, stable identity, and lifecycle management, rather than treating an agent as another interchangeable pod.
Why Kubernetes' core abstractions don't fit the shape of an AI agent
A Deployment expresses a replicated service whose instances are interchangeable. A StatefulSet has numbered instances with stable identities, but it still manages them as a set. An agent needs a different unit of management. Its runtime is a digital workspace for an LLM, containing conversation state, a scratchpad for writing and executing code, and connections to external tools. Replacing that workspace is not equivalent to replacing a stateless service instance.
The time scale makes the difference sharper. Early generative AI interactions could be 50-millisecond stateless function calls, while autonomous agents run for minutes or hours as they make chains of model calls and use tools. What should happen when such an agent goes idle, then comes back to unfinished work? Neither a Deployment nor a generic StatefulSet natively expresses suspension and rapid resumption. A size-one StatefulSet, headless Service, and PersistentVolumeClaim can approximate the workspace, but the combination becomes cumbersome at scale and lacks built-in hibernation. What is missing is an abstraction for singleton, stateful, long-running, isolated runtimes.
How the gap has driven Kubernetes adoption into AI despite the mismatch
The CNCF’s January 2026 survey found that most container users run Kubernetes in production and a large majority of organizations hosting generative AI models use it for some or all inference workloads. The surrounding infrastructure is already there. Kubernetes supports distributed training through gang-scheduled jobs, inference through KServe and vLLM, and GPU management through the NVIDIA GPU Operator.
Running agents apart from those layers would make them much harder to operate. Kubernetes has mature networking, an established ecosystem, and one control plane for all these layers, so it is worth closing the abstraction gap on the same platform. Its extension mechanism also makes that possible without a fork. Custom Resource Definitions and operators let the community add resources for agents in the same way it built the Training Operator and KServe.
What a purpose-built agent abstraction looks like — the Sandbox CRD and Agent Sandbox
The Agent Sandbox project introduces a declarative API for the workspace itself, rather than leaving each team to assemble one from generic workloads. The project was developed under SIG Apps and reached v1.0 in August 2026 with a v1beta1 API. Google made it generally available as a GKE feature in May 2026. Its central resource, the Sandbox CRD, describes a lightweight, single-container environment built on Kubernetes primitives. Each Sandbox has a stable hostname, persistent storage through a PVC that survives restarts, and configurable isolation for untrusted code.
Provisioning is separated from the agent framework. The SandboxClaim API lets a framework request an environment without knowing how it will be provisioned, much as a PVC separates an application from storage provisioning. Scheduled deletion, pausing, and resuming make idle periods part of the declared lifecycle. The project also includes SandboxWarmPool for ready-to-use environments. Together, these features make the agent workspace an explicit object of orchestration, with identity and lifecycle attached to it.
Isolation and security for untrusted, AI-generated code running inside agent sandboxes
A workspace that executes AI-generated code has a trust boundary different from that of a service running reviewed application code. Standard containers share the host kernel. Because they share that kernel, container separation alone is not enough for the untrusted execution paths described here, even if the surrounding agent application is trusted. Agent Sandbox delegates low-level isolation to secure runtimes such as gVisor or Kata Containers. gVisor intercepts system calls through a userspace kernel, while Kata Containers provides an option for heavier isolation needs.
Runtime isolation cannot govern every agent action. Prompt injection and tool-call abuse can use capabilities that are allowed, so a barrier around code execution covers only part of the threat model. The recommended defense-in-depth approach combines sandboxed execution with verifiable workload identity through SPIFFE/SPIRE and admission-time policy enforcement through OPA or Kyverno. Namespace separation and strict NetworkPolicies constrain communication, while resource quotas limit GPU and memory consumption. Immutable audit logs let enterprises account for what happens within those technical boundaries, so the policy layer links isolation to compliance.
Stateful lifecycle management — warm pools, snapshots, and surviving pod restarts
Isolation protects the cluster, but it does not preserve unfinished work or make an agent ready quickly. SandboxWarmPool addresses readiness through pre-provisioned Sandbox pods. It can allocate hundreds of sandboxes per second per cluster, with the large majority of allocations completing in well under a second. The trade-off is idle capacity. Keeping an environment available is operationally different from keeping an agent’s state recoverable.
Google’s companion open-source project, Agent Substrate, separates those concerns by mapping many stateful actors onto a small pool of ready workers. When an actor goes idle, it snapshots memory and filesystem state to object storage and frees the worker pod. A later request restores the actor onto any free worker. For work that spans pod restarts, a durable workflow engine such as Temporal checkpoints completed steps, complementing the Sandbox’s persistent storage. As of April 2026, on-demand NVIDIA H100 GPUs are among the most expensive compute resources available from major cloud providers, so releasing idle capacity is also a direct cost control where those resources are involved.
Scaling agents at the control-plane level — KEDA, Agent Substrate, and the density problem
Can the platform manage the rate at which thousands or millions of agents become active and idle? Kubernetes Event-Driven Autoscaling, or KEDA, addresses the immediate demand signal by scaling pods against queue depth, message bus activity, or HTTP request rate. Those signals fit bursty agent invocations more closely than CPU and memory thresholds alone. KEDA can scale to zero during idle periods and back up when demand returns.
If every active session needs its own pod, control-plane and node overhead can become bottlenecks before compute capacity does. Agent Substrate targets that distinction explicitly, contrasting Kubernetes workloads of thousands of long-running services with millions of mostly-idle agents producing sub-second tool calls. Its snapshot-based worker sharing means fewer actors need a pod of their own. This is a runtime-management problem.
Computer-use agents and the additional isolation requirements of desktop access
Computer-use agents broaden the workspace from code execution to graphical interaction. Agent Sandbox provides isolated environments with VNC, browsers, and IDEs for agents operating desktop applications. Amazon WorkSpaces extended the commercial pattern in 2026 by giving AI agents their own desktops for ERP, CRM, and legacy applications without API access. Microsoft’s UFO³ coordinates work across Windows, Linux, and Android with dynamic task graphs that can run steps in parallel when they do not depend on one another.
An unrestricted agent could reach sensitive internal tools, use stored credentials, or move data through legitimate interface actions. Network policy alone cannot distinguish every such action from permitted work. The sandbox boundary is thus where separation between the agent’s desktop and the wider environment is enforced, and the identity and policy layers described earlier are still needed.
Enterprise compliance obligations created by agents acting as independent data processors
The same controls take on regulatory significance when agents act as independent data processors. GDPR’s records-of-processing requirement maps to an agent identity registry and data-access records for each agent. A pod label is not enough for that purpose. HIPAA’s unique identification and audit requirements map to unique cryptographic identities through SPIFFE/SPIRE and immutable infrastructure-level records of agent actions. These controls establish who acted and what data they accessed across runtime changes.
Ownership also has to govern the end of an agent’s life. SOC 2’s timely access-removal requirement maps to automated deprovisioning tied to the human or system that owns the agent, so offboarding revokes its identity and access. Namespace isolation by agent category and strict NetworkPolicies provide containment by function, while GPU and memory quotas create auditable resource boundaries. These mappings connect obligations to infrastructure controls, while establishing compliance requires more than a cluster configuration alone. With GDPR fines and HIPAA penalties reaching into the millions, autonomous processing makes that distinction consequential.
Orchestrating multi-agent systems — stable identity, service discovery, and coordination patterns
When agents coordinate, identity becomes a dependency of the workflow itself. A Sandbox’s stable hostname lets peers find it without relying on a pod IP that changes after a restart. Yet an address is only part of coordination. The infrastructure must preserve a discoverable workspace, while the application must preserve the conversation and tool-call state that gives the next interaction meaning. LangGraph supplies stateful orchestration and durable execution at that application layer, complementing the Sandbox’s persistent environment.
A service mesh such as Istio or Linkerd adds encrypted communication, traffic routing, and network-layer authentication between agents. For batch-style fan-out, Argo Workflows expresses a coordinator’s tasks as a DAG spanning heterogeneous job types. kagent takes a separate declarative approach by defining agents, models, and tools as Kubernetes resources, bringing their definitions into GitOps workflows. These mechanisms address different layers, but they depend on identities and relationships that remain intelligible when the underlying pods change.
GPU resource management across the agent stack — scheduling, sharing, and cost control
Agents need physical capacity to carry out coordinated work, especially when they rely on large inference workloads. The default Kubernetes scheduler admits individual pods rather than treating a multi-pod job as an indivisible unit. That can leave some pods holding GPUs while other required pods wait. The job cannot yet do useful work. Volcano uses gang scheduling to admit all pods in a job together or none, and has queue-based sharing and priority classes for workloads that compete for resources.
The NVIDIA GPU Operator automates drivers, the container toolkit, device plugins, feature discovery, monitoring components, and MIG management. Its version 25.3 added support for the NVIDIA GPU DRA Driver component, installed alongside the operator, enabling Multi-Node NVLink through Dynamic Resource Allocation for NVIDIA HGX GB200 NVL clusters. At the hardware-sharing layer, Multi-Instance GPU partitions A100/H100 GPUs into isolated slices when inference does not saturate a full device. Scheduling and sharing control allocation efficiency, while quotas bound what each agent category can consume and make that allocation auditable.
Developer tooling and observability for agent workloads running on Kubernetes
A healthy pod does not establish that an agent is making progress. Standard pod logs and CPU or memory metrics do not expose token utilization, latency at each LLM call, tool-call outcomes, hallucination risks, or workflow execution state. Those are different kinds of evidence. Debugging therefore requires visibility into the agent’s decision path as well as the runtime hosting it.
Prefect expresses flows as Python functions decorated with @flow and @task, using the same code path locally and on Kubernetes to remove a class of environment-parity bugs. Kubeflow Pipelines supplies DAG orchestration, experiment tracking, and lineage graphs for the training and evaluation pipelines that feed agent models. Kubernetes desktop clients are also adding AI and MCP integration, bringing cluster management and agent introspection into one interface. Engineers need to assess whether these views can connect an agent’s unfinished task to its identity, saved state, policy boundaries, and allocated resources, giving them a coherent object to debug.


