The Information Machine

Simon Willison's MicroPython/WASM Sandboxed Code Execution for AI Agents

closed · v5 · 2026-06-17 · 51 items · history

What's new in v5

The substantive addition is Willison's June 13 work: a technical post on publishing WASM wheels to PyPI via the new PyEmscripten platform (PEP 783) and the luau-wasm 0.1a0 release as a demonstration. [7][8] This is adjacent to the AI agent sandbox story — it does not affect Willison's server-side MicroPython choice — but shows him continuing to push on the Python/WASM toolchain more broadly. The remaining new items carry no extractable claims. No new voices or tensions appeared.

What

Simon Willison has released a suite of alpha packages for AI agent tooling in Datasette built around two safety strategies: MicroPython-in-WASM sandboxing for code execution [1][3] and human-in-the-loop interruption for consequential actions. [6] On June 13, he released luau-wasm 0.1a0 and a companion post on a newly supported Pyodide capability — publishing WASM-compiled Python packages directly to PyPI — expanding his work in the Python/WASM ecosystem adjacent to the agent sandbox project. [7][8]

Why it matters

Willison's framework offers a layered reference implementation for agent safety: sandboxing constrains what code can do; human-in-the-loop gates what the agent can decide alone. Both mechanisms ship as pip-installable plugins. The Pyodide packaging development shows the Python/WASM ecosystem maturing, though it does not alter the server-side MicroPython choice at the core of Willison's agent sandbox.

Open questions

  • Will the MicroPython/WASM sandbox hold under sustained adversarial prompting beyond the initial GPT-5.5 tests? [3]

  • How does the ask_user() interruption pattern scale when agents run many sequential operations — does it become friction-heavy in practice? [6]

  • Will companies with dedicated security teams adopt and open source hardened Python-in-WASM implementations, as Willison hopes? [4]

  • The new PyEmscripten platform addresses Pyodide's client-side packaging bottleneck [7] — could future server-side Pyodide support eventually change Willison's MicroPython-over-Pyodide design choice?

Narrative

Simon Willison released three alpha packages on June 2, 2026, aimed at sandboxed Python execution for AI agents in the Datasette ecosystem. The core package, micropython-wasm, bundles a customized WebAssembly build of MicroPython and runs it through Python's wasmtime bindings; a same-day bug-fix release (0.1a1) followed. The companion plugin, datasette-agent-micropython, integrates the sandbox into Datasette Agent — Willison's LLM-powered assistant for the Datasette data exploration tool — routing code-execution requests through the MicroPython/WASM sandbox instead of running them natively. [1][2][3]

Willison's June 6 technical post explains the design decisions. [4] He chose MicroPython over Pyodide because Pyodide cannot run server-side as of late 2024. For persistent interpreter state across multiple agent turns, he routes execution through a MicroPython instance running in a background thread that blocks on a host-side queue. He favored WASM over V8-in-Python alternatives based on WebAssembly's browser security track record. AI coding agents — specifically Codex Desktop and GPT-5.5 — wrote the core implementation, including 78 lines of C bridging host functions into WASM. Willison is candid about the project's experimental state and acknowledges the irony of adding another immature sandboxing library to an ecosystem he has criticized for that same quality.

On June 7, Willison released datasette-agent-edit 0.1a0, implementing Claude's text editor design — with view, str_replace, and insert tools — as a reusable base for agentic text editing across Datasette plugins. [5] On June 10, datasette-agent 0.2a0 extended the safety model in a different direction: human-in-the-loop interruption. Tools that declare a context parameter now receive a ToolContext object and can call await context.ask_user(...) to pause mid-execution and request user input. Suspended conversations persist to the internal database and survive server restarts, with stored answers replayed on re-execution. A new save_query tool demonstrates the pattern: the agent shows the full SQL plus proposed metadata, and nothing is written until the user approves. [6]

On June 13, Willison turned attention to the broader Python/WASM packaging ecosystem. He published a post describing a new Pyodide capability: Python packages compiled for the PyEmscripten platform (PEP 783) can now be published directly to PyPI and installed at runtime via micropip. [7] Previously Pyodide maintainers had to manually maintain and host over 300 packages, creating a bottleneck for the community; PyPI merged support on April 21, 2026, and 28 packages had already adopted the new platform tags. Willison released luau-wasm 0.1a0 — a 276KB wrapper around Roblox's Luau scripting language compiled to WASM — as a hands-on demonstration of the capability. [8] This development is adjacent to the agent sandbox project: it does not affect Willison's server-side MicroPython choice, but it shows the WASM packaging toolchain he uses maturing across the broader ecosystem.

Timeline

  • 2026-06-02: micropython-wasm 0.1a0 released: a WASM build of MicroPython wrapped with wasmtime for sandboxed Python execution. [1]
  • 2026-06-02: micropython-wasm 0.1a1 released: bug fixes uncovered while building the Datasette Agent integration. [2]
  • 2026-06-02: datasette-agent-micropython 0.1a0 released: plugin routes Datasette Agent's code execution into the MicroPython/WASM sandbox; GPT-5.5 has not yet escaped. [3]
  • 2026-06-05: Qiang Han endorses sandboxed execution as 'the right instinct' and references a related project Glyph 0.3.0. [9][10]
  • 2026-06-06: Willison publishes full technical post: explains Pyodide's server-side limitation, persistent state via thread/queue, and that AI agents wrote 78 lines of C bridging code. [4]
  • 2026-06-06: Mykyta Pavlenko argues 'the sandbox is the product once agents can run code' and separately states he does not want agents with more autonomy yet. [11][12]
  • 2026-06-07: datasette-agent-edit 0.1a0 released: implements Claude's text editor pattern (view, str_replace, insert) as a reusable base layer for agentic editing across Datasette plugins. [5]
  • 2026-06-10: datasette-agent 0.2a0 released: tools can pause mid-execution via ask_user() to request human input; suspended conversations persist across restarts; save_query tool requires explicit approval before writing. [6]
  • 2026-06-13: Willison publishes on new Pyodide/PyEmscripten WASM wheel publishing capability (PEP 783) and releases luau-wasm 0.1a0 as a demonstration; 28 packages already use the new platform tags. [7][8]

Perspectives

Simon Willison

Cautiously optimistic: frames the project as demonstrating Python-in-WASM sandboxing is viable while being explicit about alpha status; expanding agent safety in two directions — sandboxed execution and human-in-the-loop interruption — each released as a reusable pip-installable plugin.

Evolution: Scope has widened with each release; the June 13 Pyodide packaging work extends his WASM interests beyond the AI agent sandbox into general Python/WASM ecosystem tooling.

Qiang Han (@QiangHan20)

Endorses sandboxed execution as 'the right instinct,' framing it as a security principle: don't trust agent output, gate it through a sandbox.

Evolution: Consistent; first and only appearance.

Mykyta Pavlenko (@mktpavlenko)

Frames sandboxing as infrastructure-level necessity ('the sandbox is the product once agents can run code') while expressing personal reluctance to grant agents more autonomy in the near term.

Evolution: Consistent; adds a structural product framing absent from other commentators.

Landon Huber (@LandonDHuber)

Cautiously positive: notes GPT-5.5 has not escaped the sandbox, calling it promising while implicitly acknowledging sandbox survival under real adversarial conditions remains unproven.

Evolution: Consistent; amplifier role.

Status: active but slowing

Sources

  1. [1] micropython-wasm 0.1a0 — Simon Willison (2026-06-02)
  2. [2] micropython-wasm 0.1a1 — Simon Willison (2026-06-02)
  3. [3] datasette-agent-micropython 0.1a0 — Simon Willison (2026-06-02)
  4. [4] Running Python code in a sandbox with MicroPython and WASM — Simon Willison (2026-06-06)
  5. [5] datasette-agent-edit 0.1a0 — Simon Willison (2026-06-07)
  6. [6] datasette-agent 0.2a0 — Simon Willison (2026-06-10)
  7. [7] Publishing WASM wheels to PyPI for use with Pyodide — Simon Willison (2026-06-13)
  8. [8] luau-wasm 0.1a0 — Simon Willison (2026-06-13)
  9. [9] RT @QiangHan20: Sandboxed MicroPython for Datasette Agent is the right instinct — don't trust the agent's edit, gate it.... — reactive:simon-willison-wasm-sandbox (2026-06-05)
  10. [10] Sandboxed MicroPython for Datasette Agent is the right instinct — don't trust the agent's edit, gate it. Glyph 0.3.0's g... — reactive:simon-willison-wasm-sandbox (2026-06-05)
  11. [11] The sandbox is the product once agents can run code. — reactive:simon-willison-wasm-sandbox (2026-06-06)
  12. [12] I don't want agents with more autonomy yet. — reactive:simon-willison-wasm-sandbox (2026-06-06)
  13. [13] Datasette Agent can now spin up MicroPython code in a sandbox and GPT‑5.5 still hasn't escaped – that's promising, thou... — reactive:simon-willison-wasm-sandbox (2026-06-06)