This release is a pre-release and may not be stable for production use.
snowflake-sandbox-python
Python SDK and CLI for Snowflake sandboxes running on Snowflake's container substrate.
Spin up gVisor-isolated Linux containers from Python: parallel fan-out, streaming exec, stage I/O, fire-and-forget async jobs, and keep-alive sessions.
Status: alpha. The public surface is feature-flagged behind the
SANDBOX_PUBLIC_API_ENABLEDaccount parameter (default off). APIs may change in0.xminors until the first GA cut.
Install
pip install snowflake-sandbox-python # core SDK
pip install 'snowflake-sandbox-python[cli]' # + the `snow sandbox` CLI plugin
snow plugin enable snow-sandbox # required once before `snow sandbox` works
Python 3.11+. snowflake-connector-python is a core dependency, so
password / OAuth / PAT connections work out of the box.
Preview release, gated on the Snowflake side. The SDK is published as PEP 440 pre-releases on two tracks:
.devN(e.g.0.2.1.dev9) on Snowflake's internal index only, andaN/bN/rcN(e.g.0.2.1a1) on public PyPI. Either way a plainpip installresolves to the latest pre-release automatically — no--preflag needed. It talks to a preview API behind theSANDBOX_PUBLIC_API_ENABLEDaccount parameter, which Snowflake enables selectively for specific customers during the preview. You can install and import the SDK on any account, butSandbox.create()calls succeed only once the preview is enabled for your account — contact your Snowflake account team about availability. General availability comes with the first stable (non-pre-release) version.
Hello, sandbox
from snowflake.sandbox import Sandbox
# Prerequisite: a configured Snowflake connection — a ~/.snowflake default
# (snow CLI), SNOWFLAKE_ACCOUNT + SNOWFLAKE_TOKEN env vars, or connection=.
# Without one, Sandbox.create() raises "snowflake.sandbox has no endpoint to talk to". (See below.)
with Sandbox.create() as sb:
result = sb.exec(["python", "-c", "print(40 + 2)"])
print(result.stdout) # "42\n"
Sandbox is blocking. AsyncSandbox is the coroutine twin — same verbs,
awaited — for driving many sandboxes concurrently:
import asyncio
from snowflake.sandbox import AsyncSandbox
async def main() -> None:
async with await AsyncSandbox.create() as sb:
result = await sb.exec(["python", "-c", "print(40 + 2)"])
print(result.stdout)
asyncio.run(main())
Auth via SNOWFLAKE_ACCOUNT + SNOWFLAKE_TOKEN env vars, a named connection in
~/.snowflake/connections.toml / config.toml (resolved by
snowflake-connector-python), or connection=Config(account=..., pat=...) on the call.
With none of those the SDK raises "snowflake.sandbox has no endpoint to talk to: ...",
which names every way to supply one.
CLI
Installs as a snow sandbox plugin:
snow plugin enable snow-sandbox
snow sandbox run --app ./my-agent/agent_app.py # point at the module file
snow sandbox get <sandbox> --wait 600
Project layout
src/snowflake/sandbox/ # SDK — sandboxes, jobs, sessions
cli_sandbox/ # snow sandbox CLI plugin
examples/sandbox/ # Runnable examples
tests/
docs/ # Source for the docs site
Building the docs locally
uv run --extra docs mkdocs serve # live preview at http://127.0.0.1:8000
uv run --extra docs mkdocs build --strict
Contributing
See CONTRIBUTING.md in the source repository for dev setup, how to add new
methods, exceptions, and CLI commands.
Release files for snowflake-sandbox-python 0.2.1a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snowflake_sandbox_python-0.2.1a1.tar.gz | 363.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snowflake_sandbox_python-0.2.1a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 761.9 kB
Release files / snowflake_sandbox_python-0.2.1a1.tar.gz
| Download URL | snowflake_sandbox_python-0.2.1a1.tar.gz |
|---|---|
| Size | 363.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52b0e4170e8ef4549ed32a32760b6ecb606fb84c339a863abe981c90ace58f5c
|
|
BLAKE2b-256 checksum How to use checksums |
710c6fefa947bba83f54ac50429f8ae1483153edb67f15eaca3f86b2230d7b52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.3
|
Release files / snowflake_sandbox_python-0.2.1a1-py3-none-any.whl
| Download URL | snowflake_sandbox_python-0.2.1a1-py3-none-any.whl |
|---|---|
| Size | 398.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
245eb55879fbb9a4005349947a4b4faefa8e86638ad31f4b34affc619495d115
|
|
BLAKE2b-256 checksum How to use checksums |
82a716e7d457113c8f2a87d4e3683dd304fd67860b133bd887be4b0e27b68d66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.3
|