CSP Allow-list experiment: a new way to fix iframe errors
TL;DR
CSP Allow-list Experiment loads apps in CSP-protected sandboxed iframes. Custom fetch intercepts CSP errors, notifies parent window to prompt domain allow-listing and page refresh.
What changed
Simon Willison published an experiment for CSP allow-lists in sandboxed iframes. A custom fetch intercepts CSP errors and relays them to the parent window. The parent prompts users to approve domains and refreshes the page.
Why it matters
Developers embedding apps face blocks from strict CSP like default-src 'none' in Simon Willison's preview. This user-driven allow-list beats static CSP in Chrome that rejects fetches outright. It enables secure third-party script loading without header changes.
What to watch for
Compare to browser dev tools CSP overrides which require manual tweaks each session. Test by loading Simon Willison's demo and triggering a script fetch violation to check modal approval flow.
Who this matters for
- Vibe Builders: Implement this fetch-interceptor pattern to enable dynamic, user-approved third-party integrations.
- Basic Users: Expect smoother app experiences where you can authorize blocked content via simple pop-up prompts.
Harsh’s take
This experiment addresses a persistent friction point in web security. By moving the allow-list decision from a static server-side header to a user-driven runtime flow, developers gain a practical way to manage third-party dependencies without compromising the entire CSP posture. It is a pragmatic solution for apps that need to load external resources in restricted environments.
Most developers rely on brittle browser-level overrides that vanish on refresh. This approach forces a cleaner architecture where the application handles its own security exceptions gracefully. It turns a hard block into a recoverable state, which is exactly how modern web applications should handle granular permissions.
Builders should adopt this pattern to improve reliability for embedded tools.
by Harsh Desai
More AI news
- LaunchAsian AI startups launch Mythos-like models as Anthropic export ban continues
Asian AI startups launched models with Mythos-like capabilities. The releases follow Anthropic's ongoing export restrictions.
- Daily RoundupGemini jetlag aid, OpenAI Jalapeño chip, and Vercel agent tools (daily focus hooks)
Google, Vercel, and OpenAI shipped practical AI updates while new models and benchmarks highlighted shifting hardware and capability limits.
- Model ReleaseOpenAI limits GPT-5.6 rollout after government request, says restrictions shouldn’t be the norm
OpenAI limited GPT-5.6 rollout after a government request. The company stated that such restrictions should not become the long-term default.