Monty
A Python interpreter written in Rust by the Pydantic team, built to run code an AI writes without lending it your machine. By default the code reaches neither files, network nor environment variables: it gets to your system only through the functions and mounts you pass in. A paused interpreter serialises to bytes and resumes later. It powers the code mode of Pydantic AI, ships as Python, JavaScript and Rust packages, and is MIT licensed.
Strengths
- Closed by default: no files, network or environment variables unless you explicitly provide a function
- 5 milliseconds to create a sandbox and run ten commands in it according to its authors, against 900 for Docker
- A paused interpreter saves to bytes and resumes later
Limitations
- Runs only a documented subset of Python, so check that it covers what your agent writes
- Not at version 1 yet, so its interface may still move
Best for
- An agent that computes or reshapes data by calling a few functions of your application