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.
| Item | Value |
|---|---|
| Frame | An iframe with srcdoc |
| sandbox | Empty. With ALLOW_HTML_JS_EXECUTION set to true: allow-scripts allow-forms allow-downloads allow-popups |
| Content security policy | None added |
| Sanitizing | None |
| Added to the document | A script that passes parameters on, when scripts are allowed |
| Theme | The theme query parameter, dark or light, on the request |
iframe widgets
The widget draws the page at its URL.
| Item | Value |
|---|---|
| Frame | An iframe with src |
| sandbox | allow-scripts allow-forms allow-downloads allow-popups allow-same-origin |
| Content security policy | None added |
| Sanitizing | None |
| Added to the document | Nothing |
| Theme | The theme query parameter on the URL |
Agent HTML artifacts
The artifact draws the HTML that the model wrote.
| Item | Value |
|---|---|
| Frame | An iframe with srcdoc |
| sandbox | allow-same-origin. With ALLOW_HTML_JS_EXECUTION set to true: allow-scripts allow-downloads allow-popups |
| Content security policy | default-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' |
| Sanitizing | The 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 |
| Theme | None: the model decides |