Compute Engine agent testing

Compute Engine local testing for AI agents

Use LocalCloud when an agent needs to create, exercise, and reset Compute Engine resources without touching a real Google Cloud project. The same SDK shape points at localhost through COMPUTE_EMULATOR_HOST=http://localhost:24080.

Fact

Endpoint: COMPUTE_EMULATOR_HOST=http://localhost:24080.

Fact

Endpoints: HTTP/REST :24080.

Fact

Evidence state: partial; Local development coverage is partial. Known limits: [prod_only] Persistent disks and live migration (hypervisor-level storage/VM management)., Snapshots, instance templates, and VPC networking are not yet emulated..

Fact

Registry default: off; assembled default: off (verified); minimum tier: pro.

Fact

Persistence: metadata (verified). Audited metadata survives restart while the LocalCloud volume is retained

Agent quickstart

Route the SDK before writing code

Start LocalCloud, export COMPUTE_EMULATOR_HOST=http://localhost:24080, and make the agent perform one Compute Engine operation before changing application logic. That catches accidental production routing early.

Validation example

Prefer one representative behavior over broad smoke tests

A useful agent check creates local Compute Engine state, reads it back with the project SDK, and records which feature was covered. It should not require a GCP account, service-account key, or billing project.

State setup

Use only documented setup paths

Create deterministic state through a contract-documented seed registrar or through an operation listed on this page. Do not assume every service supports seed data, reset, or persistent state.

Copy-ready setup

Commands and prompts

Use these snippets as starting points, then keep the checks scoped to localhost until you intentionally validate against real Google Cloud.

Environment
eval "$(localcloud env)"
# Verify that the generated environment includes COMPUTE_EMULATOR_HOST; do not replace a CLI-remapped value with a hard-coded port.
Compatibility

Local check versus release validation

AreaLocalCloud local checkReal GCP still needed for
SDK routingCOMPUTE_EMULATOR_HOST=http://localhost:24080 points clients at localhost.Production endpoint, auth, IAM, quota, and regional behavior.
Supported featuresinstances.create/get/list/start/stop/delete (partial) — Docker-backed instance approximation exists when container runtime is available.[prod_only] Persistent disks and live migration (hypervisor-level storage/VM management).; Snapshots, instance templates, and VPC networking are not yet emulated.; disks, snapshots, templates, networking: unsupported
Agent safetyNo default cloud account, credentials, or billing project required.Final release validation in the target GCP project.
Limitations

Use the sandbox deliberately

  • Permitted workflows use local endpoint values and should stop rather than fall back to real Google Cloud or real credentials. The Public Preview License permits individuals and organizations, including for-profit companies, to use LocalCloud for non-production internal development, testing, CI, evaluation, and pilots.
  • LocalCloud emulates bounded local development workflows. Validate application behavior against real Google Cloud before production deployment.
  • Before production deployment, unset LocalCloud emulator environment variables and validate behavior against real Google Cloud.
  • Local development coverage is partial. Known limits: [prod_only] Persistent disks and live migration (hypervisor-level storage/VM management)., Snapshots, instance templates, and VPC networking are not yet emulated..
Next routes

Keep the agent on the supported path

Sources and review

Claims are tied to current sources