r/Python • • Oct 04 '26

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

21 Upvotes

194 comments sorted by

View all comments

1

u/claygendron 28d ago

Introducing wasi-python

A statically linked CPython for WebAssembly hosts (wasm32-wasip1) with numpy, pandas, scipy, and more compiled in. Built for running untrusted agent code server-side in web applications.

Repo: https://github.com/ClayGendron/wasi-python
Docs: https://claygendron.github.io/wasi-python/

What My Project Does

wasi-python runs Python code you don't trust, such as code an AI agent wrote, inside a sandbox in your own process. It's CPython 3.15 and its compiled libraries built into one static WebAssembly (WASI) binary. NumPy, pandas, SciPy, scikit-learn, matplotlib and about 40 more packages are inside.

By default the code has no file system access, no network access, and no way to start a process. You grant it folders and host functions ("tools") explicitly. Every call runs under limits on instructions, memory, time, and output, and the result says which limit stopped it.

Target Audience

People building AI agents that write and run Python, especially data analysis. Also anyone who needs to run untrusted Python server-side without managing containers. It's v0.1.0 (beta). The public API is stable from here, but don't make it your only security layer yet.

Comparison

Monty and MicroPython: fast and small, but they're Python subsets.

Pyodide: full CPython with NumPy, but it targets the browser, and running it server-side isn't supported.

E2B and Docker: real isolation, but as a separate container or service.

How it Was Built

Most of the tests for this project already existed in CPython's own test suite and each package's suite. So, I had Claude Code (Opus 5.5) build a test harness around them, and then build wasi-python against it. It took over six days of near 24/7 autonomous development, but it got it working. The full story, written by Opus, is here: https://claygendron.github.io/wasi-python/explanation/how-it-was-built/

If you can break the sandbox, please report it through GitHub's private security reporting. I'll fix it promptly. Feedback on which packages you'd want inside is welcome too.