The only work adjacent to this I’m aware of is MetaMask Snaps[1], a plug-in system that allows for arbitrary code execution in wallets.
I know some teams in the 0xPARC community[1] are interested in it and have been looking into using it, but nothing publicly shareable on that yet.
[1]: https://0xparc.org/