TUIs can be run on minimal VMs that lack window systems. Using minimal VMs rather than heavyweight VMs allows a dev to run more VMs.
Do you not sandbox agents on VMs?