Skip to content
Back to skills

Platform

FSecurity

Agentor worker platform guide, the only documentation of the Agentor environment you run in. Load it whenever you work inside an Agentor worker and need to know what survives a rebuild or worker-image update (only /workspace and agent data do), before installing system packages, global tools or services, before starting dev servers or databases, when finishing a project setup (persist installs in the worker setup script and servers in its init script, test with agentor setup run), when reconf...

  • 18 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
developmentpythonrustgojavashellbashsqlnextjsnodedocker

Works with

  • claude code
  • vscode
  • terminal
  • cli
  • api
  • mcp

Security analysis

F0/100
  • criticalPipes output to a shell interpreter
  • mediumUses curl or wget to download content
  • criticalAccesses sensitive system or user directories
  • criticalModifies startup scripts or system services for persistence
  • criticalDownloads and executes remote scripts — classic supply chain attack
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add lonetis/agentor --skill platform --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Platform?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Platform
[![Security: F — Skills Directory](https://www.skillsdirectory.com/api/skills/lonetis-platform/badge)](https://www.skillsdirectory.com/skills/lonetis-platform)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agentor
description: Agentor worker platform guide, the only documentation of the Agentor environment you run in. Load it whenever you work inside an Agentor worker and need to know what survives a rebuild or worker-image update (only /workspace and agent data do), before installing system packages, global tools or services, before starting dev servers or databases, when finishing a project setup (persist installs in the worker setup script and servers in its init script, test with agentor setup run), when reconfiguring, restarting or rebuilding this worker or switching its environment (agentor CLI, agentor MCP server, platform API), when exposing a port or domain, when managing tmux windows, using attached SSH keys, git credentials or commit signing, Rex, apps (Chromium CDP, SOCKS5, VS Code tunnel, SSH server), environment variables, the firewall, Docker-in-Docker or usage limits.
---

# Agentor platform guide

> **This worker:** "{{DISPLAY_NAME}}" (`{{WORKER_ID}}`) · environment "{{ENVIRONMENT_NAME}}" · platform access **{{PLATFORM_ACCESS}}** · worker APIs: {{EXPOSE_APIS}}.
> These values are from this container's last start; `agentor info` shows the current ones.

**The one rule to remember:** only `/workspace` and the agents' data survive a rebuild. Everything else you install or start is gone after one. Before you call a project setup done, persist it: install steps go into the worker's **setup script**, long-running processes into its **init script** (§4).

## 1. What Agentor is and where you run

Agentor runs AI coding agents in isolated Docker containers called **workers**. A user manages their workers in the Agentor web dashboard (or through MCP); you run inside one of them.

- **Orchestrator**: the central server (dashboard, REST API, MCP server). It creates, rebuilds and deletes workers and is reachable from here at `$ORCHESTRATOR_URL` (`{{ORCHESTRATOR_URL}}`).
- **Worker**: this container. Every worker has a UUID (`$WORKER_ID`), a free-form display name, a persistent `/workspace`, a tmux session, a virtual desktop, VS Code in the browser and the agent CLIs (Claude Code, Codex, Antigravity).
- **Environment**: reusable configuration shared by several workers: CPU/memory limits, network firewall, Docker-in-Docker, env vars, an environment setup script and init script, which worker APIs are exposed, which git providers' credentials workers get, and the worker's **platform access** (§7). The user edits environments in the dashboard (Environments).
- **Traefik**: the reverse proxy that makes ports of a worker reachable from outside, by host port (§10) or by domain name with TLS (§11).
- **Dashboard panes**: Terminal (one tab per tmux window, §12), Editor (VS Code, port 8443), Desktop (noVNC, port 6080), Apps (§14). **Rex**, a terminal app, can mirror the same tmux windows (§12).

The worker talks to the orchestrator through `$ORCHESTRATOR_URL/api/worker-self/*`. There is no login: the orchestrator recognises the worker by its address on the Docker network **and** its worker token `$AGENTOR_WORKER_TOKEN`, which every call sends as the `X-Agentor-Worker-Token` header. The `agentor` CLI wraps these routes and sends the token for you; prefer it (§6). The raw routes are in §9.

## 2. The worker

### System

| | |
|---|---|
| OS | Ubuntu 24.04, bash |
| User | `agent` (uid 1000), passwordless `sudo`, member of `docker` |
| Hostname | the short Docker container id (not the display name) |
| Workspace | `/workspace`: persistent, where tmux windows, `docker exec`, scripts and command execs start. Keep projects here. |
| Home | `/home/agent`: **not** persistent, except the agent data directories below |
| Resources | CPU and memory limits come from the environment |

### Tools

- Node.js 26 with npm/npx. **The npm global prefix is `~/.local`**, so `npm install -g` lands in `~/.local` and is lost on a rebuild.
- Python 3.12 with pip and venv. System pip refuses installs (PEP 668): use a virtualenv in the project (`python3 -m venv /workspace/app/.venv`, persistent) or `sudo apt-get install python3-<pkg>`.
- build-essential, git, `gh` (GitHub CLI), `glab` (GitLab CLI), ripgrep (`rg`), `fdfind` (fd), jq, curl, wget, zip/unzip, tree, rsync, strace, htop, btop, dnsutils, ping, `ss` (iproute2), openssh client and server, tmux 3.4, neovim, vim, nano.
- Not installed (add them in the setup script if you need them): uv, pipx, bun, Go, Rust, Java, databases.
- Docker CLI, Compose and BuildKit (the daemon only runs when the environment enables Docker-in-Docker).
- `~/.local/bin` is on `PATH`.

### Display and browsers

- A virtual display runs on `DISPLAY=:99` (Xvfb 1920x1080 + fluxbox); the dashboard's Desktop pane shows it. `maim` (screenshots) and `xdotool` (input) work on it.
- Chromium, and Playwright with Chromium, headless shell and Firefox in `/opt/ms-playwright` (`PLAYWRIGHT_BROWSERS_PATH`).
- Ports in use: 8443 and 8444 (code-server and its gate), 6080, 6081 and 5900 (noVNC / VNC and the gate), 22 (SSH app), 9222-9322 (Chromium app), 1080-1180 (SOCKS5 app). Pick others for your services (3000, 5173, 8000, 8080, …).

### Agent CLIs

| Agent | Command | Data (persistent) | This guide as skill |
|---|---|---|---|
| Claude Code | `claude` | `~/.claude`, `~/.claude.json` | `~/.claude/skills/agentor/SKILL.md` |
| Codex | `codex` | `~/.codex`, `~/.agents` | `~/.agents/skills/agentor/SKILL.md` |
| Antigravity | `agy` | `~/.gemini` | `~/.gemini/config/skills/agentor/SKILL.md` |

- Each is pre-configured with the Playwright and Chrome DevTools MCP servers, and with the MCP server `agentor` while platform access is `owner` (§8).
- This guide is refreshed into the skill directories at every start; `agentor guide` prints the current version. Don't edit those copies, they are overwritten.
- CLAUDE.md, AGENTS.md and GEMINI.md belong to the user; Agentor never writes them.
- Agent logins (Claude, Codex, Antigravity) are shared by all workers of the user: log in once in any worker. Conversation history lives in the agent data and survives rebuilds (`claude --continue`, `codex resume --last`).

### Docker-in-Docker

When the environment enables it, a Docker daemon runs in this worker (the container is privileged; only admins can enable it, unless the admin allows it for every user). Images, volumes and containers persist across rebuilds in a volume at `/var/lib/docker`. The daemon starts at every boot before the setup scripts. Inner containers come back after a start only with a restart policy (`--restart unless-stopped`) or when the init script starts them (`docker compose up -d`). They are not reachable from outside directly: publish their port on the worker (`-p 5432:5432`) and map that port (§10). With git provider tokens, the daemon is logged in to `ghcr.io` / `registry.gitlab.com`.

### Network firewall

| Mode | Outbound traffic |
|---|---|
| `full` | unrestricted |
| `package-managers` | package registries (npm, PyPI, apt, crates, Go, Maven, …) |
| `custom` | the environment's allow-list (optionally plus the package registries) |
| `block` | nothing but the agent APIs |
| `block-all` | nothing |

In every mode but `block-all`, the agent APIs and the configured git hosts stay reachable. The orchestrator, Docker networks and private address ranges are always reachable. The firewall goes up before the setup scripts run, so they are subject to it too. A blocked domain fails with a DNS or connection error: ask the user to change the environment instead of working around it.

### Environment variables

Every shell gets the same set (tmux windows, `docker exec`, ssh, scripts):

| Variable | Meaning |
|---|---|
| `WORKER_ID` | this worker's UUID: the `id` of every worker API call and MCP tool |
| `ORCHESTRATOR_URL` | the orchestrator, e.g. `http://agentor-orchestrator:3000` |
| `AGENTOR_WORKER_TOKEN` | this container's secret for the worker-self API (§9): send it as `X-Agentor-Worker-Token`. A rebuild gets a new one. Never print, log, commit or share it |
| `WORKER_CONTAINER_NAME` | the Docker container name (`agentor-worker-<id>`) |
| `AGENTOR_PLATFORM_ACCESS` | `none`, `self` or `owner` (§7), as of this start |
| `EXPOSE_PORT_MAPPINGS`, `EXPOSE_DOMAIN_MAPPINGS`, `EXPOSE_USAGE` | `true` / `false`: which worker APIs the environment exposes |
| `ENVIRONMENT`, `WORKER` | JSON baked in at the last rebuild (network mode, git providers, repos, …); `agentor settings` shows the live settings |
| `DISPLAY` | `:99` |
| `CLAUDE_CONFIG_DIR` | `~/.claude` |
| `GH_TOKEN` | set when GitHub is authenticated |
| user variables | the user's account env vars (agent API keys, `GITHUB_TOKEN`, `GITLAB_TOKEN`, `GITLAB_<NAME>_TOKEN`, custom ones), then the environment's own env vars, which win |

Account and environment variables are baked in at create/rebuild time: a variable the user adds appears after the next rebuild. Never print secret values.

### Agentor files and logs

- `/opt/agentor`: boot scripts, the `agentor` CLI, app scripts. Part of the image; don't edit.
- `/run/agentor` (memory only, cleared at every start): `settings.json` (the settings this boot uses), `boot-status.json`, `platform-guide.md`, `ssh/` (attached SSH keys), `env.sh`.
- `/var/log/agentor`: `boot.log` (this start), `boot.prev.log` (the previous one), `setup-environment.log`, `setup-worker.log`, one log per daemon (`dockerd.log`, `code-server.log`, …).
- `agentor status` summarises the boot of this start.

## 3. What survives what

| Kept? | Restart | Rebuild / image update | Archive → unarchive | Delete |
|---|---|---|---|---|
| `/workspace` | yes | yes | yes | **no** |
| Agent data (`~/.claude`, `~/.claude.json`, `~/.codex`, `~/.agents`, `~/.gemini`, `~/.vscode`, `~/.ssh/known_hosts`) | yes | yes | yes | **no** |
| Docker-in-Docker images, volumes, containers (`/var/lib/docker`) | yes | yes | yes | **no** |
| Worker settings and scripts, port and domain mappings | yes | yes | yes | **no** |
| Everything else in the filesystem: apt packages, `npm -g` / `pip --user` installs, files in `~` (`.bashrc`, `.gitconfig`, `.ssh/config`, `.config`, `.cache`), `/etc`, `/usr`, `/opt`, `/tmp`, `/var/lib` apart from `/var/lib/docker` (e.g. a database's data directory) | yes | **no** | **no** | no |
| Running processes, tmux windows, `/run/agentor` | no | no | no | no |

- **Restart**: the same container stops and boots again. Installed packages are still there; every process ends; the boot re-runs the setup and init scripts.
- **Rebuild**: the container is deleted and recreated from the current worker image and the stored settings. The user rebuilds to apply a worker-image update, a changed environment, repositories or mounts, and you can rebuild yourself (`agentor rebuild`). Unarchiving does the same. **Expect it to happen at any time.**
- **Delete** (unlike archive) erases the workspace and agent data too. It can't be undone.

Data that must survive (database files, uploads, generated assets you can't rebuild) belongs under `/workspace` or in Docker volumes (with Docker-in-Docker), never in `/var/lib/<service>` or `~`.

## 4. Persist your project

The goal: after a rebuild, the worker comes back with the project installed and its servers running, without anyone repeating your manual steps.

### Where things go

| What | Where |
|---|---|
| Source code, data, `.env` files, virtualenvs, `node_modules` | `/workspace` (persists by itself) |
| System packages, global tools, runtimes, config files in `~` or `/etc`, daemons that background themselves | the worker's **setup script** |
| Dev servers, watchers, workers, `docker compose up`, an agent CLI | the worker's **init script** (tmux) |
| Secrets (API keys, passwords) | the user's account env vars or the environment's env vars, never a script |
| A repository the worker should always have | the worker's repositories (cloned at a rebuild if missing) |

### Step 1: develop by hand, keep a list

Work normally in `/workspace`. Write down every command that changed something outside `/workspace`: `apt-get install`, `npm i -g`, a tool installed with `curl | sh`, a line added to `~/.bashrc`, `git config --global …`, a service started.

### Step 2: write the setup script

Look at what is there first and keep it: `agentor setup show` (yours) and `agentor setup show environment` (the environment's, which runs before yours). Then write a file and save it:

```bash
cat > /tmp/setup.sh <<'EOF'
#!/bin/bash
set -euo pipefail

# System packages (skipped when already installed, e.g. after a restart)
pkgs=(postgresql-client redis-server libvips-dev)
if ! dpkg -s "${pkgs[@]}" >/dev/null 2>&1; then
  sudo apt-get update -qq
  sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq "${pkgs[@]}"
fi

# Global tools
command -v uv >/dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
npm ls -g pnpm >/dev/null 2>&1 || npm install -g pnpm

# Config outside /workspace
git config --global pull.rebase true
grep -qxF 'alias ll="ls -la"' ~/.bashrc || echo 'alias ll="ls -la"' >> ~/.bashrc

# Project dependencies (node_modules is in /workspace, but install again when the lockfile changed)
cd /workspace/app && pnpm install --frozen-lockfile

# A daemon that backgrounds itself may start here
sudo service redis-server start
EOF
agentor setup set /tmp/setup.sh
```

Rules:
- **Non-interactive.** There is no stdin and no terminal: use `-y`, `DEBIAN_FRONTEND=noninteractive`, `--yes`, `--frozen-lockfile`, `npm ci`. Anything that waits for input fails.
- **Idempotent.** It runs at every start: on a fresh container after a rebuild and on an already set up one after a restart. Check before you act (`command -v x ||`, `dpkg -s`, `mkdir -p`, `ln -sf`, `grep -q … ||`).
- It runs as `agent` (use `sudo` for system changes) in `/workspace`, with bash unless it starts with a shebang (`#!/usr/bin/env python3` works).
- It runs after the firewall is up: in restricted network modes only allowed domains are reachable.
- It is killed after `$AGENTOR_SETUP_TIMEOUT` seconds (default 1800; the user can raise it with an env var). A failing script shows as a warning on the boot screen and in `agentor status`; the boot continues and the init scripts still start.
- Foreground processes don't belong here: setup must finish. Start them in the init script.
- No secrets. Scripts are stored in plain text, shown in the dashboard and included in worker exports. Read secrets from env vars the user set.
- At most 64 KiB.

### Step 3: write the init script

First find out where you run and what starts you:

```bash
echo "${AGENTOR_INIT_KIND:-not started by an init script}"   # environment / worker
tmux display-message -p -t "$TMUX_PANE" '#{window_index}:#{window_name}'
agentor init show; agentor init show environment
```

Window placement (tmux session `main`):
- Window 0 (`main`) runs the environment's init script if it has one, else the worker's, else a shell.
- When both have one, the worker's runs in window 1 (`init`).

**Never drop what is already in the worker's init script.** It often contains the command that starts you (e.g. `claude --dangerously-skip-permissions`); add your services to it.

*Simple case*, when the worker's init script runs in its own window (the environment's init script starts the agent) or the user wants window 0 to be the server: the init script is the service.

```bash
cd /workspace/app
exec npm run dev -- --host 0.0.0.0 --port 3000
```

*General case*, which works everywhere: start each service in its own named window, then continue with whatever the script did before.

```bash
# start NAME DIR COMMAND: a tmux window for a long-running process; skipped
# when the window already exists, so the script is safe to run again
start() {
  tmux list-windows -t main -F '#{window_name}' | grep -qx "$1" && return 0
  tmux new-window -d -t main: -n "$1" -c "$2" "$3; exec bash"
}
start web /workspace/app 'npm run dev -- --host 0.0.0.0 --port 3000'
start db  /workspace/app 'docker compose up db'

# what the script did before, e.g. launching the agent, stays last:
exec claude --dangerously-skip-permissions
```

Save it with `agentor init set FILE` (or `-` for stdin). Rules:
- It owns a terminal, so it may be interactive (an agent CLI). It starts after the setup scripts finished.
- When it exits, a plain shell replaces it in its window; it is not restarted automatically. `; exec bash` in the example keeps a crashed service's window open with its output.
- Servers must listen on `0.0.0.0` (Vite: `--host 0.0.0.0`, Next.js: `-H 0.0.0.0`), otherwise port and domain mappings can't reach them.
- Use window names of letters, digits, `-` and `_`.
- Window 0 can't be renamed or closed.

### Step 4: test it now

```bash
agentor setup run          # runs the environment's and your setup script like a start does
agentor setup run worker   # only yours; run it twice: the second run must succeed and change nothing
agentor init restart       # (re)starts your init script in its window
tmux list-windows -t main  # the service windows are there
ss -ltnp                   # the services listen
curl -fsS localhost:3000 >/dev/null && echo web ok
```

- `agentor setup run` output goes to the terminal and to `/var/log/agentor/setup-<kind>.log`. It exits non-zero when a script fails.
- `agentor init restart` refuses to restart the window you are running in (that would end you) unless `--force`. When your own window runs the init script, test the lines by running them in a shell instead.
- When your script has no window yet, it takes over window 0 only while that is an idle shell; if something runs there (an agent, a process started by hand) it opens a new window `init` instead.
- To start a service window again from scratch: `tmux kill-window -t main:web && agentor init restart`.

### Step 5: prove it with a rebuild

- `agentor restart` re-runs both scripts on the same container. It proves the init script and that setup is idempotent, but not that setup works on a fresh container (the packages are still installed).
- `agentor rebuild` recreates the container: the real proof.

Both end your session, together with every process in the worker. **Ask the user before you restart or rebuild yourself** (unless they asked for it) and tell them what happens: the worker comes back by itself once the boot and the setup scripts finished; `/workspace` and your conversation history stay; if an init script starts the agent, a new session starts there, otherwise the user starts you again; either way they can resume the conversation with `claude --continue` (Codex: `codex resume --last`). Save your work first.

After the worker is back: `agentor status` shows every boot phase (done / warn / skip). A setup failure is in `/var/log/agentor/setup-worker.log`; fix the script, `agentor setup run`, and rebuild again.

Want proof without ending your session? With platform access `owner` you can create a temporary worker with the same environment, repositories and scripts (`agentor api POST /api/containers '{…}'`), check it, and delete it. It starts with a fresh workspace, so this only works when the project comes from its repositories.

### Step 6: expose it

Make the service reachable: `agentor ports add 9000 3000` (§10) or `agentor domains add app 3000` (§11). Mappings survive restarts and rebuilds.

## 5. How environment and worker scripts combine

Boot order at every start: agent data → environment variables → live settings → SSH keys → agent setup → Docker daemon → display → editor → git → repositories → firewall → **setup scripts** → **init scripts**.

| | Setup script | Init script |
|---|---|---|
| Runs | at every start, after the firewall | at every start, after the setup scripts |
| Order | environment's first, then the worker's (even when the environment's failed) | environment's in window 0; worker's in window 0, or window 1 `init` when both exist |
| Input | none (stdin is `/dev/null`) | a terminal |
| Limit | `$AGENTOR_SETUP_TIMEOUT` (1800 s) per script | none |
| Output | `/var/log/agentor/setup-environment.log`, `setup-worker.log`, container log (`[setup:<kind>]`) | the tmux window |
| On exit | done or warn in `agentor status` | a plain shell takes over the window |
| Who edits | environment's: the user (Environments); worker's: you (`agentor setup`, platform access `self`) or the user (Worker settings → Scripts) | the same, with `agentor init` |

The scripts are fetched from the orchestrator at every start; the copies baked into the container are only a fallback when the orchestrator is unreachable (`agentor status` then shows `settings: baked`).

The environment's scripts are shared by every worker of that environment. Change your own worker's scripts, not the environment's. With `owner` access the user's own environments can be changed too (`agentor api PUT "environments/<id>" '{"setupScript": "…"}'`), but ask the user first. The built-in default environment can't be changed from a worker (a worker always acts with the role `user`): ask an admin to edit it in the dashboard.

When changes apply — one rule: *switching environments applies on rebuild; editing an environment's platform access and exposed APIs applies immediately; editing its scripts applies on the next start*:

| Change | Applies |
|---|---|
| Display name | immediately |
| Setup script, init script (the worker's, or the environment's this worker runs) | at the next start (`agentor restart` or a rebuild) |
| SSH keys attached by the user | immediately (synced into the running worker) |
| Platform access, exposed APIs of the environment this worker runs | immediately on the server; `$AGENTOR_PLATFORM_ACCESS`, `$EXPOSE_*` and the `agentor` MCP server entry at the next start |
| Switching this worker to another environment | at the next rebuild — until then the worker keeps the old environment entirely (platform access, exposed APIs, scripts, network, Docker, env vars); `pendingRebuild: true` |
| Repositories, host mounts | at the next rebuild (`pendingRebuild: true` until then) |
| Environment network mode, Docker, limits, env vars, git providers; account env vars | at the next rebuild |

## 6. The `agentor` CLI

`agentor --help` and `agentor <command> --help` describe every command. Errors exit 1 with an explanation (a 403 names the setting the user can change), usage errors exit 2.

| Command | What it does | Needs |
|---|---|---|
| `agentor info` | identity, environment, platform access, exposed APIs (live) | |
| `agentor status [--json]` | boot phases of this start, log locations | |
| `agentor guide` | this guide | |
| `agentor settings [get]` | live settings of this worker and its environment (scripts, repos, SSH keys, pending rebuild) | |
| `agentor settings patch JSON` (or `@FILE`, `-`) | change `displayName`, `setupScript`, `initScript`, `repos` (replaces the whole list, §13); `environmentId` needs `owner` | `self` |
| `agentor setup show [worker or environment]` | print a setup script | |
| `agentor setup set FILE` (or `-`) | replace the worker's setup script | `self` |
| `agentor setup edit` / `clear` | edit in `$EDITOR` (needs a terminal) / remove it | `self` |
| `agentor setup run [all, worker or environment]` | run the setup scripts now (default all) | |
| `agentor init show [worker or environment]` | print an init script | |
| `agentor init set FILE` (or `-`), `edit`, `clear` | change the worker's init script | `self` |
| `agentor init restart [worker or environment] [--force]` | (re)start an init script in its window now (default worker) | |
| `agentor restart` | restart this container (202, then everything ends) | `self` |
| `agentor rebuild` | rebuild this container (202, then everything ends) | `self` |
| `agentor env show` | the environment this worker runs (its current content) | |
| `agentor env list` / `use ID` | list the environments the user can assign (the default and their own) / assign one (applies at the next rebuild) | `owner` |
| `agentor ssh-keys list` / `sync` | attached SSH keys / fetch them again | |
| `agentor ports list`, `add EXT INT [--type localhost or external]`, `rm EXT` | port mappings of this worker | exposed |
| `agentor domains status`, `list`, `add SUB PORT [options]`, `rm ID` | domain mappings of this worker (`status` always works) | exposed |
| `agentor usage [refresh]` | the user's agent usage limits | exposed |
| `agentor api METHOD PATH [JSON, @FILE or -]` | any REST endpoint as the user (§8) | `owner` |
| `agentor mcp-url` | the worker MCP endpoint | |

`agentor` requests give up after `$AGENTOR_API_TIMEOUT` seconds (120 by default, 900 for `agentor api`).

## 7. Platform access

What this worker may change on the platform depends on its environment's **platform access** (this worker: **{{PLATFORM_ACCESS}}**; live: `agentor info`). The user sets it in the dashboard: Environments → environment → Platform Access.

| Level | Allows |
|---|---|
| `none` | Read-only for the platform: identity, settings, this guide, attached SSH keys, `agentor setup run` / `init restart` (they act on this container only). Port/domain mappings and usage if the environment exposes them. |
| `self` | Also change this worker's own display name, setup script, init script and repositories, and restart / rebuild it. |
| `owner` | Also act on the whole platform as the user, with the role `user` (never admin): switch this worker's environment (to the default or one of the user's own), create and manage other workers, environments, mappings, apps, tmux windows, … through `agentor api` and the MCP server `agentor`. |

Never available to a worker, at any level: the user's account (env vars, SSH keys, password, agent logins, OAuth apps, Rex), user management, login and setup endpoints, worker export/import, host mounts, attaching SSH keys, editing the default environment, and Docker-in-Docker unless the admin allows it for every user. If you need one of these, ask the user.

Switching this worker to another environment takes effect at its next rebuild: until then it keeps the old environment's platform access, exposed APIs, scripts, network and Docker (`agentor info` shows the environment it runs; `agentor settings` shows `pendingRebuild`).

An environment with `none` or `self` usually means the user runs untrusted code there: don't try to work around it.

## 8. Acting on the platform as the user (`owner`)

**CLI.** `agentor api METHOD PATH [BODY]` calls any REST endpoint through the platform proxy. PATH works with or without `/api`; the response body is printed as is.

```bash
agentor api GET containers                               # all workers of the user
agentor api GET "containers/$WORKER_ID"                  # yourself
agentor api GET environments
agentor api POST containers '{"displayName":"helper","environmentId":"<id>","initScript":"claude --dangerously-skip-permissions"}'
agentor api POST "containers/<id>/exec" '{"command":"git -C /workspace/app log --oneline -3"}'
agentor api POST "containers/$WORKER_ID/apps/chromium"   # start an app
```

The API reference is at `$ORCHESTRATOR_URL/api/docs` (OpenAPI JSON: `$ORCHESTRATOR_URL/api/docs/openapi.json`).

**MCP server `agentor`.** At every start with platform access `owner`, the agents are configured with the MCP server `agentor` at `$ORCHESTRATOR_URL/api/worker-self/mcp?token=…` (streamable HTTP, no OAuth; the URL carries the worker token — don't print or share it; `agentor mcp-url` prints it); with any other level the entry is removed. An agent CLI loads it when it starts; after the access level changed, the entry follows at the next start (`agentor restart`). Check with `claude mcp list` / `codex mcp list` / `agy mcp list`.

Its tools are the REST API, executed as the user. In tool names *container* means *worker*:
- Workers: `list_containers`, `create_container`, `update_container_settings`, `reorder_containers`, `stop_container`, `restart_container`, `rebuild_container`, `archive_container`, `unarchive_worker`, `delete_container`, `list_archived_workers`, `get_container_logs`, `get_worker_metrics`.
- Inside a worker: `exec_command`, `list_tmux_windows`, `create_tmux_window`, `send_tmux_keys`, `capture_tmux_window`, `rename_tmux_window`, `delete_tmux_window`, `upload_to_workspace`, `download_workspace`, `get_desktop_screenshot`, `send_desktop_input`.
- Environments: `list_environments`, `get_environment`, `create_environment`, `update_environment`, `delete_environment`.
- Mappings and apps: `create_port_mapping`, `list_port_mappings`, `delete_port_mapping`, `create_domain_mapping`, `create_domain_mappings_batch`, `list_domain_mappings`, `delete_domain_mapping`, `get_domain_mapper_status`, `list_app_types`, `start_app_instance`, `list_all_apps`, `stop_app_instance`.
- Git and usage: `list_git_providers`, `list_git_repos`, `list_git_branches`, `create_git_repo`, `get_usage`.

To act on yourself, pass your own id `{{WORKER_ID}}` (`$WORKER_ID`), e.g. `update_container_settings` with `setupScript`. For a rebuild of yourself use `agentor rebuild`, or `rebuild_container` with `async: true` (the synchronous call would never return to you).

Rules:
- Restarting, rebuilding, stopping, archiving or deleting your own worker ends your session.
- Changes are real and immediate. Creating workers costs the user's resources; deleting a worker erases its `/workspace` for good; changing an environment affects every worker that uses it. Ask the user before destructive or expensive actions on anything but yourself.

## 9. REST routes (`/api/worker-self/*`)

Prefer the `agentor` CLI. For plain `curl` against `$ORCHESTRATOR_URL/api/worker-self`, send the worker token as `-H "X-Agentor-Worker-Token: $AGENTOR_WORKER_TOKEN"` on every call (401 without it) and JSON bodies with `-H 'Content-Type: application/json'`. Use `$ORCHESTRATOR_URL` (its host name, `localhost` or an IP literal also work; any other host name is refused), and don't call these routes from a browser page (requests with `Origin` or `Sec-Fetch-Site` headers are refused).

| Route | Needs | Purpose |
|---|---|---|
| `GET /info` | | identity, the environment this worker runs, platform access, exposed APIs |
| `GET /settings` | | this worker's settings (`worker.environmentId` = the assigned environment) and the environment it runs, with its scripts |
| `PATCH /settings` | `self` (`environmentId`: `owner`) | `displayName`, `setupScript`, `initScript`, `repos` (replaces the list), `environmentId` (applies on rebuild); mounts and SSH keys: 403 |
| `POST /restart`, `POST /rebuild` | `self` | 202, then restart / rebuild this worker about half a second later |
| `GET /platform-guide` | | this guide (`text/markdown`) |
| `GET /ssh-keys` | | the SSH keys attached to this worker, with private keys |
| `GET`, `POST /port-mappings`; `DELETE /port-mappings/{externalPort}` | exposed port mappings | §10 |
| `GET /port-mapper/status` | | counts of this worker's port mappings |
| `GET`, `POST /domain-mappings`; `POST /domain-mappings/batch`; `DELETE /domain-mappings/{id}` | exposed domain mappings | §11 |
| `GET /domain-mapper/status` | | base domains and their TLS setup |
| `GET /usage`, `POST /usage/refresh` | exposed usage | §15 |
| any method `/platform/{path}` | `owner` | forwarded to `/api/{path}` as the user (`agentor api`) |
| `POST /mcp` | `owner` | the worker MCP endpoint |

```bash
H="X-Agentor-Worker-Token: $AGENTOR_WORKER_TOKEN"
curl -s -H "$H" "$ORCHESTRATOR_URL/api/worker-self/info" | jq
curl -s -H "$H" -X PATCH "$ORCHESTRATOR_URL/api/worker-self/settings" -H 'Content-Type: application/json' \
  --data "$(jq -n --rawfile s /tmp/setup.sh '{setupScript: $s}')"
curl -s -H "$H" "$ORCHESTRATOR_URL/api/worker-self/platform/environments" | jq '.[].name'
```

Status codes: 401 = not called from inside a running Agentor worker, or the worker token is missing or stale (a rebuild mints a new one: re-read `$AGENTOR_WORKER_TOKEN`); 403 = platform access too low, API not exposed or route not available to workers (the message names the setting); 409 = the worker isn't running yet (starting or rebuilding: retry shortly), or a port / domain conflict.

## 10. Port mappings

A port mapping makes a port of this worker reachable on the Docker host: Traefik opens the host port and forwards TCP to this worker. It needs the environment to expose port mappings (this worker: {{EXPOSE_APIS}}).

| Type | Reachable from |
|---|---|
| `localhost` (default) | the host only (127.0.0.1): the user opens `http://localhost:<port>` on the machine running Agentor |
| `external` | the network (0.0.0.0): anyone who can reach the host |

```bash
agentor ports add 9000 3000                    # host port 9000 → port 3000 here (localhost)
agentor ports add 9001 8080 --type external
agentor ports list
agentor ports rm 9000

curl -s -X POST "$ORCHESTRATOR_URL/api/worker-self/port-mappings" -H "X-Agentor-Worker-Token: $AGENTOR_WORKER_TOKEN" \
  -H 'Content-Type: application/json' -d '{"externalPort":9000,"type":"localhost","internalPort":3000}'
curl -s -X DELETE "$ORCHESTRATOR_URL/api/worker-self/port-mappings/9000" -H "X-Agentor-Worker-Token: $AGENTOR_WORKER_TOKEN"
```

- Ports 1-65535. A host port that is already mapped or occupied returns 409, and so do 80 and 443 while domain routing is active. Pick another port.
- The service must listen on `0.0.0.0`, not only 127.0.0.1.
- Mappings survive restart, rebuild and archive/unarchive; deleting the worker removes them. Deleting another worker's mapping returns 403.

## 11. Domain mappings

A domain mapping routes `subdomain.basedomain[/path]` to a port of this worker through Traefik, with automatic TLS. It needs base domains configured on the platform and the environment to expose domain mappings.

Check first with `agentor domains status`: `enabled`, `baseDomains`, and per base domain its `challengeType`:

| `challengeType` | TLS | HTTPS / TCP | Wildcard |
|---|---|---|---|
| `none` | no | no (HTTP only) | yes |
| `http` (Let's Encrypt HTTP-01) | yes | yes | no |
| `dns` (Let's Encrypt DNS-01) | yes | yes | yes |
| `selfsigned` (local CA; users must trust it) | yes | yes | yes |

```bash
agentor domains add app 3000                          # https://app.<first base domain> → port 3000
agentor domains add api 8080 --base-domain example.com --protocol https
agentor domains add - 3000 --path /docs               # bare base domain, /docs prefix
agentor domains add tenant 3000 --wildcard            # tenant.<domain> and *.tenant.<domain>
agentor domains add staging 3000 --auth admin:s3cret  # basic auth
agentor domains add db 5432 --protocol tcp            # raw TCP, routed by TLS SNI
agentor domains list
agentor domains rm <id>
```

- Defaults: the first base domain; `https` when that domain has TLS, else `http`. Use `''` or `-` as subdomain for the bare base domain; multi-level subdomains (`api.v2`) work.
- `--path /prefix` routes by URL path; the prefix is stripped before forwarding (`/docs/a` arrives as `/a`). Longer paths win over shorter ones. Not for TCP.
- `--wildcard` also matches every single-label prefix of the host (`x.app.example.com`, not `a.b.app.example.com`). An exact host always wins over a wildcard. Not with challenge type `http`; TCP wildcards need `dns` or `selfsigned`.
- `--auth USER:PASSWORD` adds HTTP basic auth. Not for TCP.
- TCP mappings listen on port 443 and need TLS on the base domain: clients connect with TLS, the SNI host name selects the mapping, and Traefik terminates TLS and forwards plain TCP to your port.

Raw API: `POST /domain-mappings` with `{"subdomain":"app","baseDomain":"example.com","protocol":"https","internalPort":3000}` and optional `path`, `wildcard`, `basicAuth: {"username","password"}`; `POST /domain-mappings/batch` with `{"items":[…]}` creates several with one Traefik reload; `DELETE /domain-mappings/<id>`. A taken subdomain + base domain + path + protocol, a protocol conflict, or the dashboard's own host name (also through a wildcard) returns 409. Mappings survive restart, rebuild and archive/unarchive.

## 12. tmux, the dashboard terminal and Rex

You run inside tmux session `main`. Its windows are the tabs of the dashboard's Terminal pane, and of Rex when the user uses it, so the user sees every window you create and can type into it.

```bash
tmux list-windows -t main -F '#{window_index} #{window_id} #{window_name}'
tmux new-window -d -t main: -n tests -c /workspace/app            # a new tab with a shell
tmux send-keys -t main:tests 'npm test -- --watch' Enter          # run something in it
tmux capture-pane -p -t main:tests -S -200                        # read its last 200 lines
tmux new-window -d -t main: -n build -c /workspace/app 'make; exec bash'   # run a command in a new tab
tmux kill-window -t main:tests
```

- Always use `-d` (don't steal the user's view) and target session `main` explicitly. Sessions named `ws-*` and `rex-*` are the dashboard's and Rex's viewers; leave them alone.
- A window started with a command closes when the command exits; append `; exec bash` to keep it and its output. A window with a shell stays.
- Window names: letters, digits, `-` and `_`.
- Window 0 (`main`) runs an init script or a shell; it can't be renamed or closed. The init windows are described in §4.
- Every window ends with a restart or rebuild. Processes that must come back belong in the init script.
- Panes work too (`tmux split-window -h -d`), but tabs are easier for the user to follow.
- For a quick check without a window, run the command directly; use windows for long-running or interactive processes.

**Rex** is a terminal app the user can connect to Agentor (Account → Rex) over SSH or Tailscale. Each of the user's workers is a Rex session, each tmux window of a worker a tab: a window you create appears as a tab within seconds, a tab the user opens creates a window, closing a tab closes its window (window 0 excepted), renaming a tab renames the window, a session the user creates becomes a new worker. Name windows by what runs in them; that is what the user sees.

## 13. Git, credentials, SSH keys

**Identity.** git `user.name` / `user.email` are the user's profile; agents add a `Co-authored-by` trailer. Settings you add with `git config --global` are lost on a rebuild: put them in the setup script.

**Tokens.** For each git provider (GitHub, gitlab.com, self-managed GitLab servers) whose token the user stored (`GITHUB_TOKEN`, `GITLAB_TOKEN`, `GITLAB_<NAME>_TOKEN`) and the environment enables:
- HTTPS clone/pull/push are authenticated (credential helpers read the token when git asks; it is never written to `~/.gitconfig`), and `git@host:` remotes are rewritten to HTTPS;
- `gh` / `glab` are signed in; with Docker-in-Docker the daemon is logged in to the provider's registry.

`jq -c .enabledGitProviderIds <<< "$ENVIRONMENT"` lists the enabled providers and `jq -c '.gitProviders' <<< "$WORKER"` all of them. For the others no token is present and only public repositories work: don't try to work around it. `glab` lets `GITLAB_TOKEN` override every host: with tokens for gitlab.com and a self-managed GitLab, run `env -u GITLAB_TOKEN glab …` for the latter (outside a clone add `--hostname <host>`).

**Repositories.** The worker's repositories are cloned into `/workspace/<name>` at a start when that directory is missing; changes to the list apply at the next rebuild. `repos` **replaces the whole list**, so read the current one and send it back with your addition:

```bash
agentor settings patch "$(agentor settings | jq -c '{repos: (.worker.repos + [{"provider":"github","url":"owner/repo","branch":"main"}])}')"
```

Since `/workspace` persists, a manual `git clone` is enough for this worker; the setting matters for a fresh workspace.

**SSH keys.** The user can attach their own SSH key pairs to this worker (Account → SSH → SSH keys to create or import, Worker settings → SSH keys to attach). You can't attach keys yourself.
- They are written to `/run/agentor/ssh/<name>` (+ `.pub`; memory only, never on disk or in an export) and listed for every host in a managed block at the end of `~/.ssh/config` (`StrictHostKeyChecking accept-new`; accepted host keys go to `~/.ssh/known_hosts`, which survives rebuilds). Host blocks you add above it win. Edits inside the block are overwritten.
- ssh offers the keys one after another, so with six or more keys a server may reject you (`Too many authentication failures`, its `MaxAuthTries`). Add a block above the managed one: `Host <server>` / `IdentityFile /run/agentor/ssh/<name>` — ssh offers that key first.
- `ssh user@server` and `git@host:` remotes of providers without a token use them. The public half must be registered there (show it with `agentor ssh-keys list` or `cat /run/agentor/ssh/<name>.pub`).
- `agentor ssh-keys list` shows the attached keys; `agentor ssh-keys sync` fetches them again (the orchestrator does it automatically when the attachment changes, and every boot does it).
- **Signing:** when the user picks a signing key, git signs commits and tags with it (`gpg.format ssh`, `commit.gpgsign`, `tag.gpgsign`, `~/.ssh/allowed_signers`; `git log --show-signature` verifies). Don't change these settings.
- Never print, copy or commit private keys or tokens.

## 14. Apps

The user starts apps in the dashboard's Apps pane; with `owner` access you can start them too (`agentor api POST "containers/$WORKER_ID/apps/<type>"`, `start_app_instance`):

| App | What it is |
|---|---|
| `chromium` | Chromium with a DevTools (CDP) port in 9222-9322, for Puppeteer/Playwright; up to 10 instances |
| `socks5` | a SOCKS5 proxy (`microsocks`) on 1080-1180, to route traffic through this worker; up to 10 |
| `vscode` | a VS Code tunnel: the user connects a local VS Code (Remote - Tunnels) through Microsoft's relay; authenticated once per worker with GitHub |
| `ssh` | `sshd` on port 22, published on a host port in 22000-22999; public-key login as `agent` with the user's inbound key (Account → SSH → Your public key) |

Always running: VS Code in the browser (code-server, the Editor pane) and the noVNC desktop (the Desktop pane), behind a gate on ports 8443 / 6080 that only lets the dashboard in. You can also launch Chromium yourself on the display: `chromium --no-first-run https://example.com &`.

The `chromium` (CDP) and `socks5` ports have no authentication, and other workers on the same Docker network can reach them: stop these apps when you no longer need them, and don't leave a Chromium logged in to sensitive sites running.

## 15. Usage limits

`agentor usage` shows the user's remaining capacity per agent for subscription (OAuth) logins: `agents[]` with `authType` (`oauth`, `api-key`, `none`), `usageAvailable` and `windows[]` (`label` such as Session / Weekly, `utilization` 0-100 %, `resetsAt`). API-key logins report no usage. `agentor usage refresh` polls the providers now (otherwise every 5 minutes). Check before a long task; above about 80 % plan for the reset. Needs the environment to expose the usage API.

## 16. Rules of thumb

- Work in `/workspace`. Treat everything else as temporary.
- After every change outside `/workspace`, update the setup script; after every new long-running process, update the init script. A project setup isn't done until `agentor setup run` passes twice.
- Scripts: idempotent, non-interactive, no secrets, keep what is already there.
- Ask the user before you restart or rebuild yourself, and before destructive or expensive platform actions. Save your work first.
- Don't fight the environment: when the firewall, platform access, an unexposed API or a withheld git provider blocks you, tell the user which setting would allow it.
- Bind servers to `0.0.0.0`, use free ports, expose them with a port or domain mapping, and tell the user the URL.
- Name tmux windows by what runs in them; the user sees them as tabs.
- Never print or commit tokens, keys or passwords.

## 17. Troubleshooting

- `agentor status`: boot phases of this start (done / warn / skip) and log locations; the full log is `/var/log/agentor/boot.log` (previous start: `boot.prev.log`).
- A setup script failed: `/var/log/agentor/setup-worker.log` (or `setup-environment.log`). Fix it, `agentor setup run`, then restart or rebuild.
- `settings: baked` in `agentor status`: the orchestrator wasn't reachable at boot, so the worker ran the scripts baked in at the last rebuild. `agentor setup run` uses the live ones again.
- A server isn't reachable through a mapping: does it listen on `0.0.0.0` (`ss -ltn`)? Is the port right (`agentor ports list`)?
- HTTP 401 from `agentor` or worker-self: you are not inside a running Agentor worker (or it is still registering; retry after a few seconds), or a raw call lacks the `X-Agentor-Worker-Token` header / uses a token from before a rebuild. 403: platform access, an exposed API or a denied route; the message names the setting. 409: the worker is starting or rebuilding, or a port / domain conflict.
- The `agentor` MCP tools are missing: platform access isn't `owner`, or the access changed after the last start (`agentor restart`, then start the agent CLI again).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.