Running Python code in a sandbox with MicroPython and WASM
A new alpha package called micropython-wasm has been released to run Python code in a sandbox environment. This package is intended for use with the Datasette Agent plugin, allowing for safer execution of plugin code. The goal is to enable code execution without risking the core application or user data.
- ▪The micropython-wasm package aims to provide a secure sandbox for running Python code.
- ▪It is designed to prevent plugins from executing harmful operations that could compromise the application or user data.
- ▪WebAssembly is utilized for its robust security features, making it suitable for executing untrusted code.
Opening excerpt (first ~120 words) tap to expand
Running Python code in a sandbox with MicroPython and WASM 6th June 2026 I’ve been experimenting with different approaches to running code in a sandbox for several years now, but my latest attempt feels like it might finally have all of the characteristics I’ve been looking for. I’ve released it as an alpha package called micropython-wasm, and I’m using it for a code execution sandbox plugin for Datasette Agent called datasette-agent-micropython. Why do I want a sandbox? My key open source projects—Datasette, LLM, even sqlite-utils—all support plugins. I absolutely love plugins as a mechanism for extending software.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Simon Willison's Weblog.