---
title: "Where Kubernetes Falls Short for AI Agents, and What Sits On Top"
url: "https://vanducng.dev/2026/11/28/where-kubernetes-falls-short-for-ai-agents/"
date: "2026-11-28"
series: "agentic-ai"
categories: ["AI"]
tags: ["platform-engineering","ai-agents","kubernetes","sandboxes","agent-substrate"]
---

# Where Kubernetes Falls Short for AI Agents, and What Sits On Top

> **Sources**: Bilgin Ibryam's X post, [Agent infrastructure for 2027](https://x.com/bibryam/status/2126796942269096259) (28 Nov 2026), and his article [Where Kubernetes falls short for AI agents](https://generativeprogrammer.com/p/where-kubernetes-falls-short-for) (26 Nov 2026). I cross-checked both against the primary docs for kagent, Agent Substrate, Kubernetes Agent Sandbox and the other projects I mention. Full link list is at the bottom. Where a number is a vendor claim, I say so.

This week I read a post that framed agent infrastructure as a shift as big as monoliths to microservices. I'm a data and platform engineer, so my reflex was to ask whether this is real or a rebrand of things I already run. After reading the docs, my answer is: the problem is real, Kubernetes is still the right foundation, but the **Pod** is the wrong unit for an agent session.

## The thesis in one paragraph

Kubernetes is excellent at stateless, long-running services. An AI agent session is the opposite on almost every axis: long-lived, stateful, idle most of the time, bursty, running code nobody reviewed, and acting for a specific user. You can force that into a Pod per agent, and it works for a demo. At scale you hit five mismatches. The emerging answer is layered: an **agent substrate** above Kubernetes (actors, snapshots, sandboxes, identity, egress) and an **agent platform** above that (users, conversations, versions, routing).

This is the picture the kagent 1.0 material draws:

![kagent 1.0 on Agent Substrate on Kubernetes: three layers](https://vanducng.dev/2026/11/28/where-kubernetes-falls-short-for-ai-agents/kagent-substrate-layers.png)

*Diagram: Bilgin Ibryam, from his [post on X](https://x.com/bibryam/status/2126796942269096259).*

- **Top: kagent**, the agent platform. A Session is the conversation, stored in kagent's database, and names one Actor. kagent suspends the Actor while the agent waits on its user, and reading history never wakes it. Model keys and MCP headers are injected on egress, so the runtime sees a placeholder. Agent plus Harness compile into an ActorTemplate, and conversations stay on their revision. An A2A gateway decides who may talk to which conversation, then hands off to Substrate's router.
- **Middle: Agent Substrate**: Actors, Workers, snapshots, sandboxes, identity, egress.
- **Bottom: Kubernetes**: nodes, Worker Pods, networking, storage, autoscaling.

## What Bilgin and the article actually say

Bilgin's post lists six shifts from VMs to containers to agents: control flow, compute unit, application state, execution isolation, network isolation and identity. His line on the compute unit is that agents "run as stateful actors" that suspend when idle and resume on a shared worker Pod. On isolation he argues a shared kernel is too thin for model-written code and you need "a stronger sandbox such as gVisor or a microVM". On networking he says outbound traffic becomes the critical boundary, and that an AI gateway such as agentgateway is emerging as a mandatory component.

The article walks through four characteristics of agents and what Substrate does about each:

1. **High idle time.** It says an interactive agent "can spend up to 95% of its session idle", with the caveat that it depends on the application. Substrate separates the session's lifetime from the worker Pod's lifetime.
2. **Nondeterministic behaviour.** Each active agent gets its own gVisor or microVM sandbox.
3. **Dynamic network access.** The egress gateway checks the destination and can add the credential, so the key never enters the sandbox. The article is careful to say that inspecting what is *sent* needs an additional policy.
4. **Delegated authority.** Each session gets a short-lived SPIFFE certificate and can get an agent JWT on demand. The article says native on-behalf-of flows in Substrate "are still under design", so the application has to do the user-delegation work, for example with OAuth 2.0 Token Exchange.

One caveat on provenance: Substrate was built by Solo.io with Google, and the kagent and Solo posts are the project's own announcements. I treat the *concepts* as well supported and the *performance numbers* as vendor claims until I run them.

## Five mismatches, and what each layer does about them

| Pod assumption | What an agent session is | K8s-native answer | Substrate / platform answer |
|---|---|---|---|
| Pod is the unit of scheduling | A conversation (actor) that outlives any one worker | StatefulSet of 1 + Service + PVC per agent; or [Agent Sandbox](https://agent-sandbox.sigs.k8s.io/docs/) `Sandbox` CRD | Many Actors multiplexed onto a pool of warm Worker Pods |
| Start is cheap, so cold start is fine | Mostly idle, then needs to wake in a blink | Warm pools (`SandboxWarmPool`) | Suspend to snapshot, resume on any free worker |
| Code is reviewed, shared kernel is OK | Runs model-written scripts | `runtimeClassName` for gVisor or Kata | Always sandboxed, plain containers not supported |
| Secrets live in env vars or mounted Secrets | A prompt-injected agent can read and leak them | NetworkPolicy plus a proxy you build | Egress gateway swaps a placeholder for the real credential |
| One ServiceAccount per service | Acts for a specific user, can move between Pods | Per-agent ServiceAccount | Per-actor SPIFFE identity that follows the actor |

Plus two that only appear once you have a platform: **routing to a specific conversation** and **versioning conversations against agent revisions**. Pods and Services route to replicas, not to "the conversation with this ID".

### 1. The unit of scheduling

The kagent team's own story is instructive. Their first design was one Pod, Service and ServiceAccount per agent, and they say it solved many problems at first. Then they asked whether a Pod is the right *lifecycle* abstraction for bursty agents and concluded Pods fit as execution workers but not as the deployment model. In Substrate, Kubernetes only sees WorkerPools and ActorTemplates. Workers and Actors are not Kubernetes objects. The Solo team gives two reasons: the Kubernetes API server is not built for millions of resources and frequent writes, and attaching and detaching millions of volumes is awkward.

The Kubernetes project itself agrees the primitives don't fit. The SIG Apps [Agent Sandbox blog post](https://kubernetes.io/blog/2026/03/20/running-agents-on-kubernetes-with-agent-sandbox/) describes agents as isolated, stateful, singleton workloads and says approximating them with a StatefulSet of one, a headless Service and a PVC per agent becomes "an operational nightmare" at scale.

### 2. Cold start versus suspend and resume

This is where I'd be most careful with numbers. Everything below is from each project's own docs.

| Approach | What it does | Stated numbers and limits |
|---|---|---|
| Agent Sandbox warm pool | Pre-warmed pods, claimed on demand | Docs: sub-2 second allocation with a warm pool versus 10 to 30 seconds without |
| Agent Sandbox + GKE Pod snapshots | Suspend deletes the Pod, resume restores from snapshot | GKE docs: restore takes roughly 3 to 5 seconds, needs gVisor, no microVMs; your app decides when to suspend |
| Agent Substrate | Suspend actor to snapshot, resume on any worker | Project claims under 500 ms resume and 500+ activations per second, 10x density (vendor claims) |
| E2B | Pause and resume a Firecracker microVM with memory | Docs: pause about 4 s per GiB of RAM, resume about 1 s |
| Daytona | Pause and resume VM sandboxes with memory | Containers don't support pause/resume; auto-pause defaults to 60 min idle |

One surprise: kagent 1.0 uses **Data-scope** snapshots. Its docs say a suspend keeps the durable volume (`/data`) and discards process memory, so a resume starts fresh containers from the image and restores saved files. Substrate itself supports `Full` snapshots with memory, but kagent chose the cheaper scope. So "the agent resumes with its RAM intact" is true of the substrate, not of kagent's default. The runtime has to write what it needs, such as a pending approval, to disk.

Memory snapshots also have sharp edges in the underlying tech. Firecracker's docs say network connections are not guaranteed to survive a resume, open vsock connections are closed, and snapshots must be resumed on identical software and hardware configuration. gVisor's checkpoint/restore is exposed through raw `runsc` commands, and the Kubernetes kubelet checkpoint API (beta since 1.30) warns that a checkpoint contains all memory pages, including keys.

### 3. Isolation

The options are a spectrum, not a binary. A container shares the host kernel. gVisor implements a kernel in userspace. Kata and Firecracker give each workload a VM with its own kernel. Agent Sandbox lets you choose per sandbox via `runtimeClassName`, and its docs call Kata the strongest boundary. Substrate supports gVisor and Cloud Hypervisor microVMs, and refuses plain containers. 

### 4. Secrets on egress

This is the idea I like most. In Substrate the actor sends a request with a placeholder header, the egress gateway checks the destination against the actor's `EgressPolicy`, fetches the real credential from a provider and replaces the header outside the sandbox. The docs say the actor "cannot read, snapshot, or exfiltrate the secret". The tradeoff is in the same doc: for HTTPS, the gateway terminates the actor's TLS, so the actor must trust the gateway CA. Cloudflare's Sandbox docs have a guide on a similar goal: keep credentials in your Worker rather than inside the sandbox.

This does not solve data leakage by itself. An allowed endpoint can still receive a prompt full of proprietary code, as a commenter on the article points out. Substrate's README says its egress gateway is a replaceable policy enforcement point where you can attach DLP or prompt-injection scanning. That is a hook, not a built-in.

### 5. Routing and versioning

kagent's docs say a caller addresses an Agent and names the conversation with the Session ID as the A2A `contextId`, and the gateway routes to whichever Actor sits behind it. A2A is the open protocol for agent-to-agent traffic, and agentgateway (now an Agentic AI Foundation project) proxies LLM, MCP and A2A. Versioning works because Substrate rejects changes to an ActorTemplate after creation. kagent compiles a new one per revision, so a running Session stays on its definition and only new Sessions get the edit.

## The layers, as a request flow

```mermaid
flowchart LR
    user["User"] --> gw["kagent A2A gateway<br/>(authz per Session)"]
    gw --> router["Substrate router"]
    router -->|"wake if suspended"| actor["Actor in gVisor/microVM<br/>on a warm Worker Pod"]
    actor -->|"placeholder credential"| egress["Egress gateway<br/>(agentgateway)"]
    egress -->|"real credential, policy checked"| ext["LLM / MCP / API"]
    actor -. "suspend between turns" .-> snap[("Snapshot storage<br/>S3 / GCS")]
    snap -. "resume on any free Worker" .-> actor
```

## When is Kubernetes-native enough, and when isn't it?

There are two other families that solve overlapping parts, and I don't think they're competitors so much as different cuts of the problem.

**Durable execution and virtual actors** (Temporal, Restate, Dapr Agents, Orleans, Cloudflare Durable Objects) make the *workflow state* survive. Temporal's docs describe workflows that resume after a crash or a multi-day wait for human approval. Restate journals every LLM call and tool execution and replays them on recovery. Dapr Agents' `DurableAgent` is built on Dapr Workflows, and the docs describe each agent as an actor enabling scale-to-zero. Orleans is the classic virtual actor model: a stable identity, with idle in-memory activations removed and recreated on a later call. Cloudflare Agents run in a Durable Object with its own SQLite database and hibernate when idle. What these give you is *logical* durability: replayed steps and persisted state. They don't, by themselves, give you a sandbox for code the model wrote or a filesystem snapshot. That is my reading of the docs, not a claim they make.

[Yeemio](https://x.com/yeemio/status/2126688150345207976) draws the same line at the application layer, in [Model, Workflow, Framework, Runtime, and Harness: How to Tell Them Apart](https://x.com/yeemio/status/2126688150345207976) (28 Nov 2026): a Runtime covers durable execution, a Sandbox covers isolation, and a Harness is the outer environment around the model (context, tools, permission gates). The Anthropic Managed Agents write-up he cites splits the system into a Session, a Harness and a Sandbox, and keeps credentials outside the sandbox in a vault and proxy, the same idea as Substrate's egress injection.

That harness layer is what I looked at in [Standard Agents: A Spec for the Agent Harness Itself](https://vanducng.dev/2026/11/16/standard-agents-a-spec-for-the-agent-harness/): a proposed spec so an agent package (model, prompts, tools, stop rules) can run in any compliant runtime. It answers what the agent is and how its loop works, not where the session runs.

**Hosted microVM sandboxes** (E2B, Modal, Daytona, Cloudflare Sandboxes) give you the isolation and snapshot piece as a service. Cloudflare Containers, for example, describe each instance as a microVM with its own kernel and network. Modal's snapshots, for instance, include memory snapshots that expire after 7 days.

**Scale-to-zero tools** (Knative, KEDA) are the Kubernetes-native answer to "mostly idle". Knative scales a Revision to zero and buffers requests in its Activator while a pod starts, so you pay a pod cold start. KEDA scales Deployments, StatefulSets, or any custom resource with a `/scale` subresource to zero on events, and its docs note that long-running work needs care around termination or running as Jobs. Both scale replicas of a *service*, which fits "stateless handler" better than "one stateful conversation".

### Decision table

| Your situation | Start here |
|---|---|
| A handful of agents, trusted tools, no model-written code | Plain Deployments, a ServiceAccount each, NetworkPolicy. Don't over-build |
| Event-driven or queue-driven agent jobs, stateless between runs | KEDA or Knative, plus Jobs for long runs |
| Multi-step agent workflow that must survive crashes and wait days for approval | Durable execution (Temporal, Restate, Dapr Agents) |
| Agent runs model-written code, you want isolation but stay K8s-native | Agent Sandbox with gVisor or Kata, warm pool |
| Same, plus idle sessions are expensive (hundreds or thousands of sessions) | Substrate-style suspend and resume, with kagent on top if you want the platform |
| You don't want to operate sandboxes at all | Hosted sandboxes (E2B, Modal, Daytona, Cloudflare) |
| Any agent holding real credentials | Egress proxy that injects them, whatever else you pick |

These compose. Durable execution for the workflow plus a sandbox for the tool call is a sensible pairing, and kagent can even act as the self-hosted sandbox for Claude Managed Agents (marked experimental).

## What I would try today

1. **Measure before adopting.** Pull a week of sessions and compute how long each is open versus how long it uses CPU. If it's not mostly idle, Pods may be fine.
2. **Try Agent Sandbox on a kind cluster** with a gVisor `runtimeClassName`, and a `SandboxWarmPool`. It's a small step and it stays inside normal Kubernetes.
3. **Check your Kubernetes version.** Substrate's docs and the kagent 1.0 post require Kubernetes 1.37 or later, because Substrate uses certificate APIs that went GA there. The kagent post suggests `kindest/node:v1.37.0` for trying it. If your clusters are older, that is your first blocker.
4. **Run kagent 1.0 on a throwaway cluster** with `kagent install`, and watch the Substrate view show sessions suspended at zero compute.
5. **Put one egress proxy in front of an existing agent** and move one API key out of its environment. This is the highest-value change regardless of which runtime you pick.
6. **Write down your identity story.** Substrate gives you a per-actor identity. Mapping the *user's* authority onto that session is still your job.

## What I couldn't verify

I did not run any of this, so the latency and density figures above are what the projects publish. Substrate's README itself says the project is "VERY young". Its security docs mark S3 per-actor credential scoping as planned, with GCS done. Substrate is described as a CNCF project in Solo's announcement and kagent as a CNCF Sandbox project; I didn't confirm Substrate's maturity level. And most of the Substrate evidence comes from the people who build it. I'd run the numbers on my own workload before betting a platform on them.

My takeaway: if you are a platform engineer, the question is no longer "Kubernetes or not". It is which part of the session lifecycle you want the cluster to own, and which part needs a layer that speaks in sessions instead of Pods.

## Sources

- Bilgin Ibryam, [post on X](https://x.com/bibryam/status/2126796942269096259), 28 Nov 2026
- Bilgin Ibryam, [Where Kubernetes falls short for AI agents](https://generativeprogrammer.com/p/where-kubernetes-falls-short-for), 26 Nov 2026
- Yeemio, [Model, Workflow, Framework, Runtime, and Harness: How to Tell Them Apart](https://x.com/yeemio/status/2126688150345207976), 28 Nov 2026
- [Standard Agents: A Spec for the Agent Harness Itself](https://vanducng.dev/2026/11/16/standard-agents-a-spec-for-the-agent-harness/), 16 Nov 2026
- kagent: [1.0 release post](https://www.kagent.dev/blog/kagent-v1-0-release), [release notes](https://kagent.dev/docs/kagent/latest/reference/release-notes/1.0/), [architecture](https://kagent.dev/docs/kagent/latest/about/architecture/kagent/), [Substrate architecture](https://kagent.dev/docs/kagent/latest/about/architecture/agent-substrate/), [suspend and resume](https://kagent.dev/docs/kagent/latest/about/substrate-runtime/suspend-and-resume/)
- Solo.io: [Announcing kagent 1.0 GA](https://www.solo.io/blog/announcing-kagent-1-0-ga), [What is Agent Substrate?](https://www.solo.io/blog/agent-substrate-powers-kubernetes-agents-with-kagent)
- Agent Substrate: [ate.dev](https://ate.dev), [repo README](https://github.com/kagent-dev/substrate), [egress credential injection](https://github.com/kagent-dev/substrate/blob/main/docs/guides/egress-credential-injection.md), [security overview](https://github.com/kagent-dev/substrate/blob/main/docs/security/security.md)
- kagent team: [Is a Pod the right deployment unit for an AI agent?](https://www.kagent.dev/blog/is-pod-right-deployment-unit-ai-agent)
- Kubernetes: [Agent Sandbox docs](https://agent-sandbox.sigs.k8s.io/docs/), [blog post](https://kubernetes.io/blog/2026/03/20/running-agents-on-kubernetes-with-agent-sandbox/), [warm pool quickstart](https://agent-sandbox.sigs.k8s.io/docs/use-cases/examples/quickstart/), [GKE Pod snapshots](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/agent-sandbox-pod-snapshots), [kubelet checkpoint API](https://kubernetes.io/docs/reference/node/kubelet-checkpoint-api/)
- Isolation and snapshots: [Firecracker snapshotting](https://github.com/firecracker-microvm/firecracker/blob/main/docs/snapshotting/snapshot-support.md), [gVisor checkpoint/restore](https://gvisor.dev/docs/user_guide/checkpoint_restore/), [E2B persistence](https://docs.e2b.dev/sandbox/persistence), [Modal snapshots](https://modal.com/docs/guide/sandbox-snapshots.md), [Daytona persistence](https://www.daytona.io/docs/en/persistence/), [Daytona isolation](https://www.daytona.com/docs/isolation), [Cloudflare Sandboxes](https://developers.cloudflare.com/sandbox/)
- Durable execution and actors: [Temporal Durable AI](https://docs.temporal.io/ai), [Restate durable agents](https://docs.restate.dev/ai/patterns/durable-agents), [Dapr Agents](https://docs.dapr.io/developing-ai/dapr-agents/dapr-agents-why/), [Orleans](https://dotnet.github.io/orleans/docs/overview/), [Cloudflare Agents runtime](https://developers.cloudflare.com/agents/getting-started/learn-the-runtime/)
- Scale to zero: [Knative](https://knative.dev/docs/serving/autoscaling/scale-to-zero/), [Knative request flow](https://knative.dev/docs/serving/request-flow/), [KEDA](https://keda.sh/docs/latest/concepts/scaling-deployments/)
- Identity and protocols: [SPIFFE](https://spiffe.io/docs/latest/spiffe-about/overview/), [agentgateway](https://agentgateway.dev/docs/standalone/latest/about/introduction/), [A2A](https://a2a-protocol.org/latest/)
