# The Future of AI Infra: from Kubernetes to Agent Sandboxes — Akshat Bubna, Modal CTO
<!--
ref: @content/youtube/latent-space/2026-07-08-the-future-of-ai-infra-from-kubernetes-to-agent-sandboxes-ak
tags: [serverless-gpu-infrastructure, agent-sandboxes, agent-experience, inference-autoscaling, speculative-decoding, distributed-training, cloud-capacity, networking, cli-design, agent-permissions]
version: 2
updated_at: 2026-11-21T20:33:49.734Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=UwxxlTNPjWo)**


*Synthesized from Akshat Bubna in conversation with the Latent Space host (not named in the transcript) on Latent Space, 2026-07-08.*

Akshat Bubna is the CTO of Modal, a cloud platform for AI workloads; the episode is an interview with him. The host is not named in the transcript, and a co-host is introduced in the captions under a name that may be garbled.

*Notes: the captions garble the guest's first name in the opening ("Ashhat"), so the title spelling is used; the CEO is named only as "Eric" in the transcript; one GPU count is unreadable and is left out; the networking figure is captioned as "terb" and is given here only as the transcript states it. Competitor and customer names are kept only where the transcript states them.*

## Core Thesis
Akshat argues that infrastructure for AI should be written as typed code that sits next to the code it runs, so that agents can change it as easily as humans, instead of hand-written Kubernetes YAML. He describes Modal's shift from developer experience to agent experience, and says the durable value sits in elastic GPU and sandbox primitives with hard boundaries, not in a model API.

## Key Insights
- **Origin:** Modal began as a better serverless runtime for bursty jobs such as ETL, job queues and batch processing. The team added GPUs about a year before ChatGPT, and its first product-market fit came from serving custom models for audio, video, robotics and computational-biology companies.
- **Why not Kubernetes:** Kubernetes is built for slow scaling and web-server shapes, not for workloads that burst up and down, need custom images, or need different accelerators. Decorators in code replace the YAML, so the configuration stays close to the code that uses it.
- **Agent experience:** the SDK team now optimizes for agent experience as well as developer experience. Customers reportedly find the model faster for agents than a configuration-file substrate, because an agent can edit a decorator and see changes live.
- **Sandboxes in 2023:** Modal built sandboxes in May 2023, before the category had a name. The first example ran a coding tool in a loop so an agent could iterate on itself. Models of that era diverged after about 10 iterations, so the product sat quiet until the last year.
- **Autoscaling and snapshots:** the main advantage is elastic autoscaling across regions, with true scale-to-zero. Modal snapshots GPU state, including a compiled torch model, so the next cold start is much faster.
- **Capacity:** Modal runs a capacity pool across 17 cloud providers and owns no data centers. It built a reliability layer so that a GPU failing under a provider does not affect the user's workload, which lets it use more capacity than a single user could.
- **Burst shapes:** RL rollouts are the burstiest workload, sometimes needing 100,000 sandboxes at once, and training runs need thousands of GPUs that scale up and down by the hour. Agents themselves are described as less bursty than RL.
- **Speculative decoding:** a small draft model proposes tokens and the large model verifies them in one batch, so the gain depends on the accept length, not on kernel work, which yields only a few points. The team open-sourced its block-based speculator, called DFlash in the transcript, and says accepted tokens are never worse than the target's own output.
- **Auto endpoints:** an endpoint can be created from the UI or the CLI with the optimizations already applied. The user gets the code and can eject to the full Modal experience to tune or fine-tune.
- **Sandbox networking:** sandboxes can run sidecar containers, a pod-like shape close to Docker Compose. Customers want outbound control, such as a man-in-the-middle proxy for logging, egress limits per domain, and credential injection. Modal also runs a private IPv6 overlay network that is TCP and not encrypted, with eBPF programs that allow or reject connections. It was built for distributed RDMA training and users have found it for other uses.
- **Distributed training:** a decorator gives a function a GPU cluster with RDMA networking for serverless multi-node training. Modal says it targets medium-scale post-training rather than large pre-training runs, and that elasticity matters most for researchers' small runs.
- **Auto research:** the guest describes it as guided hyperparameter sweeps rather than architecture search. Modal's internal training and inference teams use an agent harness to run such sweeps, for example to change GPU types and tune configs.
- **Batch tier:** a planned tier for users who do not need latency, with results in roughly 24 hours at lower prices. The demand comes mostly from non-LLM companies, such as computational biology, and some eval and synthetic-data work.
- **Languages and SDKs:** Python was the first SDK because data and ML teams used it. Go and TypeScript SDKs now exist, and TypeScript is used more for agent work because those workloads do little ML.
- **CLI for agents:** Modal moved logs and metrics into its CLI so agents can investigate failures. Its "Modal Bench" finds tasks agents cannot yet do. When agents reach for features that do not exist, the team treats that as product feedback and may add a surface for it.
- **Permissions:** the guest is skeptical of LLM-mediated permission for sandbox-level actions, because hard boundaries are needed, and says softer guardrails can sit on top of them.
- **Harness and partners:** Modal has no opinion on the agent harness and runs any harness inside its sandboxes. It partners with Anthropic and other labs, and sees managed agent products as a starting point before teams need more control over compute, files, snapshots and networking.
- **Scope:** Modal is cloud-only with no on-premises or air-gapped version. It says it does not want to serve only the LLM-API market, which the guest calls a less sticky hobbyist market, and it does not offer a bare model API.

## Actionable Takeaways
1. Put infrastructure configuration as typed code next to the function that runs it, so an agent changes a decorator rather than many YAML files.
2. For agent sandboxes, use hard network boundaries such as egress allow-lists, a logging proxy and credential injection, and treat LLM-mediated permission as a soft layer only.
3. Use GPU memory snapshots, including compiled model state, to cut cold-start time for bursty inference.
4. Send latency-tolerant batch work, such as evals and synthetic data, to a batch tier that returns results within about 24 hours.
5. Judge speculative decoding by accept length and the draft model's acceptance rate, not by kernel tuning, which gives only a few points.
6. Expose logs and metrics through a CLI so agents can investigate failures, and treat an agent reaching for a missing command as a product signal.

## Notable Quotes
> "I'm skeptical of LM mediated permission for stuff that is at the sandbox level because you do want hard boundaries." — Akshat Bubna
> "the models would just diverge after like 10 iterations and not produce anything meaningful." — Akshat Bubna, on the 2023 agent loops
> "we want to make frontier level performance available to everyone." — Akshat Bubna, on auto endpoints

---

*Related: `@content/youtube/patrick-ellis/how-i-dropped-out-of-college-3-critical-steps-before-dropping-out` · `@content/youtube/dan-martell/the-only-skill-you-need-to-make-money-in-2026` · `@content/web/apiiro/2026-11-05-coding-agents-leaking-secrets` · `@content/youtube/dan-martell/2026-08-12-how-to-make-rich-friends` · `@content/youtube/hormozi/how-to-catch-up-in-life-using-logic`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*