lima.yaml for agent terminals — mounts, hardening,
preinstalls.
Host paths exposed inside the VM. The host path is also the VM path —
~/projects on host appears at ~/projects in VM.
~ expands to the host user's home. The default row is only an example.
Anything on a writable mount executes on the host the moment you run it there. Treat the VM as a sandbox you trust to read but not write to your real codebase unless you mean it.
Defaults are conservative for agent VMs. The firewall rules only matter if the default user cannot become root; otherwise an agent can change the VM from inside. The generated firewall constrains the VM's default user. Root, tinyproxy, and system daemons bypass it.
NOPASSWD is stripped from sudoers, so sudo just fails. This
keeps agents off /etc, /usr, and the firewall rules. You
can still open a root shell from the host with the command shown beside the YAML.
An agent can run sudo nft flush ruleset to wipe the firewall, or stop
tinyproxy to bypass outbound rules. That exposes host localhost services through
Lima's gateway (192.168.5.2 / host.lima.internal) and makes
the other hardening toggles easy to disable.
localhost. Turn off to keep VM
services private to the VM.
localhost. Databases, dev
servers, OAuth callbacks, and anything else listening there become unreachable from
inside the VM. DNS and DHCP exemptions still pass so networking keeps working.
169.254.169.254). Lima's own subnet is allowed first
so DNS, DHCP, and Lima internals keep working. The host-machine toggle controls
192.168.5.2 specifically.
Force the default user's HTTP/HTTPS through an in-VM proxy with a domain allowlist, then firewall everything else. Only HTTP(S) to allowlisted domains passes; unmatched outbound traffic is dropped.
tinyproxy, filters by hostname (CONNECT host for HTTPS, Host
header for HTTP), and sets proxy env vars for the default user. The proxy runs under
its own system uid so it can resolve and connect while direct agent egress is
blocked. Patterns are anchored: api.example.com is exact, and
*.example.com matches subdomains.
Managing this at runtime: the provision script writes the list to
/etc/tinyproxy/allowlist.txt as ERE regex. To change it later, use the
root command shown beside the YAML, edit the file, then run
systemctl restart tinyproxy. You can also disable the proxy or firewall
inside the VM if you decide you do not want this restriction.
Selected items are installed once during VM creation. You can always
apt install more later.
Sets git config --system user.name / user.email inside the VM so commits
made from the VM are attributed correctly.