Gadgets: Personal app vibe coding that is actually safe — Kenton Varda, Cloudflare
Kenton Varda introduces "Gadgets," a new architecture built on Cloudflare Workers, addressing the challenge of user-driven AI customization in a world where traditional cloud infrastructure restricts personalization. He demonstrates how AI agents can add features directly to applications, while a unique security model, leveraging `null origin iframes` and isolated server-side sandboxes, renders XSS vulnerabilities irrelevant. The entire system operates without containers or traditional databases, running efficiently on the `workerd` runtime.
Kenton Varda opens by asserting that “personal AI codegen breaks traditional cloud infrastructure,” emphasizing that current software infrastructure is fundamentally incompatible with a future where users can personalize and extend their applications using AI agents. He illustrates the present software development paradigm as a developer-centric model where feature requests often vanish into “Jira where they are never seen again.” This process leads to code bloat and developer frustration, frequently culminating in ill-fated “plugin system rewrites” that delay innovation and leave users and developers dissatisfied.
Varda’s vision is an alternative where users, empowered by their AI agents, can “write that feature just for them, add it to the app.” This allows for deep personalization without burdening developers or cluttering the core application. However, he notes significant infrastructure barriers: mobile platforms like Apple and Google severely restrict unsigned code, making it difficult for users to modify their devices – Varda notes, “It’s almost easier to buy a gun in the United States than it is to get access to your own phone to install unsigned software.” Furthermore, current cloud architecture, with its centralized “one blessed version” of an application, prevents user customization, rendering many contemporary “vibe coding” efforts misdirected.
To address this, Kenton Varda, the creator and lead engineer of Cloudflare Workers, introduces Gadgets – a novel architecture built on Cloudflare Workers. He likens Gadgets to an “office suite” rather than a general web app deployment target, similar to Google Docs where each “document” (or gadget) is a distinct application instance. Key tenets of Gadgets include:
- One Gadget Per Document: Each gadget represents a single unit, such as a slide deck, a collaborative whiteboard, or an email filter. Multiple instances are created for multiple distinct items.
- Platform-Managed Sharing: Sharing and access control are handled by the platform itself, not the application code, ensuring security and correctness. The platform guarantees that “the gadget itself can’t possibly get that wrong.”
- Blueprints: Developers can create shareable “blueprints” (code without data) from which other users can instantiate their own gadgets.
Varda demonstrates Gadgets by having Claude generate a presentation. Crucially, he instructed Claude: “if you need to add any new features to the slides app itself to support some of these slides, feel free to do so.” Claude intelligently extended the slide application’s capabilities by:
- Adding a strikethrough formatting option.
- Implementing text centering.
- For a complex diagram, Claude added a feature to accept raw SVG, and then generated the SVG content itself, integrating it into the slide.
A cornerstone of the Gadgets architecture is its robust security model, designed to render XSS vulnerabilities largely benign: The UI runs in a highly restricted null origin iframe sandbox with a strict Content Security Policy, preventing it from accessing cookies or communicating with external resources. Communication with the server code occurs solely via postMessage to the parent frame, then through a Cap’n Web RPC session. The server-side code for each gadget also operates within a highly isolated dynamic worker sandbox. This comprehensive sandboxing ensures that “if you have an XSS bug, it actually doesn’t end up mattering because these can’t leak anything,” effectively making security bugs in vibecoded client or server code inconsequential.
Technologically, Gadgets is built entirely on Cloudflare Workers, utilizing dynamic workers for execution and Durable Objects for state management, eliminating the need for traditional containers or databases. The demo itself ran locally on Varda’s laptop using workerd, Cloudflare’s open-source Workers runtime, highlighting its self-hosting potential for applications like home automation.
While Varda initially planned to open-source Gadgets immediately, Cloudflare has elevated it to a “more serious project,” necessitating a “more careful and disciplined and intentional” release strategy. Although not yet open-source, it is slated for release “soon.”