Skip to main content
Prepare files with networking enabled, then verify them in a new operation with networking disabled. InstanceNetworking(enabled=False) starts the verification VM without a guest network interface. Choose the setting for each operation.

Prerequisites

Complete Set up access. In a fresh project, run uv init --python 3.12 and uv add "contree-sdk[async]==0.5.1" "contree-client==0.6.0". The SDK reads the connection from your environment or saved profile; credentials stay in the local client and are not passed to guest code. The example uses the available tag:alpine:latest image. Preparation retains /fixture/expected.txt; the second operation uses that checkpoint and is disposable. The check confirms both the file contents and the absence of network interfaces other than loopback. It does not depend on contacting an external host. ContreeAsyncSession starts a separate VM for each command.

Complete source

Save as verify_no_network.py and run uv run python verify_no_network.py. The output includes a checkpoint UUID followed by fixture-ok network-disabled. Saving the preparation image carries files into the next operation; it does not carry the network setting. Disabling networking applies to the whole operation, including subprocesses. The preparation checkpoint follows image retention; disposable verification creates no result image. A missing fixture or unexpected guest interface fails verification. An SDK exception can indicate platform failure, cancellation, or a wait timeout. If transport or cancellation leaves the outcome uncertain, inspect the existing operation before resubmitting. The 30-second execution limit bounds each guest command even if the client disappears. Use spawn() when an application needs to record an operation UUID before waiting. See Configure networking and secrets.