Add sandbox='allow-scripts' to all preview iframes. This isolates user-executed code from the parent page's localStorage (auth tokens), cookies, and DOM. Switch from document.write() to srcdoc attribute since sandboxed iframes can't use document.write(). Addresses SEC-1 (critical) from security audit.