Skip to content

Private VM sandboxes

A Private VM is a machine you own — a laptop, a workstation under a desk, a VM you rent — connected to Retask with the CLI so it can host sessions. Everything else about it stays yours: the tools you installed, the accounts those tools are signed in to, and the networks the machine can reach.

That’s the trade against a Cloud sandbox. Retask provisions and bills a Cloud sandbox for you. You supply a Private VM, and in return every session on it starts with everything that machine already has.

Your AI subscriptions do the work, not API credits

Section titled “Your AI subscriptions do the work, not API credits”

This is the big one. A session runs the coding tools installed on that machine, signed in the way you signed them in. If Claude Code, Codex, or Gemini CLI is already logged into your subscription there, that’s the account the session uses, with the usage that subscription already includes.

No API key has to be on file with Retask for those tools, and nothing meters per token — so an agent that grinds away all afternoon doesn’t quietly turn into a bill.

Share the sandbox with your workspace and everyone can run on it — teammates and AI Agents. One machine, set up once, becomes shared capacity instead of something only its owner benefits from.

A VPN, an internal Git server, a staging database, a private package registry, licensed tooling, a GPU, hardware plugged into a USB port. If the machine can get to it, a session on that machine can too — no inbound access into your network required.

Repositories, environment, credentials, and logins all live on the machine already. Nobody else installs anything, and the tenth teammate gets the same environment as the first.

  1. Install and authenticate the Retask CLI on the machine — see the CLI getting started guide.

  2. Install the AI tools the sessions will run, and sign each one in. This is the step people skip. A session launches a tool like claude or codex non-interactively; it cannot complete a login for you, so a tool that isn’t authenticated yet will just sit at its sign-in prompt. Run each one by hand once, finish the login, and confirm it works before you connect the machine.

  3. Install everything else the work needs, signed in the same way — git and gh, Docker, language toolchains, a VPN client, database access.

  4. Keep the machine awake and online for as long as you want it available. Check its sleep settings: a laptop that suspends drops the connection.

  1. Go to Dev Sandboxes → Sandboxes and click New sandbox. Give it a name your team will recognise — “Private VM” is fine.

  2. On the sandbox page, set Type to Private VM.

  3. Set Sharing to Workspace edit so teammates and agents can use it. (What each option means.)

  4. Add the repositories each session should start from.

  5. Set the Session init command — what runs when a session starts. The Claude Code and Codex chips fill in the usual ones, and $SEED_PROMPT receives the prompt or task the session started with.

  6. Add integrations. A GitHub or GitLab token here is what lets a session clone your private repositories — see Integrations.

  7. Save, and copy the sandbox ID from the page URL.

A sandbox is Private unless you say otherwise, and a private sandbox is invisible to everyone else — including agents.

Sharing Who can run sessions on it Who can change its settings Can agents target it?
Workspace edit every workspace member every workspace member Yes
Workspace view every workspace member you, plus workspace owners and admins Yes
Private you you No

Both workspace options let the whole workspace use the machine; they differ only in who can edit the sandbox’s configuration.

An agent’s Execution target list only ever shows workspace-shared sandboxes, which is why a private one can never be picked by one. That’s deliberate: an agent acts on behalf of whoever triggers it, so a machine only you can see shouldn’t quietly become team infrastructure.

To change it later:

Terminal window
retask sandbox update <sandbox-id> --sharing WORKSPACE_EDIT

On the machine itself, run:

Terminal window
retask sandbox connect <sandbox-id>

That’s the whole thing. The machine is now a sandbox: it goes Ready in the app, and it stays connected for as long as the command runs. Press Ctrl-C and it goes offline.

If you don’t have the ID to hand:

Terminal window
retask sandbox list --type PRIVATE

The command above is all you need. These are extras, not requirements.

  • Where you run it is where sessions land. Each session’s working directory is created inside the folder you ran connect from, and so is retask.log. Somewhere you don’t mind collecting folders is a good choice.
  • --mode headless swaps the terminal UI for plain logging on stderr — handy when the command runs somewhere nobody is watching it.
  • --auto-open opens a local terminal tab for each new session, so you can watch work land on your own screen.
  • --log-file and --no-log-file move or switch off retask.log, which otherwise sits next to you and rotates through retask.log.1, retask.log.2, and so on.

Every flag is in the sandbox connect reference.

One machine can back a Private VM in several workspaces at once — useful if you consult for more than one client, or keep work and side projects apart.

Create a sandbox in each workspace, then run one connect per sandbox, each using the profile you logged that workspace in under:

Terminal window
# In ~/retask/acme
retask sandbox connect <acme-sandbox-id> --profile acme
# In ~/retask/beta
retask sandbox connect <beta-sandbox-id> --profile beta

Give each one its own folder. Session folders and retask.log are created in the working directory, so two connects started from the same place would pile their sessions together and write over each other’s logs.

Click Session at the top of the app, and under Execution target choose your Private VM by name. Add a prompt and it starts there.

Retask draws a line between the person who connected the machine and the people whose sessions run on it:

  • Every session gets its own folder. Sessions never share a working directory.
  • The connecting operator’s own Retask credentials are stripped from every session’s environment.
  • Each session runs with a token minted for whoever started it — that teammate, or that agent — not for whoever ran connect.

What none of that can do is protect anything from the machine itself. Whoever controls the machine can read any session’s folder, inspect the environment of any session process — including that session’s Retask token and any integration secrets it was handed — and type straight into a running session’s terminal.

Your machine never accepts an inbound connection. When retask sandbox connect starts, it dials out to Retask’s sandbox proxy and holds two kinds of connection open.

How a Private VM connects to RetaskYou and your agents talk to the Retask sandbox proxy. The proxy and your machine are joined by two WebSocket lanes, both opened outbound by your machine: a data lane, one per sandbox, carrying the heartbeat and control messages such as new_session and stop_session; and a session lane, one per session, carrying the terminal's input and output.You and your agentsbrowser, API, or CLIRetasksandbox proxyYour machineretask sandbox connectData laneSession laneData lane — one per sandbox, open for as long as connect runs.Heartbeat, plus control messages: new_session, stop_session.Session lane — one per session, opened on demand.Carries the terminal's input and output.Your machine opens both lanes outbound — no inbound port, so NAT and firewalls are fine.

That’s why a Private VM works from behind NAT, a corporate firewall, or a home router with nothing forwarded.

  1. A session is requested. Someone starts one from the app, or an agent picks up a task. The proxy sends a new_session message down the data lane, carrying the sandbox’s configuration, the session’s system prompt, and its seed prompt.

  2. Your machine opens a session lane for it and streams setup progress into it — so whoever started the session watches the machine prepare it, live.

  3. A session folder is created, named after the session, inside the folder you ran connect from.

  4. Agent instructions are written into that folder as CLAUDE.md and AGENTS.md, so whichever tool runs picks up the session’s system prompt.

  5. Repositories are cloned into the folder, each on its configured branch. A GitHub or GitLab token from the sandbox’s integrations authenticates the clone through a host-scoped git header, so the token never lands in the clone URL or in the repository’s .git/config. A repository already there is fetched and reset rather than re-cloned.

  6. The environment is assembled in three layers, each overriding the last: the machine’s own environment — minus the operator’s Retask credentials, and minus the variables that describe your terminal rather than the session’s — then the sandbox’s configured variables and secrets, then the session’s own: its ID, its seed prompt, the workspace, and that per-session Retask token.

  7. The session init command runs in a terminal, from inside the session folder. Its output is what streams back up the session lane to the browser. If you didn’t set one, you get a plain shell.

Stopping a session sends stop_session down the data lane. Your machine ends that session’s process and closes its session lane. A stopped session is finished: it can’t be resumed, and picking the work back up means starting a new one.

Its folder stays on the machine, though, and folders accumulate. Delete the ones you no longer need to reclaim the space — a future release of the CLI will clear them out for you.

Meanwhile the proxy pings the data lane on a regular interval and your machine answers. If enough consecutive pings go unanswered, the sandbox is marked as errored and its sessions are closed — that’s how a machine that went to sleep or lost power stops looking available.

sandbox ... must be type PRIVATEconnect refuses a Cloud sandbox. Switch the sandbox’s Type to Private VM, or create a new one with --type PRIVATE.

It doesn’t appear as an agent’s Execution target — its sharing is still Private. Run retask sandbox update <sandbox-id> --sharing WORKSPACE_EDIT, or change Sharing on the sandbox page.

The AI tool starts, then asks you to log in — that tool isn’t authenticated on the machine. Run it by hand there, complete the sign-in, then start a fresh session.

Repositories fail to clone — the session had no GitHub or GitLab token. The setup log warns when it finds none, and offers Retry, Continue, or Exit. Connect the integration and add it to the sandbox.

The sandbox shows an error after you closed your laptop — the heartbeat went unanswered. Reconnect with retask sandbox connect <sandbox-id> and it returns to Ready.