What You’ll Learn
- Creating two sandboxes side by side
- Writing a file in Sandbox A with
sbx.files.write() - Confirming the file does NOT exist in Sandbox B with
sbx.files.exists() - Reading file content with
sbx.files.read()to verify contents - Writing a file in B and verifying A cannot see it (bidirectional isolation)
- Proper cleanup of multiple sandboxes with
try/finally
Prerequisites
This example is available in Python. TypeScript version coming soon.
Code Walkthrough
Create two sandboxes and keep references to both:finally: