CSP Allow-list Experiment

Simon Willison's Blog Tools

Summary

A web tool experiment demonstrating how to handle Content Security Policy errors in sandboxed iframes by intercepting fetch requests and prompting users to whitelist domains. The tool was built using GPT-5.5 via the Codex desktop app.

No content available
Original Article
View Cached Full Text

Cached at: 05/13/26, 08:10 AM

# Tool: CSP Allow-list Experiment Source: [https://simonwillison.net/2026/May/13/csp-allow/](https://simonwillison.net/2026/May/13/csp-allow/) 13th May 2026 Tool[CSP Allow\-list Experiment](https://tools.simonwillison.net/csp-allow) An experiment that shows that you can load an app in a CSP\-protected sandboxed iframe \(see[previous note](https://simonwillison.net/2026/Apr/3/test-csp-iframe-escape/)\) and have a custom`fetch\(\)`that intercepts CSP errors and passes them up to the parent window\.\.\. which can then prompt the user to add that domain to an allow\-list and then refresh the page\. ![Screenshot of a web tool titled "CSP Allow-list Experiment" with buttons Reset sample, Clear allow-list, Refresh preview. Left panel shows HTML source code starting with <!doctype html>. Right panel shows Preview with CSP header default-src 'none'; script-src 'unsafe-inline'; style-s... and heading "Sandbox fetch test". A modal dialog from tools.simonwillison.net is overlaid reading: "The sandbox tried to connect to: https://api.inaturalist.org Add this origin to the CSP connect-src allow-list and refresh the page?" with an unchecked checkbox "Don't allow tools.simonwillison.net to prompt you again" and Cancel and OK buttons. Below is "Messages from sandbox" showing fetch-catch blocked https://api.inaturalist.org/v1/observations?per... connect-src · https://api.inaturalist.org. At the bottom left is "Allowed fetch() origins" with an input field containing https://api.github.com, an Add button, and a tag https://api.github.com x.](https://static.simonwillison.net/static/2026/csp-allow.jpg) I built this one with GPT\-5\.5 xhigh running in the Codex desktop app\. Posted[13th May 2026](https://simonwillison.net/2026/May/13/)at 4:50 am

Similar Articles

External sandboxes for coding agents

Simon Willison's Blog

Simon Willison and Prime Radiant introduce the 'external sandbox' pattern for safely executing code from coding agents, releasing three sandbox server implementations (v86, container, and Quicksand-based) with a shared localhost API and network allow-list proxy for tools like Pi, Claude Code, and Codex.

webframe: evaluated as a scraper and a sandbox

Simon Willison's Blog

Simon Willison publishes a research report evaluating webframe, Jeff Lindsay's lightweight Go tool for running web pages like programs in a headless system web view, finding it fast and comparable to shot-scraper but with rough edges like CSP failures and missing HTTP metadata.

Building a UMatrix Replacement

Hacker News Top

This article explores options for replacing the deprecated uMatrix browser extension under Chrome's Manifest V3, proposing a solution using declarativeNetRequest and Content Security Policy to control site permissions and subresource requests.

Universal XSS in uBlock Origin from website-driven element picker

Lobsters Hottest

A researcher disclosed a one-click universal XSS vulnerability in uBlock Origin's element picker that let malicious websites inject trusted filters and run arbitrary JavaScript on any site; the issue is now fixed and was largely discovered with the help of GPT-5.6 Sol.