Skip to content
Dashboard

Vercel Sandbox Python SDK 1.0 is now available

Software Engineer

The Vercel Sandbox Python SDK has reached 1.0, stabilizing its public API and bringing feature parity with the TypeScript SDK. Use it to run AI-generated code, test changes, and analyze datasets in isolated sandboxes from your Python application.

The SDK includes context managers for automatic sandbox cleanup and AnyIO-based async support for asyncio and Trio. For synchronous code, use vercel.sandbox.sync.

Install with uv add 'vercel-sandbox>=1.0' and configure authentication.

main.py
import asyncio
from vercel import sandbox
from vercel.sandbox import GitSource
async def main():
async with sandbox.create_sandbox(
source=GitSource(
url="https://github.com/your-org/your-repo.git",
revision="your-pr-branch",
)
) as box:
await box.run_command(
"uv",
["run", "pytest", "-q"],
check=True,
)
asyncio.run(main())

Run tests from a Git branch, then automatically clean up the sandbox.

If you’re upgrading from 0.x, review the 1.0 release notes for breaking changes, including the switch to bytes for command input and output.

Learn more in the Python SDK documentation.