Runtime sandboxes as a Pydantic AI toolset: shell, files and listings in a Firecracker microVM
pip install pydantic-ai-withruntime Copy PIP instructions
pip install pydantic-ai pydantic-ai-withruntime # pydantic-ai brings the model providers npx withruntime login # or set RUNTIME_API_KEY from pydantic_ai import Agent from pydantic_ai_withruntime import RuntimeToolset agent = Agent("anthropic:claude-sonnet-4-6", toolsets=[RuntimeToolset()]) print(agent.run_sync("Fit a line to (1,2), (2,4.1), (3,6.2) with numpy and give the slope.").output) The model sees four tools:
Relative paths are under /workspace. Output past 20,000 characters is cut from the front, keeping the end, where errors are.
tests/ runs the toolset under Pydantic AI's own agent loop, with a scripted FunctionModel and a fake client; uv run --resolution lowest-direct --group test pytest runs them at the lowest versions pyproject.toml allows. scripts/e2e.py runs the agent loop against the real API with RUNTIME_API_KEY set. It passed on 25 September 2026 with Pydantic AI 2.50.0: two runs, each in its own sandbox, both stopped.
All 2 files in this release have provenance metadata.
ai agents code execution firecracker microvm pydantic pydantic ai pydantic-ai runtime sandbox toolset
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




