I gave the agent's CI an empty room
I let an agent open pull requests against my texas-septic-toolkit. That means I eventually run code written by a language model that has read the internet, misunderstood parts of the internet, and occasionally invented a better internet. CI still needs to test that code. My answer was to give it a room with nothing in it.
The room is a small virtual machine on my one Proxmox box. A job starts the VM from a clean template, runs the checks, saves the boring test result, and destroys the VM. The next job gets a new one. There is no cleanup script because I do not trust cleanup scripts nearly as much as I trust deletion.
What the runner can reach
The runner can reach the public internet. It needs package indexes, pinned GitHub actions, and the repository checkout. It cannot reach the rest of my homelab. The firewall allows outbound web traffic and DNS, plus the minimum connection back to the CI service. There is no route from that network to the machines where I keep anything interesting.
This is not an airtight research lab. A malicious test could still waste bandwidth, download nonsense, or send the source tree somewhere else. The source tree is public, so that last threat is not especially dramatic. The useful boundary is simpler: untrusted code cannot turn a test job into a tour of my network.
What the runner knows
Nothing valuable.
The checkout credential is read-only and short-lived. It is not persisted in the git configuration. The job gets no deployment key, no package publishing token, and no general-purpose GitHub token with write permission. My two agents do their work elsewhere. Their credentials do not enter the runner VM, even temporarily.
That last part matters. People like to describe secrets as safe because a workflow does not intentionally print them. Code running in a job does not need to print a secret to misuse it. If the credential can publish a release or change a repository, then every dependency install and test process in that job has inherited the ability. The easiest secret to protect is the one that never arrived.
Why I destroy it
Long-lived runners accumulate history. A forgotten workspace survives. A package manager leaves a cache. A test starts a service that nobody stops. Six months later the machine is a geological sample of every pull request it has ever met.
An ephemeral VM turns that maintenance problem into a template problem. I patch one template. I keep the startup script small. When a job ends, the disk goes away. If a test changes a system file, plants a background process, or fills the cache with garbage, it has accomplished something that lasts until deletion, which is usually less than ten minutes.
The price is startup time. Cloning and installing from scratch costs a few minutes, and my little Proxmox box is not pretending to be a cloud region. I cache dependencies only when the cache can be treated as untrusted input. A clean runner that starts slowly is more useful to me than a fast runner with a complicated childhood.
The actual security model
This is the runner behind the setup I described in the CI that supervises my agent. The important controls are not clever: disposable machine, empty credential drawer, narrow network, read-only source, then deletion.
I still review changes before merge. I still pin dependencies. I still assume the boundary has holes I have not found. The VM is not permission to stop paying attention. It is a way to make the likely mistake small enough that I can afford to learn from it.