We added one SDK operation for this:
Python: Sandbox.get_or_create()
TypeScript: Sandbox.getOrCreate()
Pass it a stable name, such as an agent session ID. It returns a running sandbox by connecting to the existing one, resuming it when suspended, or creating it when it does not
One thing I noticed after building several sandbox integrations:
The harness/application still ends up managing parts of the sandbox lifecycle and the session-to-sandbox binding: reconnecting, resuming, handling restarts, and tracking which sandbox belongs to which session.
For




