⚡️Monty: the ultrafast Python interpreter by Agents for Agents — Samuel Colvin, Pydantic
Mar 14, 2026 · 34:02
Samuel Colvin joins Shawn Wang to introduce Monty, Pydantic's ultrafast Python interpreter built with AI for agents, positioning it as a lightweight, secure alternative to sandboxes for code execution. Monty runs inside the same process, achieving sub-microsecond latency (800 nanoseconds in a hot loop), versus over a second for cloud sandboxes. Colvin explains the inspiration came from conversations at Anthropic about type safety's critical role in AI tool calling, and how Monty fills the gap between simple tool calling and full sandboxes. Monty is not full CPython—it lacks third-party library support and some standard library modules—but covers essential built-ins, implemented largely by LLMs that Colvin calls 100x faster for tasks where internal and external APIs are well-known, unit tests are trivial, and there's no API bikeshedding. He demonstrates a Pydantic AI agent using Monty to scrape LLM pricing from websites, with type checking built into the runtime so only permitted host functions (e.g., Playwright, Beautiful Soup wrappers) can be called. Colvin also shares his workflow using Claude Code, Codex, and Gemini CLI in combination for code review and implementation, and…