I got a WebAssembly build of this working and fired up a web playground for trying it out: https://simonw.github.io/research/monty-wasm-pyodide/demo.ht... It doesn't have class support yet! But it doesn't matter, because LLMs that try to use a class will get an error message and rewrite their code to not use classes instead. Notes on how I got the WASM build working here: https://simonwillison.net/2026/Feb/6/pydantic…
Monty: A minimal, secure Python interpreter written in Rust for use by AI
131–140 of 179 posts
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#132I got a WebAssembly build of this working and fired up a web playground for trying it out: https://simonw.github.io/research/monty-wasm-pyodide/demo.ht... It doesn't have class support yet! But it doesn't matter, because LLMs that try to use a class will get an error message and rewrite their code to not use classes instead. Notes on how I got the WASM build working here: https://simonwillison.net/2026/Feb/6/pydantic…
[flagged]
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#133I got a WebAssembly build of this working and fired up a web playground for trying it out: https://simonw.github.io/research/monty-wasm-pyodide/demo.ht... It doesn't have class support yet! But it doesn't matter, because LLMs that try to use a class will get an error message and rewrite their code to not use classes instead. Notes on how I got the WASM build working here: https://simonwillison.net/2026/Feb/6/pydantic…
> But it doesn't matter, because LLMs that try to use a class will get an error message and rewrite their code to not use classes instead. This is true in a sense, but every little papercut at the lower levels of abstraction degrades performance at higher levels as the LLM needs to spend its efforts on hacking around jank in the Python interpreter instead of solving the real problem.
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#134Earlier quoted context omitted.
They plan to use to for "Code Mode" which mean the LLM will use this to run Python code that it writes to run tools instead of having to load the tools up front into the LLM context window.
(Pydantic AI lead here) We’re implementing Code Mode in https://github.com/pydantic/pydantic-ai/pull/4153 with support for Monty and abstractions to use other runtimes / sandboxes. The idea is that in “traditional” LLM tool calling, the entire (MCP) tool result is sent back to the LLM, even if it just needs a few fields, or is going to pass the return value into another tool without needing to see the intermediate va…
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#135Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#136My current security model is to give it a separate Linux user.
So it can blow itself up and... I think that's about it?
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#137Earlier quoted context omitted.
[flagged]
Every AI advancement liberates real humans from drudgery and allows them to create what they want more easily. The invention of the digital calculator turned human calculators into accountants, and that's great! We're contributing to the same process now
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#138Earlier quoted context omitted.
How do you feel about software engineers who build open source libraries? Open source has been responsible for enormous productivity boosts in our industry, because we don't all have to build duplicates of exactly the same thing time and time again. But think of all of the jobs that were lost by people who would otherwise been employed building the 500th version of a CSS design system, or a template engine, or code t…
Previously, open source software didn't contribute to automating away jobs, at least not at scale. Open Source libraries weren't potentially maintaining themselves (I know we aren't there yet, but that seems to be the goal). You cannot compare any open source software, even as a whole, to the impact that LLMs have had on labor and are projected too. However, I might now argue it would have been better to not have so…
I'm an optimist on this and I remain hopeful that AI will create more and better jobs, but I'm not at all certain about that. It's possible it will play out the way you describe, and that will suck.
I'm not ready to blame the 100,000s of software layoffs on AI though - I think the more likely explanation for those is over-hiring during Covid combined with the end of ZIRP.
Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#139Re: Monty: A minimal, secure Python interpreter written in Rust for use by AI
#140The security angle is probably the most compelling part. Running arbitrary AI-generated Python in a full CPython runtime is asking for trouble — the attack surface is enormous. Stripping it down to a minimal subset at least constrains what the generated code can do.
The bet here seems to be that AI-generated code can be nudged to use a restricted subset through error feedback loops, which honestly seems reasonable for most tool-use scenarios. You don't need metaclasses and dynamic imports to parse JSON or make API calls.