dynamic-workers

2 posts

cloudflare

Durable Objects in Dynamic Workers: Give each AI-generated app its own database (opens in new tab)

Dynamic Workers make it possible to run AI-generated code securely in lightweight isolates, but disposable execution is not enough for persistent applications. Cloudflare’s Durable Object Facets address this by letting a supervised Durable Object dynamically load an AI-generated Durable Object class with its own SQLite-backed storage. This combines sandboxed, persistent application state with centralized control over provisioning, access, logging, metrics, and billing. ## From Disposable Code to Persistent Apps - Dynamic Workers load code on demand in secure isolates rather than containers. - Isolates start quickly and use little memory, making them suitable for short-lived AI-generated tasks. - Persistent AI-built applications need: - Custom user interfaces - Long-lived state - Secure execution - A remote SQL database could provide storage, but it introduces network latency and additional infrastructure. ## Why Durable Objects Fit - Each Durable Object has: - A globally unique name - One active instance per name - An attached SQLite database stored locally - Local SQLite storage provides extremely low-latency access. - AI-generated applications can therefore use normal Durable Object storage APIs, including key-value and SQL storage. ## Limitations of the Traditional Model - Standard Durable Objects require: - A class extending `DurableObject` - Exporting the class from the Worker - Wrangler configuration to provision storage - A namespace binding for access - This model does not naturally support code loaded dynamically at runtime. - Giving an agent direct control of Durable Object namespaces could also allow uncontrolled object creation and storage use. - A platform needs an intermediary to enforce limits and provide observability, billing, and other operational controls. ## Durable Object Facets - Facets allow a normal, statically configured Durable Object to dynamically instantiate another Durable Object class. - The outer object acts as a supervisor: - Loads the agent’s code as a Dynamic Worker - Selects the exported Durable Object class - Forwards requests or RPC calls - Controls and monitors the application - The dynamically loaded class can directly extend `DurableObject`. - Each facet receives its own SQLite database, separate from the supervisor’s database. - Multiple facets can exist within one Durable Object, each identified by a name and subject to storage limits. ## Example Architecture - An `AppRunner` Durable Object receives incoming requests. - It obtains a facet named `"app"` through `this.ctx.facets.get(...)`. - When the facet starts, the runner: - Loads the Dynamic Worker - Retrieves its exported application class - Instantiates it as the facet - Requests are then forwarded to the dynamically loaded application. - The sample application maintains a request counter using Durable Object storage. Durable Object Facets provide a practical foundation for AI-generated applications that need persistent state without sacrificing isolation or platform governance. They are especially suited to personal or small “vibe-coded” apps, where each application can receive its own storage while the host platform retains control over resource usage and operational policies.

cloudflare

Introducing EmDash — the spiritual successor to WordPress that solves plugin security (opens in new tab)

EmDash is presented as a modern, TypeScript-based successor to WordPress, designed for today’s serverless hosting environment. Its central innovation is isolating plugins in sandboxed Dynamic Workers and granting them only explicitly declared capabilities. The project aims to preserve WordPress’s open-source publishing model while addressing plugin security, marketplace dependence, and licensing concerns. ## Modernizing WordPress for Today’s Web - WordPress powers more than 40% of the Internet but was designed when hosting commonly meant managing virtual private servers. - EmDash is: - Written entirely in TypeScript - Built on Astro - Serverless, while still deployable on personal hardware or Node.js servers - Fully open source and MIT licensed - Intended to remain compatible with WordPress-style functionality without using WordPress code - Version 0.1.0 is available as an early developer beta for Cloudflare or Node.js deployment, along with an online playground. ## Building on WordPress’s Publishing Legacy - WordPress democratized publishing and created a large ecosystem of core contributors, plugin developers, and theme developers. - The authors argue that WordPress will continue to have a role, but newer developers increasingly use Astro and TypeScript frameworks. - EmDash seeks to provide a similarly accessible, inexpensive, and open publishing platform suited to modern development practices. ## Sandboxed Plugins and Explicit Permissions - WordPress plugins are PHP scripts with direct access to the site’s database and filesystem. - This lack of isolation is identified as the source of most WordPress security problems: - 96% of WordPress site security issues reportedly originate in plugins. - High-severity vulnerabilities increased substantially in 2025. - EmDash runs each plugin inside an isolated Dynamic Worker. - Plugins access platform functionality through capability-based bindings rather than direct access to underlying resources. - A plugin must declare its required permissions in its manifest, allowing administrators to evaluate permissions before installation. - The example notification plugin: - Reacts to content-save events - Checks whether a post has been published - Sends an email to editors - Logs the notification - Plugins have no general external network access. If network access is necessary, the plugin can request permission for specific hostnames. - Administrators or platforms could enforce installation policies based on requested permissions instead of relying solely on approved-plugin allowlists. ## Security, Marketplaces, and Licensing - WordPress.org manually reviews plugins because the platform cannot otherwise guarantee their safety. - The review queue reportedly exceeds 800 plugins and can take at least two weeks. - Marketplace reputation, ratings, and reviews therefore become essential substitutes for technical trust. - Because WordPress plugins run inside WordPress and are tightly coupled to its code, developers may also face GPL licensing constraints. - The article argues that plugin security creates marketplace lock-in: - Customers rely on marketplaces to assess plugin trustworthiness. - Developers may need to distribute code under restrictive licensing terms to participate. - Hosting platforms inherit the risk of running third-party plugins. - EmDash’s sandboxing and permission model is positioned as a way to reduce reliance on centralized marketplace approval, though the provided article excerpt ends before explaining the promised “two important properties” in full. EmDash’s practical recommendation is to use capability-limited, isolated plugins as the foundation for a more secure and flexible WordPress-like ecosystem. Its early beta is intended for developers who want to evaluate that model on Cloudflare or Node.js.