# Safe Yolo Mode: Running LLM Agents in VMs with Libvirt and Virsh

DevFeed: [Safe Yolo Mode: Running LLM Agents in VMs with Libvirt and Virsh](<https://devfeed.tech/articles/safe-yolo-mode-running-llm-agents-in-vms-with-libvirt-and-virsh-31870.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2026/02/safe-yolo-mode-running-llm-agents-in-vms-with-libvirt-and-virsh/>)

Author: Chris Hager

Published: 2026-02-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [LLMs](<https://devfeed.tech/topics/llms.md>), [virtualization](<https://devfeed.tech/topics/virtualization.md>), [Security](<https://devfeed.tech/topics/security.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [qemu](<https://devfeed.tech/topics/qemu.md>), [ssh](<https://devfeed.tech/topics/ssh.md>)

Tags: [linux](<https://devfeed.tech/tags/linux.md>), [llm-agents](<https://devfeed.tech/tags/llm-agents.md>), [llms](<https://devfeed.tech/tags/llms.md>), [security](<https://devfeed.tech/tags/security.md>), [tool-use](<https://devfeed.tech/tags/tool-use.md>), [virtual-machines](<https://devfeed.tech/tags/virtual-machines.md>)

## AI overview

A guide to isolating LLM agents in Linux virtual machines with libvirt and virsh. It explains how VM isolation can reduce risks from destructive operations and unauthorized access when agents receive broad tool-use permissions, and covers setup, cloud-image provisioning, VM creation, and SSH access.

## Source excerpt

This is a guide for isolating LLM agents in virtual machines, using libvirt and virsh on Linux servers. Running LLMs in VMs isolates them from the host system, mitigating numerous security risks such as destructive operations or unauthorized file access (i.e. private keys, secrets, credentials for communication tools). This is particularly important when granting LLM agents broad permissions, like auto-approving tool use ("yolo mode"). It's also useful to keep sessions running for extended periods of time, and to interact with agents from the phone / on the go.