You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -362,9 +416,11 @@ If the Host is a web page, it MUST wrap the Guest UI and communicate with it thr
362
416
4. Once the Sandbox is ready, the Host MUST send the raw HTML resource to load in a `ui/notifications/sandbox-resource-ready` notification.
363
417
5. The Sandbox MUST load the raw HTML of the Guest UI with CSP settings that:
364
418
- Enforce the domains declared in `ui.csp` metadata
365
-
- Prevent nested iframes (`frame-src 'none'`)
366
-
- Block dangerous features (`object-src 'none'`, `base-uri 'self'`)
419
+
- If `frameDomains` is provided, allow nested iframes from declared origins; otherwise use `frame-src 'none'`
420
+
- If `baseUriDomains` is provided, allow base URIs from declared origins; otherwise use `base-uri 'self'`
421
+
- Block dangerous features (`object-src 'none'`)
367
422
- Apply restrictive defaults if no CSP metadata is provided
423
+
- If `permissions` is declared, the Sandbox MAY set the inner iframe's `allow` attribute accordingly
368
424
6. The Sandbox MUST forward messages sent by the Host to the Guest UI, and vice versa, for any method that doesn’t start with `ui/notifications/sandbox-`. This includes lifecycle messages, e.g., `ui/initialize` request & `ui/notifications/initialized` notification both sent by the Guest UI. The Host MUST NOT send any request or notification to the Guest UI before it receives an `initialized` notification.
369
425
7. The Sandbox SHOULD NOT create/send any requests to the Host or to the Guest UI (this would require synthesizing new request ids).
370
426
8. The Host MAY forward any message from the Guest UI (coming via the Sandbox) to the MCP Apps server, for any method that doesn’t start with `ui/`. While the Host SHOULD ensure the Guest UI’s MCP connection is spec-compliant, it MAY decide to block some messages or subject them to further user approval.
@@ -826,12 +882,23 @@ These messages are reserved for web-based hosts that implement the recommended d
sandbox: string// Optional override for inner iframe `sandbox` attribute
885
+
sandbox?:string, // Optional override for inner iframe `sandbox` attribute
886
+
csp?: { // CSP configuration from resource metadata
887
+
connectDomains?: string[],
888
+
resourceDomains?: string[],
889
+
frameDomains?: string[],
890
+
baseUriDomains?: string[],
891
+
},
892
+
permissions?: { // Sandbox permissions from resource metadata
893
+
camera?: boolean,
894
+
microphone?: boolean,
895
+
geolocation?: boolean,
896
+
}
830
897
}
831
898
}
832
899
```
833
900
834
-
These messages facilitate the communication between the outer sandbox proxy iframe and the host, enabling secure loading of untrusted HTML content.
901
+
These messages facilitate the communication between the outer sandbox proxy iframe and the host, enabling secure loading of untrusted HTML content. The `permissions` field maps to the inner iframe's `allow` attribute for Permission Policy features.
835
902
836
903
### Lifecycle
837
904
@@ -1269,6 +1336,7 @@ Hosts MUST enforce Content Security Policies based on resource metadata.
0 commit comments