I may have finally found the Python-in-a-sandbox solution I've been looking for... here's my latest experiment, this time running MicroPython in WebAssembly inside my Python applications https://simonwillison.net/2026/Jun/6/micropython-in-a-sandbox/
I may have finally found the Python-in-a-sandbox solution I've been looking for... here's my latest experiment, this time running MicroPython in WebAssembly inside my Python applications https://simonwillison.net/2026/Jun/6/micropython-in-a-sandbox/
Users thank Simon Willison for sharing his MicroPython in WebAssembly technique because it provides the Python sandboxing solution they have needed.
You can try it out like this:
uvx micropython-wasm -c 'print("Hello world")'
I may have finally found the Python-in-a-sandbox solution I've been looking for... here's my latest experiment, this time running MicroPython in WebAssembly inside my Python applications https://simonwillison.net/2026/Jun/6/micropython-in-a-sandbox/

@simonw so youre nesting python into wasm into python
is this what we call pythonception or just advanced procrastination?

@simonw I’ve needed something like this. Thanks for sharing. 👍🍺

@simonw embedded systems always hit this: want Python's libraries, can't trust user code in production.
finally solved? what's the performance cost?

@simonw Sandboxing gets real when failure stays observable. The runtime matters less than the escape hatch.

@simonw stacking runtimes inside runtimes is the most python thing ive ever seen
cpu fans gonna work overtime though