Browse · People
Person · Latent Space wiki

Sunil Pai

Cloudflare engineer and PartyKit founder working on durable AI agents, sandboxed code execution, and software that lets people and agents act on the same work.

Sunil Pai, known online as threepointone, works on agents and long-running AI systems at Cloudflare. His work includes Code Mode, which lets models compose tool calls through generated code, and Project Think, a serverless harness for agents with persistent state and recoverable execution. He also builds applications to explore how agents can work alongside people: his music app Pizzo gives a human and an agent access to the same song and editing operations.[3][4][6][7][8]

On August 14, 2026, Pai announced that he had moved into a builder in residence role, involving building in public, collaborating outside the company, and bringing lessons back. Cloudflare’s author profile identifies him as Principal Systems Engineer. In explaining the new role, he emphasized testing ideas with artists, teachers, musicians, parents, and small businesses—people whose work does not revolve around terminals or AI agents.[9][5]

Code as the interface to tools

Pai and Kenton Varda introduced Code Mode in September 2025. It converts Model Context Protocol (MCP) tools into a documented TypeScript API and asks the model to write a program using it. That program can compose calls and process intermediate results without sending every result back through the model. The authors reported that this approach handled larger and more complex tool surfaces better than exposing the tools directly; they suggested that models’ extensive exposure to real-world code helped explain the difference.[6]

The design also separates generated code from credentials and general network access. Code runs in a sandboxed Worker whose global fetch() and connect() functions are blocked. Bindings provide access to the connected MCP servers, while an agent supervisor holds access tokens and attaches them to outgoing requests. The sandbox therefore receives specific authorized interfaces rather than unrestricted Internet access or raw credentials.[6]

Agents that survive the session

In April 2026, Pai and Kate Reznykova introduced Project Think as a preview of new Agents SDK primitives and an opinionated base class combining them. Its foundation is the actor model: each agent is an addressable Durable Object with its own SQLite database. It can retain state, hibernate without consuming compute, and wake for a request, message, alarm, or email. This supports an agent that remains available between interactions without requiring an always-running process for each user.[7]

Think’s durable execution uses fibers: function invocations registered in SQLite before execution, with checkpoints that recovery code can use after a restart. Persistent sessions store conversations as trees, allowing forks and summaries while retaining the full history. Isolated sub-agents and sandboxed code execution extend that foundation. The announcement explicitly described the features as preview APIs that could change.[7]

A shared document, with direct controls

Pai’s July 2026 essay “one document, two hands” describes Pizzo, a music app he demonstrated at Local-First Conf. Users can manipulate tempo, chords, and instruments directly or ask an agent for changes such as a walking bass line or transposition. The song remains ordinary application state, read by the interface and audio engine and modified by both controls and agent tools. As Pai puts it, “the chat should not own the song. the song should own the song.”[8]

The model maps an intention to an operation and its arguments; ordinary code performs the precise transformation. A button and an agent can both call transpose(2), using the same implementation. Pai argues that this keeps changes testable and makes validation, permissions, history, and undo possible. The demonstrated version associates each song with a Durable Object and synchronizes changes across connected surfaces. He explicitly distinguishes that server-backed arrangement from strict local-first software, which would also need a durable local replica, offline editing, and later reconciliation.[8]

Autonomy should serve the user’s job

In “the task isn’t the job”, Pai describes coding agents as compressing implementation work without proportionately improving his judgment about what deserves building: “I can now build three wrong things before lunch.” His concern is that faster execution brings difficult product decisions forward rather than resolving them—understanding users, choosing among defensible directions, and deciding when individually reasonable features make a product worse together.[9]

Pai qualifies his shared-document proposal with a distinction between participation and delegation. Someone who needs background music may welcome a finished track; someone who wants to make music may value experimenting with the chords. Administrative chores may call for the agent to handle the whole task. His formulation is “autonomy is a capability, not a product direction!” He wants AI to lower the prerequisites for using programming’s leverage, while recognizing that access to intelligence alone does not remove constraints such as time, money, education, or confidence.[9]

Pai’s agent work follows earlier experience with stateful applications and developer tools. Before founding PartyKit, he worked on the React core team, led developer tooling for Cloudflare Workers, and built social VR at Oculus. PartyKit’s use of Durable Objects provides earlier technical context for the stateful infrastructure used in his later agent work.[4][10][7]

Earlier foundations: Wrangler and PartyKit

In a March 2023 Reactiflux discussion, Pai recalled the Wrangler rewrite during 2021–2022. The team replaced the Rust CLI and webpack bundler with TypeScript and esbuild to make iteration easier. Pai set up npm beta publishing for every commit and invited developers to try changes through npx. He credited a teammate with extending previews to pull-request artifacts. Frequent demonstrations and easy-to-share builds embodied his principle that “rewrites are possible if you have a zero cost feedback loop.”[11]

Pai also recalled that Kenton Varda initially considered the rewrite a bad idea. Rather than relying on a promise of cleaner code, Pai demonstrated an alternative Wrangler experience and secured room to try it. He treats that process as both an accountability check and a way to earn support for inevitable mistakes. His broader caution is against claiming that a replacement is better in every way without explaining its trade-offs or the edge cases the existing system already handles.[11]

Pai founded PartyKit, which began in 2022 as a project to make Durable Objects accessible through familiar components. Integrations with React and Yjs helped developers build synchronized applications such as collaborative drawing tools and multiplayer games. Cloudflare announced its acquisition of PartyKit on April 5, 2024, in a post coauthored by Pai and Rita Kozlov. That work concerned real-time, stateful applications; his subsequent AI work applies Durable Objects to persistent agents and shared application state.[4][10][7][8]

Timeline

  1. project

    Rewrites Wrangler with TypeScript and esbuild
    In a March 2023 Reactiflux discussion, Pai recalled the Wrangler rewrite during 2021–2022. The team replaced the Rust CLI and webpack bundler with TypeScript and esbuild to make iteration easier.[11]

  2. founding

    Founds PartyKit to make Durable Objects more accessible
    Pai founded PartyKit, which began in 2022 as a project to make Durable Objects accessible through familiar components.[4][10]

  3. milestone

    Cloudflare announces its acquisition of PartyKit
    Cloudflare announced its acquisition of PartyKit on April 5, 2024, in a post coauthored by Pai and Rita Kozlov.[10]

  4. release

    Introduces Code Mode with Kenton Varda
    Pai and Kenton Varda introduced Code Mode in September 2025.[6]

  5. release

    Introduces Project Think preview with Kate Reznykova
    In April 2026, Pai and Kate Reznykova introduced Project Think as a preview of new Agents SDK primitives and an opinionated base class combining them.[7]

  6. project

    Explains Pizzo’s shared music editing for people and agents
    Pai’s July 2026 essay “one document, two hands” describes Pizzo, a music app he demonstrated at Local-First Conf.[8]

  7. role

    Announces move into builder in residence role
    On August 14, 2026, Pai announced that he had moved into a builder in residence role, involving building in public, collaborating outside the company, and bringing lessons back.[9]

Sources

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
    Sunil Pai - Cloudflare BlogAccessed 2026-09-20
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
    Sunil Pai and Mark EriksonAccessed 2026-09-20

Model source and teaching reviews passed. Human editorial review pending. This profile describes the sources as of 2026-09-20.

Latent Space

Join Latent Space.

Sign in with Google, or get the newsletter by email.

Loading Google sign-in…

or subscribe by email

Free. Unsubscribe any time.