Enterprise ITSunday, July 19, 2026· Fresh today

Google Cloud Run Sandboxes: Free AI Code Execution Isolation

Google Cloud Run Sandboxes, now in public preview since July 10, 2026, allow developers to safely execute AI-generated code within existing Cloud Run services at no additional infrastructure cost.

Written by the Technology Tutor editorial pipeline from 1 primary source. How we source →

Google Cloud has introduced Cloud Run Sandboxes into public preview as of July 10, 2026, offering a new way to integrate isolated code execution directly into existing Cloud Run services. This development aims to simplify the process of running AI-generated code safely, addressing a common challenge for AI application teams. Source

Previously, setting up secure environments for code execution, especially for Large Language Model (LLM)-generated code, involved complex setups like E2B or Firecracker MicroVMs. Cloud Run Sandboxes eliminate this complexity by allowing in-service isolation.

What Cloud Run Sandboxes Offer

The core functionality of Cloud Run Sandboxes is to run isolated processes inside your existing Cloud Run instances. By adding a simple flag (--sandbox-launcher) at deployment, a lightweight sandbox binary is added to your execution environment. Your application can then use a sandbox do command to spawn an isolated process, execute commands, collect output, and then self-destruct. All this happens within the resources you're already allocating and paying for in Cloud Run.

Performance is a key highlight, with Google's benchmarks showing an average latency of 500ms for 1,000 sequential sandboxes. Cold starts are reportedly in milliseconds, ensuring that executing AI-generated snippets or commands doesn't create user experience delays.

Built-in Security Measures

The primary benefit for businesses is the robust security architecture. Cloud Run Sandboxes implement three default-deny isolation boundaries:

Credential Isolation

Sandboxes cannot access the host service's environment variables or the Google Cloud metadata server. This means IAM roles, API keys, and other sensitive information associated with your service are not visible to code running within the sandbox.

Network Isolation

By default, sandboxes have no outbound network access. This prevents AI-generated code from attempts to call external services or exfiltrate data. Egress requires an explicit --allow-egress flag per invocation.

Filesystem Isolation

The sandbox accesses the container's filesystem in a read-only mode. Any writes are directed to an ephemeral in-memory layer that disappears when the sandbox terminates, preventing the host environment from being modified.

These security boundaries offer a more secure alternative to simply running subprocesses, combining convenience with effective isolation for untrusted code.

How to Implement

Enabling sandbox support is straightforward during deployment using the gcloud beta run deploy command with the --sandbox-launcher flag. Once enabled, applications can call the sandbox using typical shell commands, creating a safe execution environment for arbitrary code.

For those already using Google's Agent Development Kit (ADK), a CloudRunSandboxCodeExecutor integration is available, simplifying adoption. Detailed documentation is provided on Google's Cloud Run code execution documentation. Source

Cost Efficiency

A significant advantage of Cloud Run Sandboxes is that there is no additional cost beyond your existing Cloud Run expenses. There are no per-sandbox fees, session-time billing, or separate managed service subscriptions. Sandboxes utilize the CPU and memory from your instance's current allocation, meaning you only need to size your instances appropriately for concurrent sandboxes.

This contrasts with alternatives like paid plans from E2B or separate billing for AWS Lambda MicroVMs, making it a cost-effective solution for many AI application teams.

Understanding the Tradeoffs

While highly beneficial, it's important to note the isolation level. Cloud Run Sandboxes provide process-level isolation. For scenarios involving highly adversarial code or extremely sensitive data that demand the strongest guarantees, kernel-level isolation (like Firecracker MicroVMs offered by AWS Lambda MicroVMs) might be more appropriate. AWS Lambda MicroVMs also provide 8-hour state persistence, which Cloud Run Sandboxes do not. Source

Google's broader strategy includes GKE Agent Sandbox, announced at Google Next in May, which uses gVisor for kernel-level isolation on Kubernetes. Cloud Run Sandboxes are designed for developers who prefer a serverless environment without managing Kubernetes clusters.

Business Impact

Cloud Run Sandboxes effectively remove barriers to securely executing AI-generated code, particularly concerning infrastructure costs and complexity. For businesses already using or planning to use Cloud Run for AI applications that generate and execute code, this feature streamlines development and deployment. It establishes a secure default for handling untrusted code, enabling businesses to focus on application logic and feature development rather than complex security infrastructure.

This public preview allows businesses to integrate advanced security for AI operations without overhauling existing Cloud Run architectures.

Key takeaways

  • 01Google Cloud Run Sandboxes are now in public preview, allowing safe execution of AI-generated code within existing Cloud Run services.
  • 02The sandboxes offer three key isolation boundaries: credential, network, and filesystem, enhancing security for untrusted code.
  • 03There are no additional costs beyond standard Cloud Run usage, making security for AI code execution more accessible.
  • 04Performance is optimized with fast execution times and negligible cold starts, ideal for AI agents.
  • 05Process-level isolation is provided, suitable for most AI applications, while kernel-level isolation remains an option where threat models are extreme.

Frequently asked

What problem do Google Cloud Run Sandboxes solve for my business?+

They simplify and secure the execution of AI-generated code by providing isolated environments within your existing Cloud Run services, reducing security risks and operational complexity without extra cost.

Will using these sandboxes increase my Google Cloud bill?+

No, there are no additional charges for using Cloud Run Sandboxes. They consume resources from your existing Cloud Run instance allocation, making them a cost-effective solution for enhancing security.

How secure are these sandboxes for running untrusted code?+

Cloud Run Sandboxes provide robust process-level isolation with default-deny policies for credentials, network access, and filesystem writes, protecting your core service from potentially malicious AI-generated code.

Can Cloud Run Sandboxes replace more complex security solutions I'm already using?+

For most AI application use cases, Cloud Run Sandboxes offer sufficient security and isolation. However, if your threat model demands kernel-level isolation or persistent session state, solutions like AWS Lambda MicroVMs might still be necessary.

What is the performance impact of running code in a sandbox?+

Performance is minimal, with average execution latencies of around 500ms for 1,000 sequential sandboxes and millisecond cold starts, ensuring that the user experience is not negatively affected.

Sources

Every briefing is drafted from primary sources — official announcements, vendor blogs, and reputable industry reporting — then edited by our pipeline.

#google cloud#cloud run#ai#security#serverless#developer tools
See all →

Free account

Want to go deeper?

Sign up free to unlock the full daily industry feed, save posts and articles to your library, and chat with the AI tutor about anything you read.