Code Mode: Let the Code do the Talking - Sunil Pai, Cloudflare
Apr 19, 2026 · 19:40
Sunil Pai of Cloudflare presents 'Code Mode,' a paradigm where AI agents generate executable JavaScript instead of using JSON-based tool calls, drastically reducing token usage from 1.2 million to 1,000 for Cloudflare's 2,600 API endpoints. He demonstrates a live (if glitchy) demo of the Mythical server handling a DDoS response in one shot, and shares the 'harness' architecture: a sandboxed, capability-secure environment that grants only explicit APIs. The talk explores emergent behaviors like Kenton Varda's canvas where the model played tic-tac-toe by inspecting raw stroke state, and envisions long-running workflows, generative UI, and a future where code—not buttons—defines user interaction. Pai argues that developers must optimize for agent-facing DX with searchable docs, clear errors, and capability-based security, as the next billion users will be code-generating bots.