Simon Willison · · 1 min read

pydantic-monty investigation

Mirrored from Simon Willison for archival readability. Support the source by reading on the original site.

22nd May 2026

Research pydantic-monty investigation — Reviewing `pydantic-monty` reveals it as a fast, minimal Python interpreter designed for controlled sandboxed execution, primarily useful when transforming data, branching, looping, and interacting with a select set of trusted host tools or a virtual filesystem. The interpreter purposefully omits large portions of CPython’s functionality, with clear boundaries: unsupported features and missing resources generally fail cleanly as structured errors rather than escaping into the host runtime.

It's been a few months since I last poked at Monty, the sandboxed subset of Python implemented in Rust. I had Claude Code look at the most recent release.

Importantly the max_duration_secs, max_memory, max_allocations, and max_recursion_depth settings all appear to work as advertised.

Posted 22nd May 2026 at 10:41 pm

Recent articles

This is a beat by Simon Willison, posted on 22nd May 2026.

python 1,252 sandboxing 40 pydantic 16

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from Simon Willison