Skip to main content

HTML widgets and artifacts

Three surfaces draw an HTML document that someone other than the app wrote. None of them can see the app's stylesheets or custom properties: each document is in its own frame, so its own CSS is all there is. This page lists what the app does to each frame and document.

Surfaces​

HTML widgets​

The widget draws the response of its endpoint.

ItemValue
FrameAn iframe with srcdoc
sandboxEmpty. With ALLOW_HTML_JS_EXECUTION set to true: allow-scripts allow-forms allow-downloads allow-popups
Content security policyNone added
SanitizingNone
Added to the document
A script that passes parameters on, when scripts are allowed
ThemeThe theme query parameter, dark or light, on the request

iframe widgets​

The widget draws the page at its URL.

ItemValue
FrameAn iframe with src
sandboxallow-scripts allow-forms allow-downloads allow-popups allow-same-origin
Content security policyNone added
SanitizingNone
Added to the documentNothing
ThemeThe theme query parameter on the URL

Agent HTML artifacts​

The artifact draws the HTML that the model wrote.

ItemValue
FrameAn iframe with srcdoc
sandboxallow-same-origin. With ALLOW_HTML_JS_EXECUTION set to true: allow-scripts allow-downloads allow-popups
Content security policydefault-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; form-action 'none'; base-uri 'none'. With scripts allowed: default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; script-src 'nonce-<nonce>'; form-action 'none'; base-uri 'none'
SanitizingThe elements script iframe form object embed and the attributes onerror onload onclick onmouseover are removed, and so are the data-* attributes
Added to the document
A style element: <style>body{margin:0;padding:0}table{display:block;overflow-x:auto;max-width:100%}</style>
A script that reports the height, when scripts are allowed
ThemeNone: the model decides