← ALL ARTICLES

· Kubernetes · AI Agents · Agent Sandbox

Running AI agents on Kubernetes: restarts aren't recovery

Kubernetes restarts a crashed agent, but its plan and tool results are gone. Lessons from KubeCon NA 2026 on durable execution, sandboxes and GPUs.

Running AI agents on Kubernetes was the thread through KubeCon + CloudNativeCon North America 2026, held in Salt Lake City from 9 to 12 November, which added a dedicated AI Inference + Agentic track this year. Across the keynotes and talks, the message I took away was simple: Kubernetes is very good at restarting things, and an agent that's been restarted hasn't necessarily recovered. If your team runs, or is about to run, long-lived agents on a cluster, here's what was announced, why a restart isn't recovery, and what I'd put in place.

Why a restart isn't recovery

Most of what we deploy to Kubernetes is built to be thrown away. A web pod that crashes comes back, reads its config, and starts serving requests again; nothing important lived inside it. An agent is different. Halfway through a task it holds a plan, a conversation with a model, the results of the tools it has already called, and often a working directory full of files. When its container is restarted, the kubelet gives you a fresh process from the same image, and all of that in-memory state is gone. The agent either starts the task again from the top or, worse, carries on without knowing what it already did.

A Cadence talk at the event put the problem in one line: "Model calls fail, tools time out, workers restart, and human approvals can take hours." Each of those is normal for an agent, and each is a point where a plain restart loses work. A model call that cost real money gets made twice. A tool that sent an email or created a record gets called again. A run that was waiting a day for someone to approve it holds a pod the whole time.

What was announced

Three pieces of news from around the event are worth knowing about, because they tackle different parts of this problem.

  • Agent Substrate reached 1.0. Google announced on 5 November that Agent Substrate, gVisor and OpenRL had been accepted into the CNCF Sandbox, and that Agent Substrate had reached 1.0. It maps a large number of stateful "actors" (agents) onto a smaller pool of warm "workers". When an agent is idle, waiting on a model, a tool or a person, Substrate snapshots its memory and files to storage and hands the worker back to the pool; Google says it restores onto any free worker in under 500 milliseconds and "picks up right where it left off".
  • Agent Sandbox kept moving. The Kubernetes SIG Apps project Agent Sandbox provides a Sandbox custom resource: a single stateful pod with a stable name, optional persistent volumes and a pluggable isolation runtime. v1.0.12, released on 20 November, added suspend and resume to its Go, Python and TypeScript SDKs.
  • Durable execution got its own sessions. The Cadence team's write-up describes a talk called "Agents Fail. Workflows Recover.", in which completed model and tool results were preserved so the same run could resume after an interruption without starting over.

Sandboxing came up throughout. In Virtualization Review's Day 1 report, CNCF Executive Director Jonathan Bryce describes enterprises wrapping agents in isolated sandboxes using Kata Containers, gVisor and SPIFFE/SPIRE. That makes sense: an agent runs code and calls tools on the strength of whatever a model decided, so it should be treated as untrusted.

Know which state survives what

The most useful thing you can do is be precise about where your agent's state lives, because each tool here keeps a different slice of it.

Agent Sandbox's Sandbox resource is a good place to start if you're on any Kubernetes cluster. Volumes created from its volumeClaimTemplates are owned by the Sandbox, kept while it's suspended, and reattached when it resumes; they're only removed when the Sandbox itself is deleted. Setting failedPodPolicy: Recreate (the default is Retain) tells the controller to replace a failed pod while keeping the Sandbox's identity and its volumes. Here's a minimal example, using the agents.x-k8s.io/v1beta1 API:

apiVersion: agents.x-k8s.io/v1beta1
kind: Sandbox
metadata:
  name: research-agent-42
spec:
  # Replace a Failed Pod, keeping the Sandbox's name and volumes
  failedPodPolicy: Recreate
  podTemplate:
    spec:
      # Must match a RuntimeClass installed on your nodes
      runtimeClassName: gvisor
      automountServiceAccountToken: false
      containers:
        - name: agent
          image: registry.example.com/research-agent:1.4.0
          volumeMounts:
            - name: workspace
              mountPath: /workspace
  volumeClaimTemplates:
    - metadata:
        name: workspace
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 5Gi

Suspending is a field on the same resource. Setting spec.operatingMode to Suspended terminates the pod but keeps the Sandbox and its volumes; setting it back to Running creates a new pod from the current template that reattaches them:

# Release the Pod while the agent waits; the Sandbox and its PVC stay
kubectl patch sandbox research-agent-42 --type merge \
  -p '{"spec":{"operatingMode":"Suspended"}}'

# Bring it back: a new Pod reattaches the same volume
kubectl patch sandbox research-agent-42 --type merge \
  -p '{"spec":{"operatingMode":"Running"}}'

But be clear about what that keeps. The v1.0.12 release notes say it plainly: running processes, memory and emptyDir storage do not survive a suspend unless it's paired with pod snapshots. Your workspace on the volume comes back; the agent's process, and anything it was holding in memory, does not. The project does support pod snapshots, but its snapshot examples are built on GKE Pod Snapshots with gVisor, so that part isn't portable to every cluster yet.

Agent Substrate goes further by capturing memory as well as the filesystem, so an agent really can carry on mid-thought. It's built around that: every actor runs inside a gVisor or Cloud Hypervisor microVM sandbox (its README says plain Linux containers aren't supported), and it has its own control plane, identity and network gateways. It's a bigger thing to adopt than a custom resource, and it's only just reached 1.0.

Make the agent's progress durable

Even a perfect memory snapshot doesn't help when the pod is killed between snapshots, the node disappears, or you deploy a new version of the agent and the old in-memory state no longer fits. So the layer I'd rely on is in the application: record each completed step somewhere durable, and on start-up, skip the steps that are already done. That's what durable execution engines such as Cadence do for you; you can also do a simple version yourself. In outline:

foreach ($plan->steps as $step) {
    if ($run->hasCompleted($step->id)) {
        continue; // finished before the restart: reuse the stored result
    }

    $result = $tools->call(
        $step->tool,
        $step->input,
        idempotencyKey: "{$run->id}:{$step->id}",
    );

    // Written to the database before moving on, not kept in memory
    $run->recordResult($step->id, $result);
}

Two things make this work. First, the result of every model call and tool call is written down before the agent moves on, so a restart replays from the journal rather than calling the model again. Second, tools that change things take an idempotency key, so if a crash lands between the call and the write, repeating the call is harmless. That's the same thinking as deciding which tool failures to retry in my post on agents that recover from tool failures; here it's applied to the whole run.

Once progress is durable, waiting becomes cheap. A run that needs a human to approve something can record that it's waiting and give up its pod entirely, rather than sitting in memory for hours. The Cadence write-up makes the same point, arguing for designs that preserve progress and "release resources while waiting".

Keep GPUs for the work that needs them

GPU efficiency was the third big theme, and it's related. An agent spends most of its time waiting on a model, tools or a person, and the agent's own process rarely needs a GPU. The expensive accelerators belong to model serving and training, so keep agent pods on ordinary CPU nodes and let them call inference over the network, rather than scheduling a long-running agent somewhere it ties up a GPU it isn't using.

For the GPU workloads themselves, Kubernetes has better tools than it used to. Dynamic Resource Allocation graduated to GA in Kubernetes 1.34, letting workloads describe the devices they need more precisely than a simple GPU count. Google's OpenRL, one of the projects donated to the CNCF, uses DRA to partition an accelerator pool and time-slicing to share the same GPUs between sampling and training.

What I'd do

  • Write down where each piece of agent state lives: the plan, the conversation, tool results and files. Anything that only lives in the process is lost on every restart.
  • Make progress durable in the application, with a durable execution engine or a simple step journal in your database, and give every side-effecting tool an idempotency key.
  • Run each agent as a Sandbox with a persistent workspace volume and failedPodPolicy: Recreate, rather than a bare pod or a Deployment replica that can be replaced with a new name.
  • Isolate agents with a sandboxed runtime such as gVisor or Kata Containers, with no service account token mounted unless the agent needs it.
  • Suspend agents while they wait for people, and only reach for memory snapshots (Agent Substrate, or pod snapshots where your platform supports them) once the cost of idle pods is worth the extra moving parts.
  • Keep agents off GPU nodes and spend GPU effort on serving and training, where DRA helps.

None of this needs a new platform on day one. The step journal and the idempotency keys are the parts that turn a restart into a recovery, and they work wherever your agent runs.

Sources