---
schema: 1
type: video
title: 'Code Mode: Let the Code do the Talking - Sunil Pai, Cloudflare'
description: >-
  Sunil Pai from Cloudflare discusses "Code Mode," an approach to interacting
  with AI agents where the model generates executable code (such as JavaScript)
  instead of relying on traditional JSON-based tool calling. This shift allows
  for more efficient, stateful, and complex system interactions. Speaker info:
  Sunil Pai created Partykit, the open source tool for real-time multi-player
  apps. For his day job, he builds AI Agents at Cloudflare. -
  https://sunilpai.dev/ - blog.cloudflare.com/author/sunil/ -
  linkedin.com/in/sunil-pai-a47732253/ Timestamps 0:00 Introduction and speaker
  background 1:16 What is "Code Mode"? 1:31 Limitations of traditional tool
  calling at scale 2:03 The shift to generating executable code 3:01 Scaling API
  usage at Cloudflare 4:05 Why code generation is more efficient 5:28 Live
  demonstration of the Mythical server 7:20 A new way of interacting with
  systems 9:09 Example: The Kenton canvas and tic-tac-toe anecdote 11:46 New
  software architecture: The "Harness" 13:28 Observability and security in
  sandboxed environments 14:15 Long-running workflows and generative UI 16:41
  Future outlook: Building for the next generation of users 17:50 The resurgence
  of capability-based security 18:33 Conclusion and final thoughts --- Watch
  along with the corrected transcript, summary, timestamps and resources on this
  talk's official AIE page:
  https://ai.engineer/talks/8txf05vVVl4-code-mode-let-the-code-do-the-talking
  Join our upcoming AI Engineer conferences (see https://ai.engineer landing
  page): - AIEi Shanghai, November 5–6 — the first for meeting top Chinese labs
  and engineers - AIE CODE in SF, November 10–12 — the top AI Coding conference
  returns - AIEi Sydney, December 7–8 — the first AIEi run alongside NeurIPS
  2026 in Sydney ---
canonical: 'https://liquidgold.cc/watch/8txf05vVVl4'
markdown: 'https://liquidgold.cc/watch/8txf05vVVl4.md'
llms: 'https://liquidgold.cc/watch/8txf05vVVl4/llms.txt'
parent: 'https://liquidgold.cc/channel/aidotengineer.md'
channel: aidotengineer
updated: '2026-10-24T15:15:31.800Z'
language: null
children: []
videoId: 8txf05vVVl4
durationSeconds: 1180
publishedAt: '2026-04-19T17:19:35.000Z'
searchChunks:
  - ordinal: 0
    text: null
    startSeconds: 88
    endSeconds: 99
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=88'
    heldReason: rights
  - ordinal: 1
    text: null
    startSeconds: 109
    endSeconds: 123
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=109'
    heldReason: rights
  - ordinal: 2
    text: null
    startSeconds: 123
    endSeconds: 133
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=123'
    heldReason: rights
  - ordinal: 3
    text: null
    startSeconds: 133
    endSeconds: 186
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=133'
    heldReason: rights
  - ordinal: 4
    text: null
    startSeconds: 198
    endSeconds: 255
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=198'
    heldReason: rights
  - ordinal: 5
    text: null
    startSeconds: 265
    endSeconds: 336
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=265'
    heldReason: rights
  - ordinal: 6
    text: null
    startSeconds: 457
    endSeconds: 559
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=457'
    heldReason: rights
  - ordinal: 7
    text: null
    startSeconds: 571
    endSeconds: 714
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=571'
    heldReason: rights
  - ordinal: 8
    text: null
    startSeconds: 571
    endSeconds: 714
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=571'
    heldReason: rights
  - ordinal: 9
    text: null
    startSeconds: 714
    endSeconds: 724
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=714'
    heldReason: rights
  - ordinal: 10
    text: null
    startSeconds: 724
    endSeconds: 813
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=724'
    heldReason: rights
  - ordinal: 11
    text: null
    startSeconds: 813
    endSeconds: 824
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=813'
    heldReason: rights
  - ordinal: 12
    text: null
    startSeconds: 859
    endSeconds: 872
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=859'
    heldReason: rights
  - ordinal: 13
    text: null
    startSeconds: 872
    endSeconds: 1001
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=872'
    heldReason: rights
  - ordinal: 14
    text: null
    startSeconds: 872
    endSeconds: 1001
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=872'
    heldReason: rights
  - ordinal: 15
    text: null
    startSeconds: 1011
    endSeconds: 1077
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=1011'
    heldReason: rights
  - ordinal: 16
    text: null
    startSeconds: 1077
    endSeconds: 1087
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=1077'
    heldReason: rights
  - ordinal: 17
    text: null
    startSeconds: 1087
    endSeconds: 1119
    watch: 'https://liquidgold.cc/watch/8txf05vVVl4?t=1087'
    heldReason: rights
---


# Code Mode: Let the Code do the Talking - Sunil Pai, Cloudflare

Sunil Pai from Cloudflare discusses "Code Mode," an approach to interacting with AI agents where the model generates executable code (such as JavaScript) instead of relying on traditional JSON-based tool calling. This shift allows for more efficient, stateful, and complex system interactions. Speaker info: Sunil Pai created Partykit, the open source tool for real-time multi-player apps. For his day job, he builds AI Agents at Cloudflare. - https://sunilpai.dev/ - blog.cloudflare.com/author/sunil/ - linkedin.com/in/sunil-pai-a47732253/ Timestamps 0:00 Introduction and speaker background 1:16 What is "Code Mode"? 1:31 Limitations of traditional tool calling at scale 2:03 The shift to generating executable code 3:01 Scaling API usage at Cloudflare 4:05 Why code generation is more efficient 5:28 Live demonstration of the Mythical server 7:20 A new way of interacting with systems 9:09 Example: The Kenton canvas and tic-tac-toe anecdote 11:46 New software architecture: The "Harness" 13:28 Observability and security in sandboxed environments 14:15 Long-running workflows and generative UI 16:41 Future outlook: Building for the next generation of users 17:50 The resurgence of capability-based security 18:33 Conclusion and final thoughts --- Watch along with the corrected transcript, summary, timestamps and resources on this talk's official AIE page: https://ai.engineer/talks/8txf05vVVl4-code-mode-let-the-code-do-the-talking Join our upcoming AI Engineer conferences (see https://ai.engineer landing page): - AIEi Shanghai, November 5–6 — the first for meeting top Chinese labs and engineers - AIE CODE in SF, November 10–12 — the top AI Coding conference returns - AIEi Sydney, December 7–8 — the first AIEi run alongside NeurIPS 2026 in Sydney ---

Canonical: https://liquidgold.cc/watch/8txf05vVVl4 · Channel: [AI Engineer](https://liquidgold.cc/channel/aidotengineer.md)

> Search chunk text is held until public-source provenance is verified.

## Document chunks

> Missing: no stored document chunks are available.
