The browser is the sandbox
Recorded: Jan. 26, 2026, 3 p.m.
| Original | Summarized |
the browser is the sandbox Simon Willison’s Weblog the browser is the sandbox. Paul Kinlan is a web platform developer advocate at Google and recently turned his attention to coding agents. He quickly identified the importance of a robust sandbox for agents to operate in and put together these detailed notes on how the web browser can help: This got me thinking about the browser. Over the last 30 years, we have built a sandbox specifically designed to run incredibly hostile, untrusted code from anywhere on the web, the instant a user taps a URL. [...] Paul then describes how the three key aspects of a sandbox - filesystem, network access and safe code execution - can be handled by browser technologies: the File System Access API (still Chrome-only as far as I can tell), CSP headers with <iframe sandbox> and WebAssembly in Web Workers. You select a folder full of files and configure an LLM provider and set an API key, Co-do then uses CSP-approved API calls to interact with that provider and provides a chat interface with tools for interacting with those files. It does indeed feel similar to Claude Cowork but without running a multi-GB local container to provide the sandbox. Posted 25th January 2026 at 11:51 pm Recent articles Wilson Lin on FastRender: a browser built by thousands of parallel agents - 23rd January 2026
browsers javascript sandboxing ai generative-ai llms ai-agents coding-agents claude-code Monthly briefing Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments. Pay me to send you less! Sponsor & subscribe Colophon |
This article details an exploration by Simon Willison into the potential of web browsers as robust sandboxes for running untrusted code, specifically within the context of developing software agents like Claude Cowork. The central thesis revolves around leveraging existing browser technologies – namely the File System Access API, Content Security Policy (CSP) with `<iframe sandbox>` attributes, and WebAssembly in Web Workers – to provide a secure environment for external software to interact with a user’s computer. The analysis underscores the browser’s established history of handling hostile code from across the internet, essentially presenting a pre-existing, highly effective sandbox. The core of Willison’s investigation revolves around a demonstration application called Co-do. This application allows users to select a folder containing files and then configure an LLM (Large Language Model) provider, complete with an API key. Co-do then utilizes CSP-approved API calls to communicate with the chosen LLM provider, offering a chat interface alongside tools for interacting directly with the selected files within the folder. This setup strikingly mirrors the functionality of Claude Cowork, but crucially, it achieves this without requiring the substantial computational resources typically associated with running a multi-gigabyte local container. A significant element of this research is the examination of browser features and their application within the sandbox environment. Willison highlights the complexities of utilizing CSP, particularly the double-iframe technique, which he describes as a method to apply network rules effectively to the inner frame of a two-frame setup. This demonstrates a sophisticated understanding of browser security mechanisms and their adaptability to complex scenarios. Furthermore, the post introduces the `<input type="file" webkitdirectory>` tag, emphasizing its operational functionality across Firefox, Safari, and Chrome. This tag enables a browser-level, read-only access to an entire directory of files, representing a practical and easily implementable addition to the sandbox architecture. Willison’s use of this feature, facilitated through a demo built by Claude, indicates an intention to integrate it into future projects. The article positions the browser as a surprisingly adaptable platform for developing and deploying sophisticated AI agents. The post’s emphasis on the browser’s pre-existing capacity for handling and controlling untrusted code suggests that it represents a viable, and potentially superior, alternative to traditional containerized approaches for running such applications. The document clearly advocates for a deeper investigation into the capabilities of the browser as a secure and efficient operating environment for AI agents, highlighting the importance of technologies like CSP and File System Access API. The exploration underscores the relevance of browser technologies in the evolving landscape of generative AI and software agent development, specifically its ability to act as a fortified environment for external code execution. |