Manuscript Offprint

arXiv:2611.12823

Coding Agents in KVM: Practical Containment and User Control with Limited Resources

Yutaka Nagashima

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yutaka Nagashima

Institute of Computer Science, The Czech Academy of Sciences

Abstract—Coding agents often need broad authority for productive development work, but granting that authority can expose users' data and infrastructure. Off-the-shelf cloud workspaces can help contain agent activity, but reliance on provider-specific platforms can lead to vendor lock-in and reduced user control. Researchers and engineers must therefore balance agent autonomy, enforced containment, and user control within available financial, computational, and human resources. We analyze these trade-offs and present KVM-Agent, an open-source implementation that automates most setup and provisioning steps. It gives agents broad authority inside replaceable Ubuntu VMs while keeping host administration outside those VMs and supporting multiple coding-agent applications, model services, and remote job delegation. The approach retains familiar workflows and user choice at the cost of VM resources, maintenance, and residual risks from secrets accessible inside the VMs and permitted network access.

Index Terms—AI engineering, coding agents, virtual machines, user control, deployment

I. INTRODUCTION

In an ideal world, everyone would have access to coding agents that are safe, affordable, open-source, easy to use, and efficient, without losing control over their data and computing infrastructure. In practice, these goals involve trade-offs. Broad permissions enable development work but increase the potential damage from mistakes or compromise. Cloud tools and model services can reduce local operational demands and offer scalability, but introduce external dependencies. Familiar development environments support existing tools and workflows, but deploying and maintaining them on user-controlled infrastructure requires computing resources and human effort.

An agent may need to install a compiler, build an unfamiliar repository, or repair dependencies. Coding agents perform such actions through an agent-computer interface [1], exercising authority over the execution environment. Mistakes, malicious dependencies, and indirect prompt injection [2] can redirect that authority. Running these operations in an ordinary workstation account exposes the files and sessions accessible to that account; requiring human approval for every command makes progress depend on repeated user intervention. At the same time, a deployment that demands extensive security administration, a particular commercial service, or dedicated new hardware may be impractical for a small research group with tight resource constraints.

In this paper, we introduce KVM-Agent to address the following question: How can researchers and engineers give coding agents the authority needed for development work while preserving their choice of tools and infrastructure and keeping operational costs manageable?

KVM-Agent is an operational wrapper around existing coding-agent applications. It provisions a graphical Ubuntu virtual machine (VM). We call the operating system (OS) inside the VM the guest and the OS running the VM the host. Agents use an account with passwordless sudo inside the guest. The user retains host virtualization controls and a dedicated recovery key. The design also supports a choice of coding-agent applications and large language model (LLM) service providers, remote operation, and optional job delegation to another machine. Our contributions are an analysis of these trade-offs in deploying coding agents under resource constraints (Section II) and an open-source reference implementation of the resulting design (Section III). The implementation automates most setup and provisioning steps, requiring manual input where user-specific choices, credentials, or trust decisions are needed.

References (38)

  • SWE-agent: Agent-computer interfaces enable automated software engineering
  • Not what you've signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection
  • credentials(7)
  • Application container security guide (opens the publisher in a new tab)
  • Docker Engine security
  • Rootless mode
  • kvm: The Linux virtual machine monitor
  • QEMU, a fast and portable dynamic translator
  • The virtualization API
  • KVM-Agent: A graphical Ubuntu VM for coding agents
  • Agent approvals & security
  • Choose a permission mode
  • Configure the sandboxed Bash tool
  • Guide to security for full virtualization technologies
  • gh auth login
  • Authentication
  • Spend limits
  • Rate limits
  • Budgets and alerts
  • Managing your personal access tokens
  • NoCloud datasource
  • txux: Getting started
  • Connection types
  • WireGuard: Next generation kernel network tunnel
  • Manage permissions using ACLs
  • The OpenHands software agent SDK: A composable and extensible foundation for production agents
  • Firecracker: Lightweight virtualization for serverless applications
  • Docker Sandboxes: Isolation layers
  • How we contain Claude across products
  • Nitro Isolation Engine whitepaper
  • Comprehensive formal verification of an OS microkernel
  • What the proofs assume
  • Surrey leads £3.2m project in collaboration with Sheffield and Melbourne to develop provably secure sandbox for AI agents
  • Virtualization costs: Benchmarking containers and virtual machines against bare-metal
  • Quantifying virtualization overhead for CPU-intensive HPC workloads in hypervisors: A comparative study of KVM, Proxmox VE, Xen, and Hyper-V
  • ProofStudio: Five Proof Assistants in the Browser
  • Abduction prover in Isabelle/HOL (opens arXiv in a new tab)
  • AlaaS introduction