{"slug": "monty", "name": "Monty", "category": "security", "category_name": "Security and passwords", "description": "", "recommenders": 8, "commenters": 13, "warners": 0, "score": 8.412, "rising": 0.04, "first": "2026-02-06", "latest": "2026-10-04", "why": "For LLM generated Python code, pydantic's monty is awesome", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 8, "neutral": 4, "compare": 1, "warn": 0}, "spark": [0, 0, 0, 3, 1, 0, 1, 1, 0, 0, 1, 1], "listed": true, "loved": [], "caveat": "", "short_quote": "For LLM generated Python code, pydantic's monty is awesome", "kind": "", "icon": true, "domain": null, "github_repo": "github.com/pydantic/monty", "official_url": "https://github.com/pydantic/monty", "pricing": "", "aliases": ["Monty", "monty"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 799215106, "item_id": 49950944, "url": "https://news.ycombinator.com/item?id=49950944", "by": "demoonkevin", "date": "2026-10-04", "stance": "recommend", "quote": "it is now much easier to create plugins in a few steps, without compilation", "excerpt": "I've been keeping `ty-extended` in sync with upstream `ty`, and a few days ago I thought probably the slow adoption of it was that one needed to write the plugins in Rust. Also, pure Python codebases that need to have custom private plugins would need to add the extremely slow Rust compile times to their CI workflows. Today I added Pydantic's Monty that supports a Python subset that IMO is sufficient for supporting t", "context": "", "use_case": "plugin runtime", "switched_from": "", "story": null}, {"id": 796501680, "item_id": 49781355, "url": "https://news.ycombinator.com/item?id=49781355", "by": "aadyachinubhai", "date": "2026-09-20", "stance": "recommend", "quote": "For LLM generated Python code, pydantic's monty is awesome", "excerpt": "For LLM generated Python code, pydantic's monty is awesome: https://github.com/pydantic/monty Plus, pydantic is funded so it will be well maintained.", "context": "", "use_case": "sandboxing LLM-generated Python", "switched_from": "", "story": "Software sandboxing: The basics (2025)"}, {"id": 774883984, "item_id": 48430249, "url": "https://news.ycombinator.com/item?id=48430249", "by": "tuananh", "date": "2026-06-06", "stance": "recommend", "quote": "there's also monty by pydantic", "excerpt": "there's also monty by pydantic https://github.com/pydantic/monty it's Rust so can be compile to wasm, example: https://github.com/hyper-mcp-rs/monty-plugin", "context": "", "use_case": "sandboxed Python execution", "switched_from": "", "story": "Running Python code in a sandbox with MicroPython and WASM"}, {"id": 773600114, "item_id": 48350007, "url": "https://news.ycombinator.com/item?id=48350007", "by": "yencabulator", "date": "2026-05-31", "stance": "recommend", "quote": "Maybe even Python if it can be made safe.", "excerpt": "> Maybe even Python if it can be made safe. https://github.com/pydantic/monty", "context": "", "use_case": "sandboxed Python execution", "switched_from": "", "story": "MCP Is Dead"}, {"id": 757835328, "item_id": 47364708, "url": "https://news.ycombinator.com/item?id=47364708", "by": "bonoboTP", "date": "2026-03-13", "stance": "recommend", "quote": "Benchmark it against a fast Python interpreter optimized for AI tool calling, like Monty", "excerpt": "Benchmark it against a fast Python interpreter optimized for AI tool calling, like Monty: https://github.com/pydantic/monty", "context": "", "use_case": "fast interpreter for agents", "switched_from": "", "story": "Executing programs inside transformers with exponentially faster inference"}]}], "caveats": [], "who": [], "tags": [], "use_cases": ["sandboxed python execution", "plugin runtime", "sandboxing llm-generated python", "snapshotting programs", "planned query tool", "fast interpreter for agents"], "compared": [{"slug": "pydantic-ai", "name": "Pydantic AI", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [{"id": 769553394, "item_id": 48097087, "url": "https://news.ycombinator.com/item?id=48097087", "by": "rocketniko", "date": "2026-05-11", "stance": "neutral", "quote": "based on Monty", "excerpt": "An extension module for Redis or Valkey for in-process Python execution, based on Monty. Learning playground for my Rust skills mostly, but gradually over-engineering it into a whole new ecosystem of sort :-) https://github.com/xelato/taranaki", "context": "", "use_case": "Python sandbox base", "switched_from": "", "story": "Ask HN: What Are You Working On? (May 2026)"}, {"id": 750726208, "item_id": 46920388, "url": "https://news.ycombinator.com/item?id=46920388", "by": "DouweM", "date": "2026-02-06", "stance": "recommend", "quote": "Monty\u2019s overhead is so low that, assuming we get the security / capabilities tradeoff right", "excerpt": "(Pydantic AI lead here) That\u2019s exactly what we built this for: we\u2019re implementing Code Mode in https://github.com/pydantic/pydantic-ai/pull/4153 which will use Monty by default, with abstractions to use other runtimes / sandboxes. Monty\u2019s overhead is so low that, assuming we get the security / capabilities tradeoff right (Samuel can comment on this more), you could always have it enabled on your agents with basically", "context": "Pydantic AI lead", "use_case": "Sandboxed code execution for agents", "switched_from": "", "story": "Python interpreter written in Rust for use by AI"}], "threads": [{"url": "https://news.ycombinator.com/item?id=46918254", "title": "Python interpreter written in Rust for use by AI", "mentions": 5}, {"url": "https://news.ycombinator.com/item?id=47165648", "title": "just-bash: Bash for Agents", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=49950943", "title": "item 49950943", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49778670", "title": "Software sandboxing: The basics (2025)", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49635621", "title": "Durable execution without history replay", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48425347", "title": "Running Python code in a sandbox with MicroPython and WASM", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {}, "2026-02": {"recommend": 3, "neutral": 2}, "2026-03": {"compare": 1, "recommend": 1, "neutral": 1}, "2026-04": {}, "2026-05": {"recommend": 1}, "2026-06": {"recommend": 1}, "2026-07": {}, "2026-08": {}, "2026-09": {"neutral": 1, "recommend": 1}, "2026-10": {"recommend": 1}}, "quotes": [{"id": 799215106, "item_id": 49950944, "url": "https://news.ycombinator.com/item?id=49950944", "by": "demoonkevin", "date": "2026-10-04", "stance": "recommend", "quote": "it is now much easier to create plugins in a few steps, without compilation", "excerpt": "I've been keeping `ty-extended` in sync with upstream `ty`, and a few days ago I thought probably the slow adoption of it was that one needed to write the plugins in Rust. Also, pure Python codebases that need to have custom private plugins would need to add the extremely slow Rust compile times to their CI workflows. Today I added Pydantic's Monty that supports a Python subset that IMO is sufficient for supporting t", "context": "", "use_case": "plugin runtime", "switched_from": "", "story": null}, {"id": 796501680, "item_id": 49781355, "url": "https://news.ycombinator.com/item?id=49781355", "by": "aadyachinubhai", "date": "2026-09-20", "stance": "recommend", "quote": "For LLM generated Python code, pydantic's monty is awesome", "excerpt": "For LLM generated Python code, pydantic's monty is awesome: https://github.com/pydantic/monty Plus, pydantic is funded so it will be well maintained.", "context": "", "use_case": "sandboxing LLM-generated Python", "switched_from": "", "story": "Software sandboxing: The basics (2025)"}, {"id": 794910672, "item_id": 49681917, "url": "https://news.ycombinator.com/item?id=49681917", "by": "alex_hirner", "date": "2026-09-13", "stance": "neutral", "quote": "Snapshotting programs is also what https://github.com/pydantic/monty enables and aims for.", "excerpt": "Snapshotting programs is also what https://github.com/pydantic/monty enables and aims for. FWIW, I think we'll see a rise of AI-ready interpreters. In some sense, I like that it challenges traditional microservice architectures as an aside.", "context": "", "use_case": "snapshotting programs", "switched_from": "", "story": "Durable execution without history replay"}, {"id": 774883984, "item_id": 48430249, "url": "https://news.ycombinator.com/item?id=48430249", "by": "tuananh", "date": "2026-06-06", "stance": "recommend", "quote": "there's also monty by pydantic", "excerpt": "there's also monty by pydantic https://github.com/pydantic/monty it's Rust so can be compile to wasm, example: https://github.com/hyper-mcp-rs/monty-plugin", "context": "", "use_case": "sandboxed Python execution", "switched_from": "", "story": "Running Python code in a sandbox with MicroPython and WASM"}, {"id": 773600114, "item_id": 48350007, "url": "https://news.ycombinator.com/item?id=48350007", "by": "yencabulator", "date": "2026-05-31", "stance": "recommend", "quote": "Maybe even Python if it can be made safe.", "excerpt": "> Maybe even Python if it can be made safe. https://github.com/pydantic/monty", "context": "", "use_case": "sandboxed Python execution", "switched_from": "", "story": "MCP Is Dead"}, {"id": 760693841, "item_id": 47543365, "url": "https://news.ycombinator.com/item?id=47543365", "by": "ivaniscoding", "date": "2026-03-27", "stance": "neutral", "quote": "One day I want to try writing a query tool with https://github.com/pydantic/monty", "excerpt": "That\u2019s some fair criticism, but the same page tells that the language wanted to have a similar syntax to C and JavaScript. I think my personal preference for syntax would be Python\u2019s. One day I want to try writing a query tool with https://github.com/pydantic/monty", "context": "", "use_case": "Planned query tool", "switched_from": "", "story": "A Faster Alternative to Jq"}, {"id": 757835328, "item_id": 47364708, "url": "https://news.ycombinator.com/item?id=47364708", "by": "bonoboTP", "date": "2026-03-13", "stance": "recommend", "quote": "Benchmark it against a fast Python interpreter optimized for AI tool calling, like Monty", "excerpt": "Benchmark it against a fast Python interpreter optimized for AI tool calling, like Monty: https://github.com/pydantic/monty", "context": "", "use_case": "fast interpreter for agents", "switched_from": "", "story": "Executing programs inside transformers with exponentially faster inference"}, {"id": 757695265, "item_id": 47355954, "url": "https://news.ycombinator.com/item?id=47355954", "by": "TheUncharted", "date": "2026-03-12", "stance": "compare", "quote": "I was inspired by Monty", "excerpt": "Hey everyone, I was inspired by Monty and built Zapcode \u2014 an open-source TypeScript subset interpreter in Rust, designed for AI agents that write code instead of chaining tool calls. The problem: AI agents are better when they write code rather than calling tools one by one. Cloudflare (https://blog.cloudflare.com/code-mode/), Anthropic, HuggingFace, and Pydantic are all pushing this pattern. But running AI-generated", "context": "", "use_case": "", "switched_from": "", "story": "Zapcode: A TypeScript interpreter in Rust for AI agents (2\u00b5s start, sandbox)"}, {"id": 754750192, "item_id": 47171887, "url": "https://news.ycombinator.com/item?id=47171887", "by": "westurner", "date": "2026-02-26", "stance": "neutral", "quote": "TIL about Monty.", "excerpt": "TIL about Monty. A number of people have tried to sandbox [python,] using python and user space; but ultimately they've all concluded that you can't sandbox python with python. Virtual Machines are a better workload isolation boundary than Containers are a better workload isolation boundary than bubblewrap and a WASM runtime. eWASM has costed opcodes; https://news.ycombinator.com/item?id=46825763 From \"Show HN: CSL-C", "context": "", "use_case": "", "switched_from": "", "story": "just-bash: Bash for Agents"}, {"id": 754675489, "item_id": 47167218, "url": "https://news.ycombinator.com/item?id=47167218", "by": "IceWreck", "date": "2026-02-26", "stance": "neutral", "quote": "I know pydantic has been experimenting with https://github.com/pydantic/monty (restricted python)", "excerpt": "At this point why not make the agents use a restricted subset of python, typescript or lua or something. Bash has been unchanged for decades but its not a very nice language. I know pydantic has been experimenting with https://github.com/pydantic/monty (restricted python) and I think Cloudflare and co were experimenting with giving typescript to agents.", "context": "", "use_case": "", "switched_from": "", "story": "just-bash: Bash for Agents"}, {"id": 750725377, "item_id": 46920336, "url": "https://news.ycombinator.com/item?id=46920336", "by": "DouweM", "date": "2026-02-06", "stance": "neutral", "quote": "with support for Monty", "excerpt": "(Pydantic AI lead here) We\u2019re 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 \u201ctraditional\u201d 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", "context": "", "use_case": "", "switched_from": "", "story": "Python interpreter written in Rust for use by AI"}, {"id": 750723584, "item_id": 46920224, "url": "https://news.ycombinator.com/item?id=46920224", "by": "JoshPurtell", "date": "2026-02-06", "stance": "recommend", "quote": "", "excerpt": "rlm-rs: https://crates.io/crates/rlm-rs src: https://github.com/synth-laboratories/Horizons", "context": "", "use_case": "", "switched_from": "", "story": "Python interpreter written in Rust for use by AI"}, {"id": 750723440, "item_id": 46920215, "url": "https://news.ycombinator.com/item?id=46920215", "by": "imfing", "date": "2026-02-06", "stance": "recommend", "quote": "The minimal-interpreter approach feels like a good starting point for AI workloads", "excerpt": "This is a really interesting take on the sandboxing problem. This reminds me of an experiment I worked on a while back (https://github.com/imfing/jsrun), which embedded V8 into Python to allow running JavaScript with tightly controlled access to the host environment. Similar in goal to run untrusted code in Python. I\u2019m especially curious about where the Pydantic team wants to take Monty. The minimal-interpreter appro", "context": "", "use_case": "sandboxed Python interpreter", "switched_from": "", "story": "Python interpreter written in Rust for use by AI"}, {"id": 750711152, "item_id": 46919447, "url": "https://news.ycombinator.com/item?id=46919447", "by": "simonw", "date": "2026-02-06", "stance": "recommend", "quote": "I got a WebAssembly build of this working and fired up a web playground for trying it out", "excerpt": "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.html 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-", "context": "", "use_case": "Python interpreter for AI", "switched_from": "", "story": "Python interpreter written in Rust for use by AI"}]}