Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt

Use this file to discover all available pages before exploring further.

Context managers handle cleanup automatically:
with Sandbox.run() as sandbox:
    sandbox.exec(["echo", "hello"]).result()
# Stopped automatically
For sandboxes created without a context manager, call .stop() explicitly:
sandbox = Sandbox.run()
sandbox.exec(["echo", "hello"]).result()
sandbox.stop().result()
The SDK also registers global cleanup handlers for atexit and signals (Ctrl+C, SIGTERM), so sandboxes are stopped even on unexpected exits. For batch cleanup, tagging strategies, and orphan recovery, see the Cleanup patterns guide.
Last modified on May 1, 2026