Simon Willison 6/6/2026

Running Python code in a sandbox with MicroPython and WASM

Read Original

This article explores using MicroPython compiled to WebAssembly (WASM) as a sandbox for executing untrusted Python code within Python applications like Datasette. The author discusses the need for safe plugin execution with controlled file, network, memory, and CPU access. They introduce their alpha package micropython-wasm and a plugin datasette-agent-micropython, detailing the benefits of WASM for isolation and the ability to expose host functions. The article covers building the first version, testing, and the trade-offs of vibe-coded sandboxing.

Running Python code in a sandbox with MicroPython and WASM

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet