Kenton Varda

Kenton Varda

@kentonvarda.com

Tech lead for workers.cloudflare.com Also made: capnproto.org, lanparty.house, sandstorm.io @KentonVarda on Twitter.

2.2K followers132 following220 posts

My partner Jade turned her old work into a music video and it's so good...

Jade Wang@jadewang.me

I made a techno remix out of a song I recorded with an acoustic guitar in 2011, and asked Opus 5.5 for a music video with a JavaScript-forward art style. (It’s DDR optimized. Anyone else here plays DDR and is interested in steps?) 🧵

I know AI is unpopular here compared to the other site. But can we agree this is the best possible use of AI media generation? An individual bringing their own original work to life, just for the sake of being awesome? I, for one, want to see more of this!

My wife @jadewang.me wrote a collection of poetry that is designed to be read by AI. To be clear, it is NOT written by AI. Jade wrote everything herself. But it contains puzzles that very few humans have enough context to figure out, but most frontier models do.

Jade Wang@jadewang.me

spacesleftblank.com: autobiographical poetry (immigration raid -> neuroscience -> NASA -> startups) human written (by me) intended to be experienced inside a conversation with an AI that also asks questions about consciousness

Per the instructions on the site, you can upload the PDF to an AI and ask for "adaptive footnotes" to see what it sees. Pretty interesting, and as far as we know no one has done this before.

Big launch today: Dynamic Workers are now in Open Beta, all paid Workers users have access. Secure sandboxes that start ~100x faster than a container and use 1/10 the memory, so you can start one up on-demand to handle one AI chat message and then throw it away. blog.cloudflare.com/dynamic-work...

blog.cloudflare.comSandboxing AI agents, 100x fasterWe’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond sta...
View full thread

This is all made possible by the isolation model that Cloudflare Workers has been built on since the beginning: isolates, not containers. It's kinda crazy how the thing we've been doing differently and perfecting for 9 years is suddenly so relevant to AI.

Big launch today: Dynamic Workers are now in Open Beta, all paid Workers users have access. Secure sandboxes that start ~100x faster than a container and use 1/10 the memory, so you can start one up on-demand to handle one AI chat message and then throw it away. blog.cloudflare.com/dynamic-work...

blog.cloudflare.comSandboxing AI agents, 100x fasterWe’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond sta...
View full thread

That said, if you are working with existing HTTP-based client libraries (which you want to inject into the sandbox), then perhaps HTTP filtering is easier to get started with.

Big launch today: Dynamic Workers are now in Open Beta, all paid Workers users have access. Secure sandboxes that start ~100x faster than a container and use 1/10 the memory, so you can start one up on-demand to handle one AI chat message and then throw it away. blog.cloudflare.com/dynamic-work...

blog.cloudflare.comSandboxing AI agents, 100x fasterWe’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond sta...
View full thread

You can define the RPC interface to support exactly the operations you want to support, so it's totally obvious what the agent can and can't do. Then you just tell the agent the TypeScript type definition of the interface and let it code.

Big launch today: Dynamic Workers are now in Open Beta, all paid Workers users have access. Secure sandboxes that start ~100x faster than a container and use 1/10 the memory, so you can start one up on-demand to handle one AI chat message and then throw it away. blog.cloudflare.com/dynamic-work...

blog.cloudflare.comSandboxing AI agents, 100x fasterWe’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond sta...
View full thread

But that's only half of it. Lots of people today are talking about keeping API keys out of your agent sandbox by injecting them into requests on the way out. You can do that with Dynamic Workers, but you can also do *much better*.

Dynamic Workers let you block internet access entirely, and then constructively grant the sandbox access to specific TypeScript interfaces, via Cap'n Web RPC. Essentially you can invent your own "Workers bindings" to give it, pointing at whatever you want. A chat room. A git repo. Etc.

Big launch today: Dynamic Workers are now in Open Beta, all paid Workers users have access. Secure sandboxes that start ~100x faster than a container and use 1/10 the memory, so you can start one up on-demand to handle one AI chat message and then throw it away. blog.cloudflare.com/dynamic-work...

blog.cloudflare.comSandboxing AI agents, 100x fasterWe’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond sta...

Agents should interact with the world by writing code, not tool calls. Just like you might write a little bash script to do a task. But starting a container for every end user is impractical. Dynamic Workers solve this -- now millions of end users can each have their own agent, writing code.

View full thread

Kenton Varda reposted

I came to Minneapolis to report on what's going on, and one of the main questions I showed up with is "just what is the scale of the resistance?" After all, we're all used to the news calling Portland a "war zone" or whatever when it's just some protests in one part of town.

Whelp. I'm locked out of X because it insists I re-enroll my security key (which I haven't used in years, I always use the authenticator app), and when I try to do that, it just loops back and prompts me to do it again. Great.

Kenton Varda reposted

View full thread

This works better than direct tool calls becaues LLMs actually have WAY more training data for writing code than for calling tools. After all, tool-calling is a sort of artificial thing just for LLMs. Code is everywhere.

View full thread
View full thread

Just a gift to the internet. Use it as you please. I've been using it in a React app I've been vibe-coding and been pleased with the results. The AI doesn't have to understand it since it just looks like a regular JavaScript API was magically transported over the network.

View full thread

Cap'n Web integrates nicely with Cloudflare Workers' built-in RPC, so you can take a Workers-native stub (including Durable Object stubs) and just pass it over Cap'n Web to a client. Proxying is arranged automatically. (But again, you can use it with any runtime.)

View full thread

You also get Promise Pipelining, which means that if you need to make a chain of calls, where one call's inputs incorporate the previous call's results, you can do that in one network round trip. In fact, Cap'n Web features two major advances over Cap'n Proto in this regard.

1. In Cap'n Proto, you could only pipeline on stubs. In Cap'n Web, if you have a promise for, say, a number, you can put that promise into a subsequent call where a number is needed. The resolution is automatically substituted in before the dependent call is delivered.

View full thread

Cap'n Web does NOT use zero-copy binary serialization like Cap'n Proto. It's just JSON underneath. This may surprise people, but the serialization was never my favorite part of Cap'n Proto. The RPC system has always been the main point.

What's so great about the RPC? Well, it supports object capabilities (pass-by-reference). You can pass a function over RPC; the remote end gets a stub, which, when called, calls back over RPC to the original function. You can pass objects with methods in the same way.

View full thread

Here's the GitHub. It's pure JavaScript/TypeScript. It's MIT-licensed. It works in every modern JavaScript environment (not just Cloudflare Workers). The whole library has zero dependencies and compresses (minify+gzip) to under 10KiB of JavaScript. github.com/cloudflare/c...

github.comGitHub - cloudflare/capnweb: JavaScript/TypeScript-native, low-boilerplate, object-capability RPC systemJavaScript/TypeScript-native, low-boilerplate, object-capability RPC system - cloudflare/capnweb

Cap'n Web works over plain HTTP (for one-off batch requests), WebSocket (for persistent connections), and even MessagePort (for iframe<->parent communications). Or define your own transport; any bidirectional message stream should work.

Unlike Cap'n Proto, Cap'n Web does not use schemas. In fact, it requires almost no boilerplate whatsoever. You export a JS API, you call it from the client. Just like Workers RPC, but in the browser, and with a few new twists.