Vercel Sandbox Python SDK 1.0 正式推出,能在隔離環境執行程式碼
Vercel Sandbox Python SDK 1.0 is now available
用 Python 執行 AI 產生的程式、測試修改或分析資料時,若想避免程式直接影響其他工作,就需要隔離的執行環境。
- Vercel Sandbox Python SDK 1.0 已穩定公開介面,功能也追上 TypeScript SDK。
- 它能在隔離的沙盒裡執行工作,並在工作結束後自動清理環境。例如,可以從 Git 分支建立沙盒、執行測試,完成後自動清理。從 0.x 升級的人要留意,指令輸入和輸出已改用 bytes。
AI 伴隨問答
針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:
# Vercel Sandbox Python SDK 1.0 is now available - Vercel
Skip to content
[](https://vercel.com/home)
Copy Wordmark Copy Logo
Download Brand Assets Brand Guidelines
Products
Agent Stack
Core Platform
Tools
Resources
Learn
Build
Explore
Ask AIDashboard
- * *
Products
Agent Stack
Core Platform
Tools
Resources
Learn
Build
Explore
Vercel Sandbox Python SDK 1.0 is now available

Scott TrinhSoftware Engineer
16 Nov 2026
1 min read
Copy
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
1import asyncio2
3from vercel import sandbox4from vercel.sandbox import GitSource5
6async def main():7 async with sandbox.create_sandbox(8 source=GitSource(9 url="https://github.com/your-org/your-repo.git",10 revision="your-pr-branch",11 )12 ) as box:13 await box.run_command(14 "uv",15 ["run", "pytest", "-q"],16 check=True,17 )18
19asyncio.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.
Agent Stack
Core Platform
Security
Tools
Frameworks
SDKs
Build
Learn
Explore
Company
Legal & Trust
- Privacy Policy
- Terms of Service
- Cookie Policy
- DPA
- Acceptable Use Policy
- Legal (all documents)
- Trust Center
- Status
- Cookie Preferences
Social
Select a display theme:system light dark