<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp" -->

---
title: Running Pydantic’s Monty Rust sandboxed Python subset in...
description: Pydantic's Monty is a new sandboxing solution that provides a Python subset implemented in Rust for safely running LLM-generated code with microsecond startup...
canonical: https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Running Pydantic’s Monty Rust sandboxed Python subset in WebAssembly | daily.dev
og:description: Pydantic's Monty is a new sandboxing solution that provides a Python subset implemented in Rust for safely running LLM-generated code with microsecond startup...
og:url: https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp
og:image: https://api.daily.dev/og/posts/ZurodRvzp.png
og:image:alt: Running Pydantic’s Monty Rust sandboxed Python subset in WebAssembly
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Running Pydantic’s Monty Rust sandboxed Python subset in WebAssembly

**[Simon Willison](https://daily.dev/sources/simonwillison)** · 4 min read · 1 upvotes · 0 comments

## Summary

Pydantic's Monty is a new sandboxing solution that provides a Python subset implemented in Rust for safely running LLM-generated code with microsecond startup times. The author demonstrates compiling Monty to WebAssembly in two forms: as a standalone WASM module callable from JavaScript, and as a wheel file loadable in Pyodide. Both implementations are showcased through browser-based demos hosted on GitHub Pages, illustrating how modern tooling makes it straightforward to compile Rust code into WebAssembly for multiple runtime environments.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://simonwillison.net/2026/Feb/6/pydantic-monty/>

## Similar posts on daily.dev

- [Monty - Python in Rust for AI](https://daily.dev/posts/monty---python-in-rust-for-ai-zrxdj2qu8) · Planet Python · 0 upvotes · 0 comments
- [WebAssembly as a Python extension platform](https://daily.dev/posts/webassembly-as-a-python-extension-platform-uk45ymkeo) · Hacker News · 0 upvotes · 0 comments
- [Running Python code in a sandbox with MicroPython and WASM](https://daily.dev/posts/running-python-code-in-a-sandbox-with-micropython-and-wasm-zzzzwu8mf) · Simon Willison · 2 upvotes · 1 comments

---

Tags: [#pydantic](https://daily.dev/tags/pydantic), [#python](https://daily.dev/tags/python), [#rust](https://daily.dev/tags/rust), [#webassembly](https://daily.dev/tags/webassembly)

[View this post on daily.dev](https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Running Pydantic’s Monty Rust sandboxed Python subset in WebAssembly","url":"https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp"},"datePublished":"2026-02-06T22:36:11.833Z","dateModified":"2026-03-15T03:47:42.057Z","description":"Pydantic's Monty is a new sandboxing solution that provides a Python subset implemented in Rust for safely running LLM-generated code with microsecond startup...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/46a7698525d7ef61efcd9fa12953289b?_a=AQAEunF","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/46a7698525d7ef61efcd9fa12953289b?_a=AQAEunF","isAccessibleForFree":true,"articleSection":"Simon Willison","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Simon Willison","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/cf12b897300740218b35f49a6309ec5b","url":"https://daily.dev/sources/simonwillison"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/running-pydantic-s-monty-rust-sandboxed-python-subset-in-webassembly-zurodrvzp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"pydantic,python,rust,webassembly","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Simon Willison","item":"https://daily.dev/sources/simonwillison"},{"@type":"ListItem","position":3,"name":"Running Pydantic’s Monty Rust sandboxed Python subset in WebAssembly"}]}
```

