In case you have not come across this it might be helpful:
MetaMask Snaps does something like Cloudflare OS's iframe sandbox, but it does aim to be suitable as a sandbox against malicious code.
Something of a security audit was published here: https://osec.io/blog/metamask-snaps/
Execution environment code here: https://github.com/MetaMask/snaps/tree/main/packages/snaps-e...
As it says in that readme, "sandboxed using Secure EcmaScript (SES)": https://github.com/endojs/endo/tree/master/packages/ses (which you might be familiar with, as it is a project of Endo, which Mark Miller helps lead)