Monty is a minimal Python interpreter written in Rust that runs AI-generated code in a restricted environment without direct filesystem, environment-variable, or network access. It is for AI agents that need to execute Python and type-checking tasks while allowing developers to control which host functions and objects the code can use, and the catalogue entries integrate it into agent workflows.
Getting it into your agent
There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.
Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/pydantic/monty/claude-md)<a href="https://agentmods.dev/instructions/pydantic/monty/claude-md"><img src="https://agentmods.dev/badge/instructions/pydantic/monty/claude-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.15195 | $0.15195 |
| Opus 5 | $0.07598 | $0.07598 |
| Sonnet 5 | $0.03039 | $0.03039 |
| Haiku 4.5 | $0.01520 | $0.01520 |
Grade A, and why
monty CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- subprocess/shell execution - os.system, subprocess, etc. How it starts
The opening of the file, as written. The whole thing — 1,109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
DON'T COMMIT UNLESS EXPLICITLY ASKED TO DO SO BY THE USER! Previous commit requests do not matter - don't commit unless you've just been explicitly asked to do so.
Project Overview
Monty is a sandboxed Python interpreter written in Rust. It parses Python code using Ruff's ruff_python_parser but implements its own runtime execution model for safety and performance. This is a work-in-progress project that currently supports a subset of Python features.
Project goals:
- Safety: Execute untrusted Python code safely without FFI or C dependencies, instead sandbox will call back to host to run foreign/external functions.
- Performance: Fast execution through compile-time optimizations and efficient memory layout
- Simplicity: Clean, understandable implementation focused on a Python subset
- Snapshotting and iteration: Plan is to allow code to be iteratively executed and snapshotted at each function call
- Cross-platform: Runs on Linux, macOS, and Windows (and any other OS that can run Rust)
- Targets the latest stable version of Python, currently Python 3.14
monty-types — shared boundary types
The public data types (MontyObject, MontyException/ExcType, OsFunctionCall +
its arg structs, ResourceLimits/ResourceTracker, PrintStream/PrintWriter,
CompileOptions, ExtFunctionResult, FileMode, ...) live in crates/monty-types,
which depends on no other monty crate except the monty-macros derives. monty
depends on monty-types but does not blanket re-export it — only a few types
are re-exported inline where they appear in monty's public API (e.g.
run::CompileOptions, run_progress::{ExtFunctionResult, NameLookupResult}).
Code needing MontyObject, MontyException, OsFunctionCall, etc. must
depend on monty-types directly.
Host-side crates (monty-fs, monty-pool, monty-proto without its worker
feature, monty-python, monty-js) MUST depend on monty-types, NOT monty —
this keeps the interpreter out of their binaries. Only the worker side
(monty-runtime, monty-wasm-runtime, monty-proto with worker) links the
interpreter. Don't add a monty dependency to a host-side crate; if it needs a
type, that type belongs in monty-types.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · +52 lines · +1,097 tokens per session 359fce74b26f
- 2d ago Changed · +6 lines · +138 tokens per session 94698cee12d3
- 6d ago First seen · 1,051 lines · 13,960 tokens per session scan A 006b310124af
monty CLAUDE.md is an instructions file published in the GitHub repository pydantic/monty (8,162 stars, last pushed yesterday), licensed MIT. It adds 15,195 tokens to every session, about $0.0760 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
Symbiont AGENTS.md
AGENTS.md instructions for ThirdKeyAI/Symbiont, covering symbiont — agent instructions, project structure, build and test, code style and commit guidelines.
rez-next AGENTS.md
AGENTS.md instructions for loonghao/rez-next, covering rez-next - ai agent guide, project overview, quick start, drop-in replacement for most use cases and supported top-level api.
NexusTrader CLAUDE.md
Instructions for Quantweb3-com/NexusTrader, covering claude.md, project overview, development commands, dependencies and setup and install with uv (package manager used in this project).
epistemic-graph AGENTS.md
Instructions for Knuckles-Team/epistemic-graph, covering agents.md — epistemic graph compute engine, epistemic os surfaces in the main build, commands for ai agents, python api (out-of-process client — not in-process) and async.
depyler GEMINI.md
Instructions for paiml/depyler, covering depyler: python to rust transpiler, critical: contract-first design, project overview, key features and getting started.
h5i AGENTS.md
AGENTS.md instructions for h5i-dev/h5i, a project described as: Secure, auditable browser for AI agents. Pure Rust, no Chromium or V8. 3× faster and 86% less peak memory than headless Chromium.