# ADR-0009: Sandboxed Iframe Widgets with a postMessage Protocol - **Status:** Accepted - **Date:** 2024-06-03 - **Deciders:** FablePool core team - **Related:** ADR-0002 (frontend), ADR-0006 (content format), ADR-0010 (code judge), `docs/architecture/07-widget-sandboxing.md`, `docs/schemas/widget-manifest.schema.json` ## Context Interactive widgets (graph manipulators, circuit builders, geometry canvases, simulations) are core to the product — and they are community-contributed *code*, which is categorically different from community-contributed *content*. The brief mandates keeping interactive widgets separate from trusted core content. Threats if widget code ran in the host page: session/cookie theft, API calls as the user, DOM phishing overlays, exfiltration of answers, cryptomining. Candidate isolation strategies: trusted-only first-party widgets; reviewed JS executed in-page; iframe sandboxing; WebAssembly/interpreter sandboxes; server-side rendering of widget state. ## Decision Adopt the model specified in `07-widget-sandboxing.md`: 1. **Every community widget runs in a sandboxed `