# pydantic/monty

A minimal, secure Python interpreter written in Rust for use by AI

Repository: https://github.com/pydantic/monty
Canonical: https://ross.abutalabs.com/products/monty
Language: Rust
License: MIT
License Family: permissive
Last push: 2026-08-26T19:44:01+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 96, longevity 85
- inputs: {"age_days": 1193, "days_push": 7, "days_rel": 24, "gap_med": 3.0, "n_releases_24m": 21}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8113, forks 410 (observed 2026-08-28T04:10:13.116161+00:00)

## What it is
Monty is a minimal, secure Python interpreter written in Rust designed for safely executing LLM-generated code without container-based sandboxes. It blocks host access by default, supports snapshotting interpreter state, and can be called from Rust, Python, or JavaScript with sub-microsecond startup.

## Use cases
- safely run python code generated by an llm
- sandbox untrusted python code without docker containers
- embed a python interpreter in a rust application
- pause and resume python execution from a snapshot
- typecheck llm-written python code
- give ai agents controlled access to host functions

## When to choose
- you need to execute LLM-generated Python with minimal latency and no container overhead
- you want strict control over filesystem, network, and environment access from executed code
- you need to snapshot and resume interpreter state across requests or processes

## When to avoid
- you need full CPython compatibility or arbitrary third-party Python packages
- you need a production-grade, stable interpreter for general-purpose Python workloads
- your code depends on C extensions or native modules

## Facets
- artifact type: library
- maturity: experimental
- function: interpreter, security, llm-inference, agent-framework, sdk
- domain: programming-languages, artificial-intelligence, security, developer-tools
- platform: rust, python, cross-platform
- tags: sandboxed-python, llm-code-execution, microsecond-startup, snapshotable, embedded-interpreter, no-container-sandbox, sandbox, interpreters, ai-agents, nodejs

## Member repositories
- pydantic/monty (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:13.116161+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:30:41.235706+00:00, confidence not recorded.
  - readme: https://github.com/pydantic/monty (fetched 2026-08-28T04:10:13.116161+00:00, sha 4fed534526ac)
  - registry_crates: https://crates.io/api/v1/crates/monty (fetched 2026-08-29T08:28:39.899687+00:00, sha 9e28c45c2287)
- Data as of 2026-08-30T08:39:29.467469+00:00.
