# Code Mode: Let the Code do the Talking

Sunil Pai, Cloudflare

AI Engineer Europe 2026

[Talk page](https://ai.engineer/talks/8txf05vVVl4-code-mode-let-code-do-talking) · [Video](https://www.youtube.com/watch?v=8txf05vVVl4)

## Code Mode: Let the Code Do the Talking

Generated code can compose API calls, act on existing application state, and tailor software to a task—provided its execution environment grants only the capabilities it needs.

Familiarity with JavaScript, API calls, and the basic model–tool interaction loop will help you follow the examples.

### When tool calling becomes choreography

[1:31](https://www.youtube.com/watch?v=8txf05vVVl4&t=91s)

A couple of tools and a short agent run are manageable. Add Google services, Jira, and a wiki, and hundreds of tool definitions start crowding the model’s context. Completing a task also becomes a sequence of exchanges: request an operation, return its result, ask the model what to do next. Composition gets awkward, and each round trip adds delay.

Sunil Pai’s alternative is to ask the model for JavaScript that runs against an exposed environment. Instead of expressing every step through another JSON tool call, the model writes a program. A typed API gives it a structure to work against; syntax checking and type checking offer feedback; and programming languages already have extensive representation in model training data.

**Move the composition into code.** A single execution can loop through results, retain intermediate state, sequence dependent operations, and parallelize independent ones. The underlying API requests still happen, but the model need not intervene between every pair of requests. These are ordinary programming capabilities applied to agent execution.

![Slide contrasting tool calling with Code mode: thousands of tool definitions and repeated back-and-forth versus a typed API, generated code and one execution.](https://ai.engineer/api/talk-essay-media/be0f7ecf39e739c8af8ddeb6ea1813003e87cfbbdb3051c7480a87a4fb7a256e)

Let the model write code instead.

### An entire API behind search and execute

[3:01](https://www.youtube.com/watch?v=8txf05vVVl4&t=181s)

Cloudflare’s API makes the scaling problem concrete. Pai credits colleague Matt Carey with applying Code Mode to a surface he estimates at roughly 2,600 endpoints. Pai estimates that exposing each endpoint as an individual tool would require about 1.2 million tokens in the first call. The problem arrives before the agent has done any useful work: describing everything it could do overwhelms the interface.

Carey’s [implementation](https://blog.cloudflare.com/code-mode-mcp/) exposes just two tools, both accepting a string of code:

| Tool | Code runs against | Purpose |
| --- | --- | --- |
| `search` | The complete OpenAPI document | Find relevant operations and their schemas |
| `execute` | Callable API functions | Compose and perform the selected operations |

The complete OpenAPI document is available to the search program on the server; it is not inserted wholesale into the model’s context. The program selects the relevant information and returns it. The model can then write execution code using the operations it discovered. This separates **discovering capabilities** from **using capabilities**.

Pai reports reducing that tool-description footprint to roughly 1,000 tokens, approximately a 99.9% reduction. His spoken baseline varies from 1.2 to 1.5 million tokens; Carey’s published measurement compares approximately 1.17 million tokens of equivalent tool definitions with about 1,000 for the two-tool interface, using `tiktoken`. The comparison concerns tool-surface context overhead, not total task tokens or latency. The API remains broad; its full description no longer has to accompany every initial request.

![Slide showing 2,594 Cloudflare API endpoints, search and execute tools, approximately 1,000 tokens and a 99.9% reduction, beside the speaker.](https://ai.engineer/api/talk-essay-media/12bd0353159fe42919f8b8d7b859e1b73369f9ebadd6fc35164e986099b82b50)

From 2,594 endpoints to two tools.

### Compose the task, then watch execution

[4:21](https://www.youtube.com/watch?v=8txf05vVVl4&t=261s)

Consider an incident request: the website is being DDoSed, and the customer wants the attacking IP addresses identified and blocked. At three in the morning, navigating a complicated dashboard is an expensive way to express an otherwise direct intention.

Pai estimates about eight conventional MCP round trips for the illustrative DDoS task, versus one composed JavaScript execution near the API. That is a comparison of orchestration: the generated program still calls the necessary API functions, but it can carry results between them without asking the model to select each next step. The eight-round-trip figure is an estimate for the example, not a measured incident-response benchmark.

The live demonstration uses a smaller request: list the account’s Workers. Pai gives the demo read-only access and approves an allow interaction. The intended sequence is straightforward:

1. Search for API endpoints matching the Workers-listing task.
2. Generate code that calls the discovered listing endpoint.
3. Return the resulting Workers to the user.

The visible run reaches endpoint discovery and generated execution code.

Then it encounters JavaScript errors and appears to attempt pagination. Pai says he tested it ten times before going onstage, but the stage run does not establish a clean end-to-end completion. He points to Workers being listed and suggests the remaining trouble might be rendering. The demonstration therefore shows discovery and execution activity, with an unresolved failure in the overall interaction. A smaller tool interface does not eliminate mistakes in generated programs or result handling.

### Give everyone access to a small script

[7:08](https://www.youtube.com/watch?v=8txf05vVVl4&t=428s)

Optimizing an MCP server is only the first application. The larger possibility is a different way for people to interact with systems: describe a task, then let generated code perform the custom combination of operations it requires.

Suppose there are 200 photos on a desktop that need categorizing and renaming. A programmer opens an editor and writes a script, perhaps sending each image to a vision model for a caption before renaming it. A nontechnical user has to ask someone for help or find an application whose built-in workflow comes close. Pai caricatures that second option as a generic photo-management subscription with an unnecessary background daemon. The underlying limitation is real: the application’s predefined interface determines which combinations are convenient.

A language model can translate a request to rename files by date and location into code that operates on the exposed system. The user gains access to a task-specific script without needing to write it. This moves the boundary between what a programmer can customize and what everyone else must accept from a product’s buttons and forms.

### Play the game already on the canvas

[9:03](https://www.youtube.com/watch?v=8txf05vVVl4&t=543s)

Kenton Varda, introduced as the creator of Cloudflare Workers, explored this boundary in a personal coding environment. He asked it to generate a drawing canvas in the style of tldraw or Excalidraw, complete with brushes and colors. On that canvas, he drew a Tic-Tac-Toe grid and an X in the top-left corner.

When Kenton asked the model to play Tic-Tac-Toe with him, it initially started generating a new Tic-Tac-Toe application. He stopped it. The existing application already exposed its state: an array of strokes, each made from points. The grid lines and X were present in that array. He redirected the model to inspect the state and play there.

The model brought the stroke data into its context, recognized the board and the X in the top-left cell, and drew a circle in the center. **There was no Tic-Tac-Toe code in the application.** The model interpreted a general drawing representation and used the same representation to make its move.

At the data level, the change can be as small as appending one stroke. This JavaScript expresses that operation using a teaching board with grid lines at coordinates 100 and 200, an X in the top-left cell, and a circle centered at `(150, 150)`:

```javascript
const strokes = [
  { id: "grid-v1", points: [[100, 0], [100, 300]] },
  { id: "grid-v2", points: [[200, 0], [200, 300]] },
  { id: "grid-h1", points: [[0, 100], [300, 100]] },
  { id: "grid-h2", points: [[0, 200], [300, 200]] },
  { id: "x-down", points: [[25, 25], [75, 75]] },
  { id: "x-up", points: [[25, 75], [75, 25]] }
];

const circle = Array.from({ length: 65 }, (_, i) => {
  const angle = (i / 64) * 2 * Math.PI;
  return [
    150 + 30 * Math.cos(angle),
    150 + 30 * Math.sin(angle)
  ];
});

const nextStrokes = [
  ...strokes,
  { id: "o-center", points: circle }
];
```

The existing strokes stay intact. `nextStrokes` adds the center move in the format the canvas already understands; no separate game interface is necessary.

Pai reports that **Opus** eventually lost the game, and that its reasoning traces suggested it had let Kenton win. That is his interpretation of the traces. The architectural observation does not depend on playing strength: the model could participate by reading and changing existing application state.

### A harness for acting inside the system

[11:10](https://www.youtube.com/watch?v=8txf05vVVl4&t=670s)

Pai describes the shift as the model having “started inhabiting the state machine.” It stopped building another application and began acting within the one that already existed. He presents this as an exploratory direction, with a Ghost in the Shell reference, rather than a settled architecture with all its implications worked out.

This helps explain the growing interest in agent harnesses. Coding agents can serve as general-purpose computing interfaces because they can generate the programs needed for a particular task. Pai points to people running [Pi](https://github.com/earendil-works/pi) on Mac minis, while questioning the need for dedicated hardware merely to make API calls. The useful abstraction is the harness, wherever it runs.

A harness supplies more than code generation. It provides a safe execution space and exposes the capabilities that generated code may use. Intent becomes code; code enters a scoped runtime; the runtime connects it to selected system operations. The scope of those operations determines what the agent can actually do.

![Flow diagram from user intent or agent through model-written code to a harness with a scoped runtime, branching into three capabilities.](https://ai.engineer/api/talk-essay-media/42a8bcdb3891ff48dc271e39dcf2fd410ad323a58c201fa32bab5553bbb340e3)

The harness connects generated code to a scoped runtime and explicit capabilities.

### Begin with execution and no authority

[12:31](https://www.youtube.com/watch?v=8txf05vVVl4&t=751s)

The word sandbox covers several different designs. Cloudflare’s container- and VM-based Sandbox SDK is not the environment Pai means here. His contrast is between surrounding a feature-rich environment with security controls and starting with an environment that can only execute code. Initially, it has no exposed APIs and cannot make fetch requests. Capabilities are then granted explicitly.

Cloudflare implements this approach with [Dynamic Workers](https://blog.cloudflare.com/dynamic-workers/) and V8 isolates. Pai emphasizes fast startup and cites roughly ten years of security hardening. The important property is not JavaScript by itself: the host controls which APIs are exposed and which outgoing network connections are possible.

His recommended default is **no outgoing fetches, only exposed APIs**. Network isolation must be configured; it is not an automatic property of an isolate. The [SDK revision available before the talk](https://developers.cloudflare.com/changelog/post/2026-02-20-codemode-sdk-rewrite/) documents default `fetch`/`connect` blocking in `DynamicWorkerExecutor`, while Dynamic Worker configuration supports `globalOutbound: null`. A generated program’s authority comes from the capabilities the host grants, rather than unrestricted access to the network.

The runtime also needs observability at the level of the generated code. Pai’s deliberately absurd example is investigating why an agent made a multimillion-dollar trade the previous Tuesday: the operator needs to recover the program responsible and understand what it did. Fast startup without an inspectable execution history is insufficient for consequential actions.

V8 is one implementation choice. WebAssembly or a custom JavaScript interpreter could serve the same role if they provide controlled capabilities and fast execution. The architectural requirements survive the runtime choice: a bounded execution environment, explicit authority, and enough visibility to explain its actions.

### From one execution to personal software

[14:17](https://www.youtube.com/watch?v=8txf05vVVl4&t=857s)

Once a program can execute against controlled capabilities, the next question is how long it can live. Pai proposes extending a one-off API operation into workflows that run for days, months, or years, with each instance carrying state through its lifetime. Those persistent instances could also support interfaces tailored to individual users. These are proposed extensions beyond the demonstrated API run.

E-commerce illustrates the opportunity. As a store serves more people, its interface tends toward something generic enough to work for everyone. Personalization often changes a small detail, such as a button color. Pai proposes generating a substantially different interface for the task at hand—although he jokes that the Opus-generated slide illustrating this idea still looks poor.

The store already has context: preferences, cart contents, orders, and clues about what might be frustrating the customer. That context can become actions in a generated interface. It need not be delivered through a blank chat box.

- **Return and replacement:** A customer wants to return shoes and find something similar under $100. The interface could combine those operations even if product engineers never built that exact flow.
- **Delayed order:** Another customer wants to know what happened to an overdue purchase. Their interface should surface the relevant order and resolution actions instead.

The proposal is to generate different programs for different users while keeping them backed by the system the product team built.

The harness need not live inside a single product. Placing it closer to the user—even on an iPhone—could let it combine capabilities from several services, task by task, inside the same safe environment. Placement changes which systems can be brought together around the user’s intent.

For UI developers, this reopens the question of what an interface should be. Pai characterizes generated code plus safe execution as an underexplored branch of software design. The possibility is not simply another way to generate screens: the program that mediates between a person and their services can itself be assembled for the occasion.

### Design for the code-generating client

[17:06](https://www.youtube.com/watch?v=8txf05vVVl4&t=1026s)

Humans remain the customers, but increasingly the immediate clients of software systems will be agents generating code. Pai’s rhetorical billion new users are these software intermediaries. Serving the human therefore includes making the system legible and usable to the agent acting for them.

That calls for a deliberate developer experience:

- **Discovery:** Registries and search should help an agent find the operations it needs.
- **Contracts:** Types and syntax feedback should make valid interactions easier to construct.
- **Documentation:** Markdown should make the system’s behavior accessible as text.
- **Recovery:** Errors should tell the agent what it can do next.

These are familiar developer concerns, now applied to clients that synthesize their own programs during a task.

**Capability-based security** is the principle Pai most wants builders to retain. JavaScript is incidental: Python, WebAssembly, or even a renewed interest in Lisp could support the same direction. The recurring runtime needs are events, sandboxing, explicit capabilities, embeddability, fast startup, and ephemeral execution.

Pai expects React and other UI programmers to have an advantage because they have spent so much time close to users. Understanding what a person is trying to accomplish remains valuable even when the interface and its coordinating program can be generated dynamically.

For a long time, programmers had code’s flexibility while everyone else had buttons and forms. That distinction is beginning to break. Generated code can become the means by which a person’s particular intention reaches the systems they use, instead of requiring that intention to fit an existing screen.

![Slide reading “Programmers got code. Everyone else got buttons.” with “That distinction is breaking.” underneath, beside the speaker.](https://ai.engineer/api/talk-essay-media/a06a32eade818d57c7167b23e832a012df8767d4cb4b023ac1303da32962efce)

Programmers got code. Everyone else got buttons.

“Let the code do the talking” names this interaction model: code performs the work between human intent and system capabilities. Pai leaves it as an opening research direction—how to give more people the flexibility of programming while keeping execution understandable and its authority controlled.

## Resources

- [Code Mode: give agents an entire API in 1,000 tokens](https://blog.cloudflare.com/code-mode-mcp/) — Matt Carey's implementation account explains discovering and composing Cloudflare API operations through search and execute.
- [let the code do the talking](https://sunilpai.dev/posts/after-wimp/) — Sunil Pai connects Code Mode, the canvas experiment, capability-scoped sandboxes and software tailored to individual users.
- [Code Mode: the better way to use MCP](https://blog.cloudflare.com/code-mode/) — The original Cloudflare account explains presenting tools as TypeScript APIs and executing generated code in a restricted environment.
- [Sandboxing AI agents, 100x faster](https://blog.cloudflare.com/dynamic-workers/) — Introduces Dynamic Workers and explains isolate execution, explicit resource bindings and outbound network controls.
- [Code Mode Example](https://developers.cloudflare.com/dynamic-workers/examples/codemode/) — A worked Agents SDK example wraps tools into a code-generation tool and executes the result in an isolated Dynamic Worker.
- [Pi Agent Harness](https://github.com/earendil-works/pi) — Source and documentation for Pi's coding agent, agent runtime and supporting libraries.

## Slides

### AI Engineer Europe

[0:00](https://www.youtube.com/watch?v=8txf05vVVl4&t=0s) [AI Engineer Europe logo on a black background.](https://assets.ai.engineer/sites/aiecode2025/sha256/24e440bf5dfd4ecccd4fffdc9ef9243be07fff10b16e87c6b80fbc594828e3ea.webp)

AI Engineer
EUROPE

### Presenting Sponsor

Google DeepMind is the presenting sponsor.

[0:05](https://www.youtube.com/watch?v=8txf05vVVl4&t=5s) [Google DeepMind presenting sponsor card.](https://assets.ai.engineer/sites/aiecode2025/sha256/e0a2733394b9e76d5cbcc292edcb1e7d0d4305725368334cfa74aa4dc6f38f30.webp)

PRESENTING SPONSOR

Google DeepMind

### Platinum Sponsors

Braintrust, WorkOS and OpenAI appear as platinum sponsors.

[0:10](https://www.youtube.com/watch?v=8txf05vVVl4&t=10s) [Platinum sponsors Braintrust, WorkOS and OpenAI.](https://assets.ai.engineer/sites/aiecode2025/sha256/e1dd203f1a8e56f01a056ace3935c40cbc175cc0d1d780777c507da699e961d0.webp)

PLATINUM SPONSORS

Braintrust
WorkOS
OpenAI

### Code Mode

Sunil Pai introduces Code Mode and its implications, acknowledging prior work on the idea.

[1:06](https://www.youtube.com/watch?v=8txf05vVVl4&t=66s) [Code Mode title slide with the subtitle Let the code do the talking, shown beside speaker Sunil Pai.](https://assets.ai.engineer/sites/aiecode2025/sha256/349314a634f83fc73139de42550e000e52bb3d0471bd82e020a5af2d268f213f.webp)

Code Mode
Let the code do the talking

Sunil Pai
AI Engineer London 2026

KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

AI Engineer EUROPE
PRESENTED BY Google DeepMind

Interface text:
2/28

### Tool calling gets weird at scale

Hundreds of tools can crowd the model’s context, while repeated model–tool exchanges slow the run. Bash reduces the number of tools, but still passes text without types, a permissions model or composition.

[1:30](https://www.youtube.com/watch?v=8txf05vVVl4&t=90s) [A model and tool sequence illustrates context bloat, intermediate results, awkward composition and giant tool surfaces.](https://assets.ai.engineer/sites/aiecode2025/sha256/b60910840047a8a2e02f96dc7cde53fd484f0b907902262c6b52d0b134043001.webp)

Tool calling gets weird at scale

model → tool → model → tool → …

Giving models bash helped — one tool instead of many. But it’s still text in, text out, with no types, no permissions model, no composition.

context bloat
intermediate results
awkward composition
giant tool surfaces

Interface text:
2/28
AI Engineer Europe
Presented by Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Let the model write code instead

Pai describes asking the model to generate code, usually JavaScript, to run against an environment. Code mode uses a typed API and can replace repeated tool-calling exchanges with one execution.

[2:02](https://www.youtube.com/watch?v=8txf05vVVl4&t=122s) [Tool calling is compared with code mode, which uses a typed API, generated code and one execution.](https://assets.ai.engineer/sites/aiecode2025/sha256/2395815e31b43872e92b5c5bbeb0fe6c5d7675649599d9518fd389c498de7c7b.webp)

Let the model write code instead

Tool calling
× thousands of tool definitions
× repeated back-and-forth

Code mode
✓ typed API
✓ generated code
✓ one execution

Interface text:
3/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Code is the only tool that composes

Code can hold state, branch, loop, sequence and parallelize work in one execution, instead of feeding each tool result back individually.

[2:44](https://www.youtube.com/watch?v=8txf05vVVl4&t=164s) [The slide lists holding state, branching, looping, sequencing and parallelizing as code capabilities.](https://assets.ai.engineer/sites/aiecode2025/sha256/17030c6753e9456a0f3569e9de8f989477c03d1a17b0161b7e4883b8688678f2.webp)

Code is the only tool that composes

Every other tool is atomic. You call it, get a result, feed it back. Code composes — and once written, it executes deterministically.

hold state
branch
loop
sequence
parallelize

Interface text:
4/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### From 2,594 endpoints to two tools

Cloudflare exposes its 2,594 API endpoints through search and execute, both of which accept code. The slide reports about 1,000 tokens, a 99.9% reduction versus naive MCP.

[2:59](https://www.youtube.com/watch?v=8txf05vVVl4&t=179s) [A slide presents 2,594 Cloudflare API endpoints through search and execute tools, with approximately 1,000 tokens and a stated 99.9% reduction.](https://assets.ai.engineer/sites/aiecode2025/sha256/247250f91c40952d3e962d21a9f40bbe7a8acbdd1634150d23871919e434bcdf.webp)

From 2,594 endpoints to two tools

2,594
Cloudflare API endpoints

search()    execute()

~1,000 tokens
with code mode

99.9% reduction
vs naive MCP

Interface text:
5/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Same task, one round trip

For a DDoS response, the slide contrasts eight model round trips with one JavaScript execution that finds high-rate IPs and creates blocking rules. Each tool call otherwise returns to the model and is re-serialized into context.

[5:09](https://www.youtube.com/watch?v=8txf05vVVl4&t=309s) [Slide compares eight tool-calling round trips with one code execution for blocking attacking IPs.](https://assets.ai.engineer/sites/aiecode2025/sha256/6b7304b43a6bf6392db0de9601e24ea5430a85d7fed1d582a083e79ab4e2d02e.webp)

Same task. One round trip.

“We’re getting DDoSed — find the attacking IPs and block them”

tool calling 8 round trips
1 model → getZones()
2 model → getZoneAnalytics(zone)
3 model → identifyAttackPattern(analytics)
4 model → listFirewallRules(zone)
5 model → createFirewallRule(zone, rule)
6 model → enableRateLimit(zone, config)
7 model → verifyRule(zone, ruleId)
8 model → getZoneAnalytics(zone)

each call returns to the model, re-serialized into context

code mode 1 execution
const zone = await codemode.getZones()
  .then(zs => zs.find(z => z.name === target));

const analytics = await codemode
  .getZoneAnalytics(zone.id);

const attackIPs = analytics.requests
  .filter(r => r.rate > threshold);

await Promise.all(attackIPs.map(ip =>
  codemode.createFirewallRule(zone.id, {
    action: "block",
    filter: `ip.src eq ${ip.address}`
  })
));

return { blocked: attackIPs.length };

Interface text:
6/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
Engineering the future of AI

### Cloudflare MCP demo

In a live demo, the presenter selects “List my Workers” and sends it to a client connected to the Cloudflare API through a remote MCP server.

[5:26](https://www.youtube.com/watch?v=8txf05vVVl4&t=326s) [Cloudflare MCP client with example prompts and an empty conversation.](https://assets.ai.engineer/sites/aiecode2025/sha256/1e4fc5c10a0840fae55145630395ac9e521d486d24f72738c4f6dcd1a197692d.webp)

Cloudflare MCP
Real Cloudflare API via remote MCP server

Try the Cloudflare MCP server
What's the traffic today?
List my Workers
Create a hello world Worker

mcp.cloudflare.com/mcp
OAuth · MCP client
2,500+ endpoints

Interface text:
cloudflare
MCP client
reset
Ask Cloudflare anything...
Send
7/28

AI Engineer EUROPE
PRESENTED BY Google DeepMind
Engineering the future of AI

### Searching Cloudflare API endpoints

The demo searches API operation summaries for “worker” or “script” and returns matching methods, paths, and summaries. The speaker then reports JavaScript errors while the client tries to paginate.

[6:06](https://www.youtube.com/watch?v=8txf05vVVl4&t=366s) [Cloudflare MCP demo shows a tool call searching API endpoint descriptions for worker-related operations.](https://assets.ai.engineer/sites/aiecode2025/sha256/7d62c04e288aab63eedd01354bcb76cdc5c46e67f6f86867a556d8afea5445fa.webp)

Cloudflare MCP
Real Cloudflare API via remote MCP server

{
  "code": "async () => {\n  const results = [];\n  for (const [path, methods] of Object.entries(spec.paths)) {\n    for (const [method, op] of Object.entries(methods)) {\n      if (op.summary?.toLowerCase().includes('worker') || op.summary?.toLowerCase().includes('script')) {\n        results.push({ method: method.toUpperCase(), path, summary: op.summary });\n      }\n    }\n  }\n  return results;\n}"
}
{
  "content": [
    {
      "type": "text",
      "text": "[\n  {\n    \"method\": \"PATCH\",\n    \"path\": \"/accounts/{account_id}/addressing/prefixes/{prefix_id}\",\n    \"summary\": \"Update Prefix Description\"\n  },\n  {\n    \"method\": \"GET\",\n    \"path\": \"/accounts/{account_id}/builds/builds/latest\",\n    \"summary\": \"Get latest builds by script IDs\"\n  },\n  {\n    \"method\": \"GET\",\n    \"path\": \"/accounts/{account_id}/builds/workers/{external_script_id}/builds\",\n    \"summary\": \"List builds by script\"\n  },\n  {\n    \"method\": \"GET\",\n    \"path\": \"/accounts/{account_id}/builds/workers/{external_script_id}/triggers\",\n    \"summary\": \"List triggers by script\"\n  },\n  {\n    \"method\" [illegible]"

mcp.cloudflare.com/mcp
OAuth · MCP client
2,500+ endpoints

Interface text:
cloudflare  2 tools
MCP client  reset
List my Workers
tool  done
tool  done
Ask Cloudflare anything...
Stop
7/28

### A different model of interaction

Pai sees running code as more than an MCP server optimization: it suggests a new way for LLMs to interact with systems.

[7:11](https://www.youtube.com/watch?v=8txf05vVVl4&t=431s) [Slide says an optimization pointed to a different model of interaction.](https://assets.ai.engineer/sites/aiecode2025/sha256/2b2bf6ac9d30887384f79fb1e37ad2d69ecfd9115b63d7244b462a7d455f6f3e.webp)

This looked like an optimization

but it pointed at a different model of interaction

Interface text:
OpenAI
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE
8/28

### Procedures and interfaces

Pai imagines a programmer writing a script to categorize and rename 200 photos, while a non-programmer might turn to an app.

[7:33](https://www.youtube.com/watch?v=8txf05vVVl4&t=453s) [Slide contrasts programmers' procedures with interfaces used by everyone else, with examples of each.](https://assets.ai.engineer/sites/aiecode2025/sha256/36af8f9c86337699050a4517c20c4d65cfcc2b7a06f17019147050f40db7cd14.webp)

Programmers got procedures.
Everyone else got interfaces.

Programmers
• shell
• script
• SQL
• API
• automation

Everyone else
• form
• menu
• dashboard
• button
• wizard

Interface text:
9/28
AI Engineer EUROPE
PRESENTED BY
Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Procedures and interfaces

To categorize and rename 200 photos, a programmer can write a script. Pai contrasts that with his mother’s options: ask for help or buy an app.

[7:38](https://www.youtube.com/watch?v=8txf05vVVl4&t=458s) [Slide contrasts programmer tools such as scripts and APIs with interfaces such as forms and menus.](https://assets.ai.engineer/sites/aiecode2025/sha256/8bf1386a8fe07384fe77c646c19f2e5f5eaf8ddb9b654af8d4fb0a5ec01e838b.webp)

Programmers got procedures.
Everyone else got interfaces.

Programmers
• shell
• script
• SQL
• API
• automation

Everyone else
• form
• menu
• dashboard
• button
• wizard

Interface text:
9/28

### LLMs weaken an old boundary

Pai traces a file-renaming request from plain language to generated code running on an exposed system. He flags safe execution as the problem he will address next.

[8:37](https://www.youtube.com/watch?v=8txf05vVVl4&t=517s) [A file-renaming request leads to generated code and safe execution.](https://assets.ai.engineer/sites/aiecode2025/sha256/0ab55f3027e5b07d3cee4136820a6c134b481c04df467517bb5e69852038b9c2.webp)

LLMs weaken an old boundary

“rename these files by date and location”
↓
generated code
↓
executed safely

Interface text:
10/28

Event text:
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Kenton’s thread

Kenton Varda asked Opus 4.6 to play tic-tac-toe through a whiteboard’s client API. It computed stroke paths to draw circles, but lost the game.

[9:08](https://www.youtube.com/watch?v=8txf05vVVl4&t=548s) [A social media thread describes a model playing tic-tac-toe through a whiteboard application's API.](https://assets.ai.engineer/sites/aiecode2025/sha256/a9b74a3d4d9f2cd78f014758f3cf64ca1a7dc8fa6142a94ec74114d44689a4cd.webp)

Kenton’s thread

Kenton Varda @KentonVarda · Mar 5
Opus 4.6 is smart enough to play tic tac toe on this whiteboard with me entirely by making API calls to the app's client API, yet dumb enough to lose at tic tac toe.

[Embedded whiteboard screenshot: text illegible]

Kenton Varda @KentonVarda · Mar 5
Replying to @KentonVarda
This whiteboard app expresses everything in "strokes" which are series of points connected together. Claude draws perfect circles by writing some code that uses Math.sin() and Math.cos() to compute the stroke path.

Kenton Varda @KentonVarda · Mar 5
Replying to @KentonVarda
Everyone is saying that Codex 5.3 is smarter but... um...

Interface text:
57 · 117 · 3.4K · 164K
1 · 88 · 9.1K
11/28

### Inhabiting the state machine

The human uses a visible UI while the model works with shared state and capabilities, with a runtime in the middle. The speaker describes interaction without a separate app-generation stage.

[11:16](https://www.youtube.com/watch?v=8txf05vVVl4&t=676s) [A diagram places the human, model and runtime around a visible UI and shared state.](https://assets.ai.engineer/sites/aiecode2025/sha256/b5b8a9d800a84ece0421374820a9c9b1706d77d86d7dc7ce38324b389813f9fd.webp)

The model stopped generating the program
It started inhabiting the state machine

human ↕ visible UI
model ↕ shared state / capabilities
runtime
in the middle

Interface text:
← 15/28 →

### The sandbox contract

Pai proposes a sandbox that starts without filesystem or network access, receives only the capabilities each session needs, starts in milliseconds, and logs executions for audit and replay.

[12:30](https://www.youtube.com/watch?v=8txf05vVVl4&t=750s) [Four sandbox principles: start powerless, grant capabilities explicitly, start quickly and provide observability.](https://assets.ai.engineer/sites/aiecode2025/sha256/bff3a732d7851c84f976e6eafc465d60d48ac64f1d01759fbf66a25d704de287.webp)

The sandbox contract: capability, not containment

The alternative is approval fatigue — everyone just runs --dangerously-skip-permissions anyway. Start with nothing and grant what’s needed.

1. Start powerless
no filesystem, no network, no ambient authority

2. Grant capabilities explicitly
each session gets only what it needs

3. Fast startup
milliseconds, not seconds — one per user, one per turn

4. Full observability
every execution is logged, auditable, replayable

V8 isolates, Firecracker microVMs, Deno, WebAssembly — the implementation varies. The contract is the same.

Interface text:
17/28

### Your next billion users will never touch your UI

Pai distinguishes human customers from the code-generating agents interacting with their systems. Design for those agents through registries, types, and structured output.

[17:04](https://www.youtube.com/watch?v=8txf05vVVl4&t=1024s) [The slide associates agents with registries, types and structured output.](https://assets.ai.engineer/sites/aiecode2025/sha256/a85d591284c3440563952e48dc1eaa000eb91bfee46327144bc79e678399d0be.webp)

Your next billion users will
never touch your UI

Where do they hang out? Registries.
What do they dream? Types.
What’s their love language? Structured output.

Interface text:
23/28
AI Engineer EUROPE
PRESENTED BY
Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
PARTYKIT
CLOUDFLARE

### DX for agents

Design for agents with type signatures, structured errors, search and audit trails. Pai especially emphasizes capability-based security: grant explicit scope per session rather than relying on ambient auth.

[17:29](https://www.youtube.com/watch?v=8txf05vVVl4&t=1049s) [Five agent developer experience practices cover type signatures, structured errors, capability grants, search and audit trails.](https://assets.ai.engineer/sites/aiecode2025/sha256/4aa17825aa1cd7fb855180db8cab4a5ea70c9d5ab7b2f7a9f17db676a44b38ab.webp)

DX for agents

1. Type signatures as documentation
not prose, not examples

2. Structured errors
not human-readable paragraphs

3. Capability grants, not ambient auth
explicit scope per session

4. Discoverability via search
not a 200-page menu

5. Observability and audit trails
every execution is accountable

Interface text:
24/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### The runtime contract

Pai says agents can write in different languages if their runtime is event-driven, sandboxable, capability-scoped, embeddable and state-aware. JavaScript has these properties, which is why the team built on it.

[17:47](https://www.youtube.com/watch?v=8txf05vVVl4&t=1067s) [A slide states that the runtime contract is the same regardless of the language agents write.](https://assets.ai.engineer/sites/aiecode2025/sha256/beaa4946dfe55b6d8053df0163ec68b8f41e4fcd40cda8eadf1b2e252f67f664.webp)

Whatever language your agents write, the runtime contract is the same

Interface text:
25/28
AI Engineer Europe
Presented by Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
Cloudflare

[17:58](https://www.youtube.com/watch?v=8txf05vVVl4&t=1078s) [Runtime requirements include event-driven operation, sandboxing, scoped capabilities, embeddability, and state awareness.](https://assets.ai.engineer/sites/aiecode2025/sha256/aa17ce38fdfecff29836907d446e7118cd13c57d829cdca083b9881c57857a50.webp)

Whatever language your agents write, the runtime contract is the same

event-driven
sandboxable
capability-scoped
embeddable
state-aware

JavaScript happens to have all of these — event loops, embeddable runtimes, browser/server symmetry. It’s why we built on it.

But the pattern works in any language that meets the contract.

Interface text:
25/28

### Code and buttons

Sunil Pai contrasts programmers’ ability to interact with systems through code with the buttons and forms available to everyone else. He says that distinction is breaking.

[18:29](https://www.youtube.com/watch?v=8txf05vVVl4&t=1109s) [Programmers got code, everyone else got buttons, and that distinction is breaking.](https://assets.ai.engineer/sites/aiecode2025/sha256/b03677b34614c44f1c3e640d88f52083489046fc64a63e7861dd29f4d5d4987a.webp)

Programmers got code.
Everyone else got buttons.

That distinction is breaking.

Interface text:
26/28
AI Engineer Europe
Presented by Google DeepMind
KEYNOTE
SUNIL PAI / Founder, Principal Systems Engineer
CLOUDFLARE

### Let the code do the talking

Pai argues that code can interact with systems as the distinction between programmers and everyone else breaks down.

[18:55](https://www.youtube.com/watch?v=8txf05vVVl4&t=1135s) [Slide reads: Let the code do the talking.](https://assets.ai.engineer/sites/aiecode2025/sha256/0fd0f3866159a5f969a728897441ab7926e28f74212369a29e0e7a959fa7b29c.webp)

Let the code do the talking.

Interface text:
27/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
Braintrust
WorkOS
OpenAI

### Thank you

Sunil Pai closes with links to his GitHub profile and two posts.

[19:14](https://www.youtube.com/watch?v=8txf05vVVl4&t=1154s) [Thank-you slide naming speaker Sunil Pai.](https://assets.ai.engineer/sites/aiecode2025/sha256/c1f66d88ebff1eefbeaae518a19666ffb1b1c78525edf96db9a363c0c4a82994.webp)

Thank you.

Sunil Pai
@threepointone

github.com/threepointone
blog.cloudflare.com/code-mode
sunilpai.dev/posts/after-wimp

Interface text:
28/28
AI Engineer EUROPE
PRESENTED BY Google DeepMind
KEYNOTE
Braintrust  WorkOS  OpenAI

## Full transcript

[0:00](https://www.youtube.com/watch?v=8txf05vVVl4&t=0s) [upbeat music] Our next presenter created PartyKit, the open source tool for real-time multiplayer apps.

[0:22](https://www.youtube.com/watch?v=8txf05vVVl4&t=22s) For his day job, he builds AI agents at Cloudflare. Please join me in welcoming to the stage, Sunil Pai. [upbeat music]

[0:58](https://www.youtube.com/watch?v=8txf05vVVl4&t=58s) 20 minutes to the pub. [audience chuckles] Uh, hi, uh, my name is Sunil Pai. Uh, I work at Cloudflare. Uh, I build agents over there, uh, for the Agents SDK. I'm trying very hard for this not to be a Cloudflare talk, but I think we are on the sponsor board, so that's nice.

[1:16](https://www.youtube.com/watch?v=8txf05vVVl4&t=76s) Uh, this is a talk about something we call Code Mode. Uh, I've been wearing the hat, uh, and, uh, there's some prior art to it. We don't claim to have invented it, but this is a talk about the implications of something new that we're, we're discovering.

[1:31](https://www.youtube.com/watch?v=8txf05vVVl4&t=91s) So, um, you guys have built, uh, AI applications, and tool calling gets weird at scale. When it's just a couple of tools and very short runs, it's fine, but the moment you start stuffing in, uh, your Google services, your Jira, your Wiki, et cetera, and you have like hundred, hundreds of tools filling up the context, it starts

[1:51](https://www.youtube.com/watch?v=8txf05vVVl4&t=111s) breaking. Um, and uh, the composition is weird, and there's this back and forth that you have to do with, uh, the model that's really slow.

[2:03](https://www.youtube.com/watch?v=8txf05vVVl4&t=123s) Uh, we decided to take a different tack. Instead of doing this JSON back and forth thing, we asked the model to generate code, usually JavaScript, that we could run against an environment.

[2:18](https://www.youtube.com/watch?v=8txf05vVVl4&t=138s) Uh, and some of the benefits seem a little obvious to us. Uh, with code you get a typed API, you can do type checking, there are syntax errors. Uh, models are trained on gigabytes, if not terabytes of data already in the training set.

[2:34](https://www.youtube.com/watch?v=8txf05vVVl4&t=154s) Uh, and instead of doing this back and forth, you could write code that executes it all in one run, just one execution.

[2:43](https://www.youtube.com/watch?v=8txf05vVVl4&t=163s) So, uh, so this is what I mean, like there are f- uh, fundamental capabilities of code. You're able to do looping, you're able to hold state, uh, you're doing sequencing, paralleliz- parallelization, things that you would normally do with code anyway as an engineer.

[3:01](https://www.youtube.com/watch?v=8txf05vVVl4&t=181s) So the first place we applied this, uh, my colleague Matt Carry, who's actually going to be speaking about this a little more tomorrow, you should watch his talk. Uh, the Cloudflare API surface is about 2,600 API endpoints.

[3:14](https://www.youtube.com/watch?v=8txf05vVVl4&t=194s) If we exposed a tool for every single one of them, it's about 1.2 million tokens in your first call. Like it just blows. There's no way to create an MCP server for the entire Cloudflare API surface.

[3:27](https://www.youtube.com/watch?v=8txf05vVVl4&t=207s) And he had a very clever idea where he exposes just two tool calls, uh, search and execute. Both of these endpoints accept code as an input, literally a string of code.

[3:41](https://www.youtube.com/watch?v=8txf05vVVl4&t=221s) For search, the input to the function that you pass to it is the entire OpenAPI, uh, JSON spec. And once it does that execute gives, gives you a whole bunch of functions that you can call against the things that you called.

[3:55](https://www.youtube.com/watch?v=8txf05vVVl4&t=235s) And it reduced that 1.2, 1.5 million token thing down to 1,000 tokens. Kind of unheard of. I think it's like 99.9% reduction. Uh, this is gonna be scary. I actually ha- I have a live demo of this, and, um, demos don't usually do me well on stage.

[4:12](https://www.youtube.com/watch?v=8txf05vVVl4&t=252s) But, uh, but the point being that we were able to take a wide, super wide API surface and make it incredibly fast.

[4:21](https://www.youtube.com/watch?v=8txf05vVVl4&t=261s) Uh, the prompt itself can be, uh, fairly generic. So I should have kicked up the font size on this one. The prompt here is, as a customer you come in and say, "We are getting DDoS-ed.

[4:34](https://www.youtube.com/watch?v=8txf05vVVl4&t=274s) I want you to find every offending IP that's like attacking us and block them."

[4:41](https://www.youtube.com/watch?v=8txf05vVVl4&t=281s) In a moment of panic when your website is going down, you don't have the time to do menu diving. Uh, the Cloudflare dashboard is famously a little cumbersome to handle.

[4:53](https://www.youtube.com/watch?v=8txf05vVVl4&t=293s) Uh, and you just want the thing done, and you can't even get an A, it's like 3:00 in the morning.

[4:59](https://www.youtube.com/watch?v=8txf05vVVl4&t=299s) Uh, with a regular MCP thing, and this isn't even talking about stuffing 1.2 million tokens, it would be about eight round trips to do each of those API calls.

[5:09](https://www.youtube.com/watch?v=8txf05vVVl4&t=309s) Instead, the model can generate this string of code, run it immediately right next to the API surface and do it in one shot. And it's just running JavaScript. It's just functions and, um, just things that you're exposing on the API surface.

[5:29](https://www.youtube.com/watch?v=8txf05vVVl4&t=329s) Okay, live demo. This is a demo of our mythical server. Uh, I hope I'm logged in because if I'm not, I'll need all of you to close your eyes while I enter a password.

[5:39](https://www.youtube.com/watch?v=8txf05vVVl4&t=339s) Let's say I just want to like list my workers.

[5:46](https://www.youtube.com/watch?v=8txf05vVVl4&t=346s) Oh, there it is. List my workers. I say send.

[5:50](https://www.youtube.com/watch?v=8txf05vVVl4&t=350s) Oh, uh, okay, and there's no password required. [audience chuckles] Okay, fine. That's fine. Okay, I give it only read-only access for this demo.

[5:56](https://www.youtube.com/watch?v=8txf05vVVl4&t=356s) Uh, do the thing. Yes, allow. Sure, whatever.

[6:00](https://www.youtube.com/watch?v=8txf05vVVl4&t=360s) Ba, ba, ba, ba, ba. Nice. Okay, it comes back. And, uh, you'll see it'll start executing tool calls. I should be able to open this up. It has sent- Saying, "Hey, find me all API endpoints that just say the words list workers," or something like that.

[6:15](https://www.youtube.com/watch?v=8txf05vVVl4&t=375s) Uh, it then runs code, uh, which, hey, yeah, it's like one single request for the API endpoint to get all the workers. Uh, it must have received a whole bunch of these.

[6:27](https://www.youtube.com/watch?v=8txf05vVVl4&t=387s) It's actually going through JavaScript errors now. This is gonna be fun to see if it actually succeeds. [laughs]

[6:35](https://www.youtube.com/watch?v=8txf05vVVl4&t=395s) Yikes. Or is it trying to do it like per p- It's trying to paginate through the thing. Assume that this worked anyway, and I'll keep talking while it does this. [laughs]

[6:46](https://www.youtube.com/watch?v=8txf05vVVl4&t=406s) Uh, love that this is happening to me on stage because I did test it 10 times before coming on. Uh, I need to pay for the Mythos, uh, uh, model to make this work accurately. [laughs]

[6:58](https://www.youtube.com/watch?v=8txf05vVVl4&t=418s) Uh, by the way, you can actually see it is actually, like, listing workers over here. It might just be having trouble, uh, rendering it over here. Um, the point being, uh, we are able to shrink that down.

[7:08](https://www.youtube.com/watch?v=8txf05vVVl4&t=428s) Now, if this was a talk about optimizing MCP servers, I would be done and dusted. I was like, "Hey, you should throw this, and trust me, it works when you're not staring at it and have 800 people looking at you on the stage."

[7:20](https://www.youtube.com/watch?v=8txf05vVVl4&t=440s) But it did give us an idea that there's something deeper going on here. The ability to, like, run this code and, uh, feels like there's a new way of interacting with systems, with LLMs.

[7:35](https://www.youtube.com/watch?v=8txf05vVVl4&t=455s) Um, here's what I think. Like, everyone here is a programmer, and I give you a problem statement like, "You have 200 photos on your desktop. I need you to categorize and rename them."

[7:48](https://www.youtube.com/watch?v=8txf05vVVl4&t=468s) First thing you do is you lo- you're going to open up an IDE. You're going to write a little script. Maybe you're going to pass every image to a vision model now because you get a nice caption for it.

[7:56](https://www.youtube.com/watch?v=8txf05vVVl4&t=476s) Uh, rename it, and you're done and dusted. That is how you interact with systems. Uh, my mother's not going to do this. Her options are to, well, call me up or usually, like, buy an app, either a desktop, phone.

[8:09](https://www.youtube.com/watch?v=8txf05vVVl4&t=489s) And no one's made an app that does exactly just that. There's going to be, like, lowest common denominator apps for photo management, and it's $7 a month. And for some reason, you have to install a daemon which is stealing your crypto or some such stuff.

[8:24](https://www.youtube.com/watch?v=8txf05vVVl4&t=504s) Uh, and there's been this dichotomy, and it's fine. Like, until now, this has been an acceptable, uh, this has been an acceptable trade-off that non-technical people will have custom-made interfaces built for their needs and desires.

[8:39](https://www.youtube.com/watch?v=8txf05vVVl4&t=519s) LLMs are breaking this boundary. They... Every human being on the planet now has access to a buddy that can spit out code that can interact with systems. Uh, it takes, it takes a line like, "Rename these files by date and location," and generates code and can run it on your, uh, on whatever system you expose to it.

[9:03](https://www.youtube.com/watch?v=8txf05vVVl4&t=543s) Uh, I say executed safely here, and that's the bit that I do want to talk about in a minute. The other example I have, so this is Kenton. Kenton is the creator of Cloudflare Workers.

[9:12](https://www.youtube.com/watch?v=8txf05vVVl4&t=552s) Uh, famously, I'm... So he does the work, and I like taking credit for his work. This is our relationship in the company. Uh, so he, he had a thread a little while ago where he built, he's built a little vibe coding environment for himself because no one else does that in the world right now.

[9:27](https://www.youtube.com/watch?v=8txf05vVVl4&t=567s) So unique. Build your own little vibe coding thing. Uh, the, the thing he asked it to generate was a canvas, one of these tldraw, Excalidraw style canvases. Uh, and it did it.

[9:40](https://www.youtube.com/watch?v=8txf05vVVl4&t=580s) It did a little canvas with little brushes and colors. And the first thing Kenton did was draw a Tic-Tac-Toe board on it with a little X in the corner.

[9:48](https://www.youtube.com/watch?v=8txf05vVVl4&t=588s) This is the finished state, and I'll get to that in a second. He did that,

[9:52](https://www.youtube.com/watch?v=8txf05vVVl4&t=592s) and, uh, what he told the model then is, "I want you to play Tic-Tac-Toe with me." The model, as you can guess, it started generating a Tic-Tac-Toe app. Okay?

[10:05](https://www.youtube.com/watch?v=8txf05vVVl4&t=605s) Kenton stopped it immediately. He's like, "Nope. You have access to the entire state of the system." And the state of the system here is an array of strokes. You know, like, just a whole bunch of points, grid line, grid line, X stroke, et cetera.

[10:21](https://www.youtube.com/watch?v=8txf05vVVl4&t=621s) He said, "Inspect that and play it with me."

[10:26](https://www.youtube.com/watch?v=8txf05vVVl4&t=626s) Uh, immediately, the model started. It output the state into its own context, and it's like, "I recognize what this looks like. It looks like a Tic-Tac-Toe board, and I can see that you put an X in the top left.

[10:40](https://www.youtube.com/watch?v=8txf05vVVl4&t=640s) Let me draw a perfect circle in the middle of the app." To be clear, there is no Tic-Tac-Toe code anywhere in the system. The, the emergent behavior is that the model has, like, sure, I now know how to interact with the system with a set of strokes.

[10:57](https://www.youtube.com/watch?v=8txf05vVVl4&t=657s) Uh, also, it lost. Uh, by the way, it lost the game, and then when we saw the reasoning traces, we noticed that Opus let Kenton win. [laughs] Which is a whole other weird area of alignment we're not talking about.

[11:10](https://www.youtube.com/watch?v=8txf05vVVl4&t=670s) Anyway, so this actually generated a lot of conversation internally, and that's why, like, this talk is a little weird. It's a little woo-woo. I'm not even sure where we are going, and I want to, like, spread the idea to you and have you folks, like, uh, integrate it.

[11:21](https://www.youtube.com/watch?v=8txf05vVVl4&t=681s) So the, the phrase we have started using is it stopped generating a program, and it instead started inhabiting the state machine. Uh, there's a Ghost in the Shell reference here.

[11:31](https://www.youtube.com/watch?v=8txf05vVVl4&t=691s) For anyone who's over the age of [REDACTED:age], you need ibuprofen, uh, you should go back home. Uh, but no, like, it, it was a very strange thing to, for us not to have a separate app generation stage that you then, like, interact with.

[11:43](https://www.youtube.com/watch?v=8txf05vVVl4&t=703s) That is entirely the part of the thing. So what does this new software architecture look like? Uh, everyone's building what they call a harness. Uh, it's because over the last three to six months, everyone has realized that these coding agents are great general purpose computing machines.

[12:00](https://www.youtube.com/watch?v=8txf05vVVl4&t=720s) It's why they're running Claude Code. Claude Code? No, they're running Pi on a Mac mini, which is the wrong machine for this, by the way. You don't have to spend $400 for a thing that makes API calls.

[12:09](https://www.youtube.com/watch?v=8txf05vVVl4&t=729s) Uh, it's been driving me mad. If you check all the secondhand prices of Mac minis have, like, shot up. I got one before it, but I bought it because I'm special that way.

[12:17](https://www.youtube.com/watch?v=8txf05vVVl4&t=737s) Uh, you b- everyone's building this harness, and this architecture of the harness is not just that it can generate code, but it has a safe space to execute this code into which capabilities are, uh, exposed.

[12:31](https://www.youtube.com/watch?v=8txf05vVVl4&t=751s) Uh, and there are some attributes to this sandbox. We're calling it a sandbox, which is again, another completely overloaded term, and I have friends in the industry, everyone's building a different kind of sandbox.

[12:42](https://www.youtube.com/watch?v=8txf05vVVl4&t=762s) Uh, we have a Sandbox SDK which uses containers and VMs, but that's not even what I'm talking about right now. Um, there are some capabilities to it. Unlike a container, which comes with all sorts of features that you surround with security, you know, you do a bunch of things from the outside, you start with something that has

[12:59](https://www.youtube.com/watch?v=8txf05vVVl4&t=779s) no capabilities. The only thing it can do is execute code. It can't do fetches. There's no exposed APIs, no nothing. And then you grant capabilities to it explicitly. Uh, we have something called Dynamic Workers.

[13:12](https://www.youtube.com/watch?v=8txf05vVVl4&t=792s) I told you, um, it's not really a Cloudflare talk. Someone else build something better if you think it's better, it's fine. Uh, but this is what we use. We use V8 isolates because they start up really, really quickly, and, uh, it's about 10 years of security hardening.

[13:25](https://www.youtube.com/watch?v=8txf05vVVl4&t=805s) Uh, it's in our DNA. We ca- we care a lot about that. Anyway, so we-- you start exposing capabilities as APIs, A, and we also can control all outgoing fetches and any network connections.

[13:37](https://www.youtube.com/watch?v=8txf05vVVl4&t=817s) In fact, the default way we recommend you use this is no outgoing fetches, only APIs. It has to be fast, and you need absolute full observability into it. You need to know why last Tuesday it made a trade for $2.3 million for, I don't know, man, like llama poop or something, right?

[13:54](https://www.youtube.com/watch?v=8txf05vVVl4&t=834s) You need to go back to that code. You need absolute observability on these systems. It can be V8 isolates like we use. Uh, you could use, I don't know, a web as- WebAssembly, a custom JavaScript interpreter.

[14:07](https://www.youtube.com/watch?v=8txf05vVVl4&t=847s) Uh, that's not the main story here. You just want something that's able to execute, that you're able to expose capabilities to and run really quickly. From here, you can start getting really ambitious.

[14:17](https://www.youtube.com/watch?v=8txf05vVVl4&t=857s) The example that I showed you was a one-off, take some code, run it on an API, expand. Now, what if you could ex- uh, generate long-running workflows that run for days, months, years?

[14:30](https://www.youtube.com/watch?v=8txf05vVVl4&t=870s) Uh, what if each of those instances has some state that it can carry with it, uh, through, um, through its lifetime? What if, in this world of generative UI, you can start generating a perfect, perfectly custom UIs for every single user that you have?

[14:50](https://www.youtube.com/watch?v=8txf05vVVl4&t=890s) Everyone who does e-commerce knows this problem. The more popular you get, the more UI becomes this bland thing that has to work for every single user. And then you bring in the ML people and like, "Oh, what if we change the color button this way if it's somebody else?"

[15:04](https://www.youtube.com/watch?v=8txf05vVVl4&t=904s) No. You can go absolutely custom. So, um, I, I, I like the fact that I got Opus to generate generative UI for a slide where I'm making a point about generative UI, and it still looks a little bit like shit.

[15:18](https://www.youtube.com/watch?v=8txf05vVVl4&t=918s) Uh, but the idea is everyone-- Like ecom-- Uh, let me talk about that e-commerce. Like you have context about everything about the user, the things they like, the orders they have in their cart, the things that might be making them mad.

[15:29](https://www.youtube.com/watch?v=8txf05vVVl4&t=929s) You can surface these things as actions. The UI doesn't have to be a blank chat box, though honestly, blank chat box e-commerce might be a lot of fun. Uh, h-here I have two different use cases.

[15:40](https://www.youtube.com/watch?v=8txf05vVVl4&t=940s) In the first one, it's, uh, I need to return these shoes and find something similar under $100. If the product engineers have not implemented this, how are-- it's go- it's going to kind of suck and s- but you can generate something on the fly versus what is happening with my, uh, delayed order.

[15:58](https://www.youtube.com/watch?v=8txf05vVVl4&t=958s) Point being, we are now in a world where we can generate completely different programs backed by a system that you built on your back end for every single user.

[16:07](https://www.youtube.com/watch?v=8txf05vVVl4&t=967s) It's a new kind of software we're building. And this harness idea isn't just built into the product. A lot of people are finding power by running the harness closer to the user simply because then they get to start mashing up all their different services.

[16:22](https://www.youtube.com/watch?v=8txf05vVVl4&t=982s) This is an anti-Cloudflare talk at this point. I'm like, you should be running the software on your iPhone, like not so much on our servers. Please run it on our servers.

[16:30](https://www.youtube.com/watch?v=8txf05vVVl4&t=990s) Uh, but you-- But there you start getting to stitch together different systems in this safe environment, and you get to do it on a task-by-task basis.

[16:41](https://www.youtube.com/watch?v=8txf05vVVl4&t=1001s) Um, I put this in here because I'm a React programmer, and I don't want to freak out the React people by saying no one really wants to build UI anymore.

[16:48](https://www.youtube.com/watch?v=8txf05vVVl4&t=1008s) But really, it's a hearkening back to rethinking everything that we have thought about UI and for this new age. I keep thinking about it as part of the tech tree we have not really explored for thirty years because eval wasn't around, but now we have a safe eval, and we have these things that generate code for you.

[17:06](https://www.youtube.com/watch?v=8txf05vVVl4&t=1026s) But you do need to be in a place where you understand that your next billion users are these little robots that are generating code for you. To be clear, your customers are still humans, but things interacting with your systems, uh, if you really love your users, you need to find out where they hang out.

[17:23](https://www.youtube.com/watch?v=8txf05vVVl4&t=1043s) And they don't hang out in the pub. They hang out in registries. They dream in types and syntax errors, you know? Uh, you need to be thinking about what is the developer experience for these agents.

[17:35](https://www.youtube.com/watch?v=8txf05vVVl4&t=1055s) This is something a bunch of companies are already doing really well, by the way. You know? Docs which are Markdown, uh, errors that let the agent know what to do next, uh, discoverability via search.

[17:46](https://www.youtube.com/watch?v=8txf05vVVl4&t=1066s) Uh, the big one that I do want to talk, that I want you to

[17:50](https://www.youtube.com/watch?v=8txf05vVVl4&t=1070s) embed in your head, I guess, is this idea of capability-based security.

[17:55](https://www.youtube.com/watch?v=8txf05vVVl4&t=1075s) This isn't even a JavaScript talk. It can be in Python. It can be in WASM. Uh, I hope it brings a resurgence of Lisp. It's how I kind of learned how like ASTs work.

[18:05](https://www.youtube.com/watch?v=8txf05vVVl4&t=1085s) It kind of breaks your brain. Uh, but the, but the attributes are still very much the same, events, sandboxing, capability-based security, embeddable so that it's really fast to start up and run ephemerally.

[18:18](https://www.youtube.com/watch?v=8txf05vVVl4&t=1098s) Uh, React programmers simply be-- Well, UI programmers, simply because they have so much, uh, they've been so close to users, I suspect that they'll do particularly well here, and that feels really good to me, by the way.

[18:29](https://www.youtube.com/watch?v=8txf05vVVl4&t=1109s) I feel happy about it. So to end,

[18:33](https://www.youtube.com/watch?v=8txf05vVVl4&t=1113s) for the longest time, programmers like us, we got code. We had infinite power to interact with any system that we could and complain about it on Twitter because our documentation doesn't have the right CSS or something.

[18:48](https://www.youtube.com/watch?v=8txf05vVVl4&t=1128s) JavaScript programmers, super entitled, by the way. Uh, everyone else got buttons and forms. That distinction is breaking. In a world like this, you need to let the code do the talking.

[18:58](https://www.youtube.com/watch?v=8txf05vVVl4&t=1138s) The code is the thing that interacts with all your systems. Uh, come talk to me about it at the pub. Like, this is like, it feels like it's opening up a whole new area of research for us, uh, and we have a lot of ideas, and I get to finish my talk and the day with six seconds

[19:13](https://www.youtube.com/watch?v=8txf05vVVl4&t=1153s) left. How good is that? [audience laughing] Thank you very much. Appreciate it. [audience applauding] [upbeat music]
