Monty
pydantic.dev
Secure Python sandbox written in Rust for running LLM-generated code without container startup cost.
- GitHub stars
- 8,992
- License
- MIT
- Language
- Rust
- Pricing
- Open source
- Published
- Nov 6, 2026
Next steps
- Tokenome
Both tools are listed under AI Security and AI Code Assistant.
- Octomind
Both tools are listed under AI Code Assistant, Open Source, and rust.
- RTK (Rust Token Killer)
Both tools are listed under AI Code Assistant, AI Developer Tools, and rust.
- CodeGraph
- Agent Skills (Addy Osmani)
- Pi
What it does
Monty from Pydantic is a secure Python sandbox written in Rust for code produced by AI. OSS Monty is MIT-licensed and installs as a package targeting Python 3.14; Full Monty is the commercial gRPC server. A new sandbox from a running pool starts in under 1 ms (about 2 ms for Full Monty), versus roughly 1500 ms for typical container sandbox services. Inside the sandbox there is no filesystem, environment or network except what you explicitly mount or expose. Docs: pydantic.dev/docs/monty/.

Use cases
- Run LLM-generated Python tools with sub-millisecond sandbox spin-up
- Replace a slow container sandbox in an agent tool loop
- Expose only selected host functions to untrusted model code
Frequently asked questions
- Is Monty open source?
- Yes. OSS Monty is MIT-licensed; Full Monty is the commercial server product.
- Why not use containers?
- The docs compare ~1 ms pool startup to about 1500 ms for typical sandbox services.
- What can code inside Monty access?
- Only functions and mounts you pass in; no default filesystem, env vars or network.
- Who maintains it?
- Pydantic, with docs at pydantic.dev/docs/monty/.