Managing Sandboxes

View sandbox details, change a display name, extend a running sandbox, and stop or delete a sandbox.

Viewing Sandboxes in the Console

  1. Open Generative AI, select Projects, and select your project.
  2. Select the Sandbox tab to view enablement, networking settings, and the sandbox list. You can also use Sandboxes in the Projects navigation.
  3. Select a sandbox name to open its details.

The details include its shape, sandbox ID, project ID, runtime, state, timestamps, and published ports. The page also shows expiration and runtime information. Use the Monitoring tab for resource and command metrics.

A sandbox ID identifies one execution workspace. It's distinct from the project OCID. See Monitoring Sandboxes.

Preparing CLI Variables

The following commands use OCI session authentication:

profile_name="DEFAULT"
region="us-chicago-1"
sandbox_id="SANDBOX_ID"

List sandboxes in a project:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox list \
  --project-id "PROJECT_OCID"

Get one sandbox:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox get \
  --sandbox-id "$sandbox_id"

Updating the Display Name

Change the display name with the update command:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox update \
  --sandbox-id "$sandbox_id" \
  --display-name my-sandbox-updated

Extending a Running Sandbox

Before the sandbox expires, open its details page and select Actions, then Extend. Use the available duration controls to add time. The action can be unavailable for a stopped sandbox.

To add 30 minutes with the CLI:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox extend \
  --sandbox-id "$sandbox_id" \
  --additional-duration PT30M

Check the returned expiration time. Extending the sandbox doesn't change the timeout of commands already running. See Sandbox Runtimes and Resource Limits.

Stopping a Sandbox

Download required output files or create a snapshot before stopping the sandbox. In its details page, select Actions, then Stop, and complete the confirmation.

To request a stop with the CLI:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox stop \
  --sandbox-id "$sandbox_id" \
  --is-force false

Check the sandbox until it reaches STOPPED. Stopping ends execution without deleting the sandbox record. To continue from saved files, create a new sandbox from a snapshot and start the required processes again.

Deleting a Sandbox

When the sandbox is no longer needed, select Delete on its details page and complete the confirmation. Download required files or save a snapshot first.

With the CLI:

oci --profile "$profile_name" --auth security_token --region "$region" \
  generative-ai-sandbox sandbox delete \
  --sandbox-id "$sandbox_id"

Review and confirm the CLI deletion prompt.