Terminal backends
The terminal tool lets the agent execute shell commands on your machine — or on a remote machine, or inside a container. Headmaster supports 6 terminal backends, each for a different use case.Available backends
| Backend | Use case | Security |
|---|---|---|
| Local (default) | Development, trusted tasks | Runs on your machine — full access |
| Docker | Security, reproducibility | Isolated container — agent can’t touch your host |
| SSH | Sandboxing — keeps agent away from its own code | Remote machine — agent works on a server |
| Singularity | HPC cluster computing, rootless | Apptainer/Singularity container — for HPC environments |
| Modal | Serverless cloud execution, scale | Cloud sandbox — hibernates when idle, costs nearly nothing |
| Daytona | Persistent remote dev environments | Remote dev environment — persistent across sessions |
Configuration
Set the backend in Settings → Headmaster’s Library → Advanced → Terminal or directly in the config file:Local backend
The default. Commands run directly on your machine in the working directory. Full access to your file system, installed tools, and environment. When to use: Development, trusted tasks, when you want the agent to have full access to your project. Security: The agent can run any command you can. In Work Along mode, every command requires your approval. In Hands-Off mode, the agent runs commands without asking.Docker backend
Commands run inside a Docker container. The agent can’t touch your host file system — only the container’s file system.Under the hood
- One persistent container, shared across the whole process.
- Headmaster starts a single long-lived container on first use and routes every terminal, file, and
execute_codecall throughdocker execinto that same container. - Working-directory changes, installed packages, env tweaks, and files in
/workspacecarry over between tool calls. - Persists across new conversations and subagent delegations.
- Container is stopped and removed on shutdown.
- Behaves like a persistent sandbox VM, not a fresh container per command.
Container persistence
container_persistent: true, files in /workspace and /root survive Headmaster restarts. With false, the container starts fresh each time.
Container resources
Container security
All container backends run with security hardening:- Read-only root filesystem (Docker).
- All Linux capabilities dropped.
- No privilege escalation.
- PID limits (256 processes).
- Full namespace isolation.
- Persistent workspace via volumes, not writable root layer.
SSH backend
Commands run on a remote machine via SSH. The agent works on a server instead of your local machine.Singularity / Apptainer backend
For HPC (high-performance computing) cluster environments. Rootless — doesn’t require root access.Modal backend (serverless cloud)
Commands run in a serverless cloud sandbox. The sandbox hibernates when idle, costing nearly nothing.Daytona backend
Persistent remote development environments. The agent works in a Daytona-managed environment that persists across sessions.Choosing a backend
| Your situation | Recommended backend |
|---|---|
| Local development, trust the agent | Local |
| Want isolation, have Docker | Docker |
| Want isolation, no Docker | SSH |
| On an HPC cluster | Singularity |
| Want cloud execution, pay per use | Modal |
| Want persistent remote dev env | Daytona |
Terminal tool behavior
Regardless of backend, the terminal tool:- Timeout: Commands time out after the configured timeout (default 180 seconds). Long-running commands can use background mode.
- Background execution: Set
background=truefor long-running processes (servers, watchers, builds). The process runs in the background and you get a session ID to poll, wait, or kill it later. - Working directory: The agent can
cdbetween directories. In container backends, the working directory persists across calls. - Environment variables: Exported env vars persist across calls in the same session (for local and container backends).
- Output capture: stdout and stderr are captured. Output is truncated if it exceeds 50KB.