← Projects

SANDBOX

A personal library of AI-generated mini-apps that run in the browser. Drop in JSX, TSX or HTML and it runs in a sandboxed iframe; npm imports are fetched from a CDN allowlist and cached offline. No backend.

2026SoloReactTypeScriptViteTailwindDexieIndexedDB

AI tools generate a lot of small, single-file apps. SANDBOX is a place to keep them and run them. Paste code, drop a file, or paste a URL; JSX is transpiled in the browser with Babel, React and Tailwind are preloaded, and any imported npm package is fetched from a CDN and cached in IndexedDB so the next run works offline. Single user, no accounts, everything stays in your browser.

Security

The runtime executes arbitrary AI-generated JavaScript, so the mitigations are layered so that a compromise of one does not reach the user's library.

  1. Separate origin for the runtime. The iframe shell is served from a different origin than the app. Same-origin policy structurally prevents artifact code from touching the app's IndexedDB, storage or DOM.
  2. sandbox="allow-scripts" without allow-same-origin. The iframe gets an opaque origin, so it cannot reach storage on the runtime origin either.
  3. Validated postMessage. Outbound messages use a concrete targetOrigin; inbound messages are trusted by event.source identity, since a sandboxed iframe's event.origin is "null".
  4. CSP on the runtime origin. default-src 'none', connect-src restricted to the CDN allowlist, frame-ancestors restricted to the app.
  5. Nothing secret on the runtime origin. It serves static shell HTML only.
  6. referrerpolicy="no-referrer" on the iframe, so an artifact cannot learn which artifact is running.
  7. Enforced CDN allowlist: jsdelivr, unpkg, cdnjs. Network access is a user toggle in Settings.