{"slug": "agent-sandboxes-in-pydantic-logfire", "title": "Agent Sandboxes in Pydantic Logfire", "summary": "Pydantic released Agent Sandboxes in beta inside Logfire, an isolated interpreter for agent-written code built on Pydantic Monty, its open-source Rust interpreter, with no container or VM to boot. Pydantic reported an internal October 2026 benchmark of 5,276 graded runs across five Pydantic AI apps and eight models, self-reported with the harness not yet public, and cited customer results of 80%+ lower LLM costs on daily agentic routines and 10/10 test incidents solved. Pro pricing is $49/mo plus $0.10 per 1,000 invocations, with self-hosted Agent Sandboxes planned for Logfire's Enterprise deployment early next year.", "body_md": "### Pydantic Monty\n\nThe open-source interpreter and Python package\n\n- Controls Controlled host access, resource limits and snapshots\n- Hosting and scaling You run it, wherever you choose\n- Tracing Instrument it yourself\n\nAgent Sandboxes Beta\n\nNot a container or VM. Agent Sandboxes is an isolated interpreter for the code your agent writes, built into Logfire and powered by Pydantic Monty.\n\n298\n\nLast span Nov 12, 00:57\n\n485\n\nEstimated cost $0.05\n\n377\n\n174\n\n33\n\nActivity over time\n\nSessions\n\nWhy Agent Sandboxes\n\nMost code written by an agent is short and calls a few tools. That job needs an isolated interpreter, not a computer. Agent Sandboxes runs it in Pydantic Monty, our lightweight open-source interpreter built with Rust, with nothing to boot, build, or secure, and nothing to manage between runs.\n\nBenchmark report\n\nWe ran 5,276 graded runs: five Pydantic AI apps, eight models, the same tools, with code mode off and on. Every code mode run executed in Monty, the interpreter inside Agent Sandboxes.\n\nInternal Pydantic benchmark, October 2026. Graded deterministically, no LLM judge. Self-reported; harness not yet public.\n\nKey features\n\nAgent code reaches the functions your application hands it and nothing else. No files, network, or secrets unless you grant them, and your tools keep their own access.\n\nEvery run, and every user, gets a fresh session, even while someone is waiting on the answer. There is no machine to boot and nothing to keep warm between runs.\n\nMemory is bounded per session and CPU time per run. A loop that never ends hits its limit and stops, and your application carries on.\n\nSnapshot a session and pick it up later, right where it stopped. The snapshot is the interpreter's own state, so a long workflow survives a deploy or a worker change without starting over.\n\n```\n  ____            _             _   _        __  __             _\n |  _ \\ _   _  __| | __ _ _ __ | |_(_) ___  |  \\/  | ___  _ __ | |_ _   _\n | |_) | | | |/ _` |/ _` | '_ \\| __| |/ __| | |\\/| |/ _ \\| '_ \\| __| | | |\n |  __/| |_| | (_| | (_| | | | | |_| | (__  | |  | | (_) | | | | |_| |_| |\n |_|    \\__, |\\__,_|\\__,_|_| |_|\\__|_|\\___| |_|  |_|\\___/|_| |_|\\__|\\__, |\n        |___/                                                       |___/\n```\n\nLearn more↗\n\nmonty version: 1.0.0↗ \n\nmonty protocol version: 5 \n\nserver version: v1.0.0 (e3282e4) \n\nRun code\n\nRun Python in the Monty sandbox, or use the Python client↗ for more functionality.\n\n[Hack Monty](https://pydantic.dev/hack-monty) invited researchers to escape the engine underneath. The final announced bounty round ran through August 2026.\n\nEvery run shows up in Logfire beside the agent that asked for it, with the tool calls it made and how long each took. Usage lands on your Logfire bill.\n\nRunning agent code is the easy part. Agent Sandboxes handles the rest: isolation, scaling, reliability, and tracing.\n\nSpikes in code runs never slow your agent, and you stop sizing servers for the heaviest script.\n\nAgent code runs on separate infrastructure with only the tools it needs, never next to your keys.\n\nLogfire runs and scales the workers, so your team spends its time on agents, not sandbox upkeep.\n\nNeed more? Pro is $49/mo plus $0.10 per 1,000 invocations, and Growth includes it. For higher volumes or custom limits, we price Advanced with you.\n\nCustomer stories\n\n80%+ Lower LLM costs on daily agentic routines\n\n10/10 Test incidents solved, including two that direct tool calling failed\n\nMonty vs Agent Sandboxes\n\nPydantic Monty is the open-source interpreter. Agent Sandboxes is that interpreter hosted, scaled, and traced inside Logfire.\n\nHosted sandboxes built into Logfire, powered by Monty\n\nNeed it on your own hardware? Start with Monty. Self-hosted Agent Sandboxes is planned for Logfire’s Enterprise deployment early next year: [talk to us about self-hosting](https://pydantic.dev/contact).\n\nNo. It isn’t a container or a VM. Agent Sandboxes is an isolated interpreter for the code your agent writes, powered by Pydantic Monty, so there’s no machine to boot and nothing to keep warm between runs.\n\nWhen the job needs a full computer. Coding agents that run build tools, install packages, or walk a real filesystem need a container or VM sandbox: Agent Sandboxes runs a Python subset with host callbacks and has no operating system underneath. Reinforcement learning environments that need a whole computer per episode belong on a VM-backed sandbox, where the environment is the product. And you don’t deploy applications into it: the sandbox holds the agent’s code while your application keeps running wherever it runs today. Running model-written code in your own process with exec or subprocess is fast, but the code can do anything your application can. Agent Sandboxes keeps that speed and adds the limits.\n\nYes. Agent code can only call the functions your application hands it. Those functions run in your application, so they keep their own network, library and secret access. The agent’s code gets none of that unless you grant it.\n\nPydantic Monty is our open-source interpreter, built with Rust. Agent Sandboxes runs Monty for you inside Logfire: Logfire runs and scales the workers, bounds the memory of every session and the CPU time of every run, snapshots sessions so they can pause and resume, and traces every run next to your agent.\n\nPython. Monty is a sandboxed Python interpreter, so your agent writes Python and calls your tools as ordinary functions. It covers what agents reach for: async functions, comprehensions, dataclasses, `match`, and standard modules such as `asyncio`, `json`, `re` and `datetime`. Third-party packages can’t be installed. [Monty’s limitations](https://pydantic.dev/docs/monty/limitations/) lists the rest.\n\nOnly the functions you expose. No files, network, environment variables or secrets unless you grant them. Each run gets 50 ms of CPU and each session 20 MiB of memory, so runaway code is stopped and your application keeps running.\n\nYes. On Free and Pro, you can start up to 300 sessions every 5 minutes. Concurrent sessions follow your Logfire plan: 4 on Personal, with no limit on Team, Growth and Enterprise. On Advanced, they’re set around your workload. They’re separate from your monthly allowance: the 50,000 free invocations a month set how much you get, and these set how fast you can use them.\n\nYes. Pass `CodeMode(monty_sandbox=logfire.agent_sandboxes)` to your agent, with pydantic-ai-harness 0.67.0 or later, and the code it writes runs in Agent Sandboxes. In our benchmark, five Pydantic AI apps ran with code mode on, and every code mode run executed in Monty, the interpreter inside Agent Sandboxes.\n\nNot yet. Agent Sandboxes is part of Logfire and runs in Logfire Cloud. Self-hosting is planned as part of Logfire’s self-hosted Enterprise deployment, early next year.\n\nEvery Logfire plan includes 50,000 free invocations a month. Pro is $49 a month plus $0.10 per 1,000 invocations, with fixed limits of 50 ms of CPU per invocation and 20 MiB of memory per session, and it’s included with Growth and Enterprise Cloud. Advanced is for higher volumes or workloads that need more than those limits: we set its limits and price with you. [See Agent Sandboxes pricing](https://pydantic.dev/pricing#addons).\n\nSign up today and see your first trace in under 2 minutes\n\n01 Install\n\n``` bash\n$ uv add logfire\n\nResolved 7 packages in 128ms\nInstalled 7 packages in 89ms\n+ logfire\n```\n\n02 Instrument\n\n``` python\nimport logfire\n\nlogfire.configure()\nlogfire.info('Hello {name}', name='world')\n```\n\nFree up to 10m records per month No credit card needed", "url": "https://wpnews.pro/news/agent-sandboxes-in-pydantic-logfire", "canonical_source": "https://pydantic.dev/logfire/agent-sandboxes", "published_at": "2026-11-12 18:31:40+00:00", "updated_at": "2026-11-12 18:52:03.227718+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-infrastructure", "mlops"], "entities": ["Pydantic", "Logfire", "Pydantic Monty", "Pydantic AI", "Agent Sandboxes"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/agent-sandboxes-in-pydantic-logfire", "markdown": "https://wpnews.pro/news/agent-sandboxes-in-pydantic-logfire.md", "text": "https://wpnews.pro/news/agent-sandboxes-in-pydantic-logfire.txt", "jsonld": "https://wpnews.pro/news/agent-sandboxes-in-pydantic-logfire.jsonld"}}