[HN Gopher] Monty: A minimal, secure Python interpreter written ...
___________________________________________________________________
Monty: A minimal, secure Python interpreter written in Rust for use
by AI
Author : dmpetrov
Score : 8 points
Date : 2026-02-06 21:16 UTC (1 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| zahlman wrote:
| > Instead, it let's you run safely run Python code written by an
| LLM embedded in your agent, with startup times measured in single
| digit microseconds not hundreds of milliseconds.
|
| Perhaps if the interpreter is in turn embedded in the executable
| and runs in-process, but even a do-nothing `uv` invocation takes
| ~10ms on my system.
|
| I like the idea of a minimal implementation like this, though. I
| hadn't even considered it from an AI sandboxing perspective; I
| just liked the idea of a stdlib-less alternative upon which
| better-thought-out "core" libraries could be stacked, with less
| disk footprint.
|
| Have to say I didn't expect it to come out of Pydantic.
| kodablah wrote:
| I'm of the mind that it will be better to construct more
| strict/structured languages for AI use than to reuse existing
| ones.
|
| My reasoning is 1) AIs can comprehend specs easily, especially if
| simple, 2) it is only valuable to "meet developers where they
| are" if really needing the developers' history/experience which
| I'd argue LLMs don't need as much (or only need because lang is
| so flexible/loose), and 3) human languages were developed to
| provide extreme human subjectivity which is way too much wiggle-
| room/flexibility (and is why people have to keep writing projects
| like these to reduce it).
|
| We should be writing languages that are super-strict by default
| (e.g. down to the literal ordering/alphabetizing of constructs,
| exact spacing expectations) and only having opt-in loose modes
| for humans and tooling to format. I admit I am toying w/ such a
| lang myself, but in general we can ask more of AI code
| generations than we can of ourselves.
| dmpetrov wrote:
| I like the idea a lot but it's still unclear from the docs what
| the hard security boundary is once you start calling LLMs - can
| it avoid "breaking out" into the host env in practice?
___________________________________________________________________
(page generated 2026-02-06 23:00 UTC)