Skip to content
All posts

Engineering · Nov 12, 2026 · 6 min read

How the Frontables preview sandbox keeps your account safe

Generated code never runs on our servers. Here's how we isolate previews in the browser.

By Frontables Engineering

AI-generated code is untrusted code. Even when the model is well-behaved, a prompt can ask for anything. So we designed the preview system with one rule: generated code must never execute with access to your Frontables session.

Opaque-origin iframes

The live preview is rendered in an iframe with sandbox="allow-scripts" and without allow-same-origin. The browser assigns the frame a unique opaque origin, so scripts inside can't read cookies, local storage or make credentialed requests to the app.

Standalone previews

When you open a preview in a new tab, the response carries a Content-Security-Policy: sandbox header, which applies the same isolation to a top-level document.

Nothing runs server-side

Project files are stored as text and assembled into a document in the browser. Our servers never evaluate generated JavaScript. When we add server-side runtimes, they'll run in isolated microVMs behind a provider interface — never on the application servers.

How the Frontables preview sandbox keeps your account safe · Frontables