跳到正文
Vercel Blog(vercel.com)· Scott Trinh·· 7 天前品質評分50

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 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 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

EnterprisePricing

Get a DemoLog InSign Up

Ask AIDashboard

Image 1

  • * *

Products

Agent Stack

Core Platform

Tools

Resources

Learn

Build

Explore

Enterprise

Pricing

Get a Demo

Log InSign Up

Vercel Sandbox Python SDK 1.0 is now available

Image 2

Scott TrinhSoftware Engineer

BlogChangelog

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

Social

  • Image 3: VercelImage 4: Vercel

Loading status…

Select a display theme:system light dark

來源: Vercel Blog (vercel.com)
開啟原文

讀者討論

理性交流 · 即時討論