Running Python code in a sandbox with MicroPython and WASM
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Python developers who need to run untrusted code safely now have a dependency-free WASM-based sandbox installable directly from PyPI.
Programmer Simon Willison released an alpha tool called micropython-wasm that runs Python code inside a sealed box, so the code cannot snoop on files, use the network, or crash the host computer. It works by running a miniature version of Python, called MicroPython, inside WebAssembly, a security technology web browsers use to run downloaded code safely. The tool is live on PyPI and is already used by his Datasette Agent.
Simon Willison released micropython-wasm, an alpha Python package on PyPI that executes untrusted code in a WebAssembly sandbox using MicroPython. Its 362KB WASM blob installs cleanly from PyPI with no extra steps, with memory limits via wasmtime and a 20 million 'fuel' cap on CPU operations. Practical use today is mostly within Willison's own Datasette Agent project; the package is explicitly an alpha, and the CPU limit value is unproven.
micropython-wasm compiles MicroPython to a 362KB WebAssembly binary run via the wasmtime Python library, built from Yamamoto Takahashi's experimental WASI support PR. Persistent sessions block the interpreter on a host function feeding code to eval(), queue-based, with host functions exposed via 78 lines of compiled C. Memory limits come from wasmtime; CPU limits use a fuel setting of 20 million, which the author flags as untested. It powers the datasette-agent-micropython plugin.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
micropython-wasm MicroPython WebAssembly wasmtime Datasette Agent Pyodide PyPI
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code‑driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game‑changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross‑platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.