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 .
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 .…