← All posts

When to ditch the throwaway sandbox: give your AI agent a permanent home

October 30, 2026 · 5 min read · The xShellz Team

TL;DR

  • A disposable sandbox is right for a risky one-off test you never need to see again; a permanent xshellz.box is right for anything that must keep files, state, or a session after you close your laptop.
  • Every xshellz.box tier is always-on including free, with no idle timeout, and /root is the persistent home that survives a rebuild while the rest resets.
  • To keep an agent working after you disconnect, start it inside tmux over SSH; the box keeps running 24/7 and stopped boxes are kept 30 days before cleanup.

Use a temporary sandbox when the task is disposable and you do not need its files afterwards, and a permanent xshellz.box when the agent must keep state, files, or a running session after you close your laptop. We run the xShellz fleet ourselves, and this is the exact split we use: throwaway experiments go to ephemeral sandboxes via the SDK, every long-running agent gets a box.

when should i use a temporary sandbox vs a permanent linux box for my ai agent?

A temporary sandbox is for one-off or risky work where losing everything is acceptable, like fuzzing an untrusted script or testing a model against a fresh filesystem. Use a permanent xshellz.box for anything long-lived: a coding agent that maintains a repo, a bot that serves requests, or a cron-like job. The deciding test is simple: if you need tomorrow what the agent wrote today, it goes on the permanent box. Every xshellz.box tier is always-on including free, so the box never sleeps and /root survives rebuilds, while throwaway sandboxes wipe on every run.

what is the difference between ephemeral and always-on ai agent sandboxes?

An ephemeral sandbox gives you a clean root filesystem that disappears when the job ends. An always-on box like xshellz.box gives you a persistent home directory and a process that stays alive 24/7. The box runs Ubuntu 24.04 LTS under a gVisor sandbox with Linux user namespaces, so your agent gets real root safely without raw VPS risk. The /root directory is the only path that survives a rebuild; everything else resets on an image update. That is the difference: ephemeral is for resetting, always-on is for keeping. See Agent Shell and the gVisor docs.

how do i keep an ai agent running on a remote box after i close my terminal?

Run it inside tmux, which stays attached to the box even when your SSH connection drops. Log in, start a named tmux session, launch your agent, then detach with Ctrl-b d. The box itself never sleeps, so the session keeps running. When you come back, reattach and pick up where you left off.

ssh -p <port> root@<host>
tmux new -s agent borg
# press Ctrl-b then d to detach
tmux attach -t agent

With xshellz.box there is no idle timeout on any tier, including free, so a tmux session started today is still there tomorrow.

can an ai agent keep its files and progress if i use a throwaway sandbox?

No. A throwaway sandbox resets completely after each run, so any files, caches, or conversation state the agent built are gone. If you need continuity, use a permanent xshellz.box: the /root directory persists across reboots and even survives a rebuild when the box moves to a newer image. Keep your repos, configs, and agent memory in /root. Stopped boxes are kept for 30 days before cleanup, so you can pause and resume without losing that home directory. Ephemeral sandboxes are for experiments you are happy to lose.

how do i set up a permanent dev environment for an ai agent that is always online?

Start an xshellz.box, then SSH in as root and put anything persistent under /root. To reproduce your environment on every boot, create an xshellz.box manifest file in your home directory with one package per line (a bare name or apt: for apt, pip: for Python, npm: for Node). The packages reinstall on every boot, so each box is the same environment. The box ships with git, Node 22, Python 3, ripgrep, tmux, and six preinstalled coding agent CLIs. Run borg learn to have borg study the repo and write a context file. Check pricing for tiers.

Frequently asked questions

Does the free xShellz box really stay on all the time?

Yes, every tier including free is always-on with no idle timeout and no trial countdown. The box runs 24/7, so a tmux session or long agent job keeps going after you close your laptop. That is the point: an agent that stops when your terminal closes is a script, not an agent.

What happens to my files if I stop my xShellz box?

Stopped boxes are kept for 30 days before cleanup, so you can restart and keep working. While a box is running, /root is the persistent home; the rest of the filesystem is ephemeral and resets when the box is rebuilt on a newer image. Keep anything you need in /root.

Can I run my own AI coding agent on an xShellz box, or only the preinstalled ones?

You can run any agent, but 6 coding agent CLIs come preinstalled: borg, Claude Code, OpenAI Codex, Gemini CLI, opencode and pi. They are all bring-your-own-key, so you point them at your own API keys and start working without installing anything.