adapter

A command for running and connecting to the Crabbox adapter, a small service that creates and stops isolated workspaces. It supports authenticated local connections and configured providers.

In plain words
What is it for?
Use it to start the adapter service, expose its local HTTP or Unix-socket endpoint, connect clients, manage workspaces, and enforce provider, browser, desktop, and override settings.
Why use it?
It centralizes workspace lifecycle control so a trusted interface or automation service does not need provider-specific logic. Its options also limit concurrency and which workspace features can be used.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/crabbox/adapter
Clone the repo
git clone --depth 1 https://github.com/openclaw/crabbox
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,313 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.06313
Opus 5 $0.00000 $0.03157
Sonnet 5 $0.00000 $0.01263
Haiku 4.5 $0.00000 $0.00631

Measured 2d ago against content hash c1b3108860d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

adapter scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

execution of that root-owned helper; it does not grant general sudo access. It
docs/commands/adapter.md · 566 lines

How it starts

The opening of the file, as written. The whole thing — 566 lines — stays where its author put it; the contents beside it link to each section on GitHub.

adapter

See Runtime adapter stack for the end-to-end topology, trust boundaries, startup order, and failure signals for adapter serve, adapter ingress, and adapter connect.

crabbox adapter serve exposes a small authenticated HTTP service that creates and stops Crabbox workspaces. It is intended for a trusted fleet UI or automation service that should use normal Crabbox provider configuration rather than embed provider-specific lifecycle logic.

The adapter host must run Linux or macOS. adapter serve exits with a clear unsupported-platform error on every other host OS. Windows workspaces remain supported as guests through providers that support them.

install -d -m 700 "$HOME/.local/run/crabbox"
crabbox adapter serve \
  --listen 127.0.0.1:8787 \
  --unix-socket "$HOME/.local/run/crabbox/adapter.sock" \
  --token-file ~/.config/crabbox/adapter.token \
  --state-file ~/.local/state/crabbox/adapter/state.json \
  --config ~/.config/crabbox/adapter.yaml \
  --provider external \
  --id mac-lab \
  --profile public-desktop \
  --forbid-class-override \
  --forbid-server-type-override \
  --max-concurrent 2 \
  --allow-desktop \
  --allow-browser \
  --attach-url-template 'wss://terminal.example.test/workspaces/{workspaceId}'

The listen address defaults to 127.0.0.1:8787. Put the service behind an authenticated HTTPS proxy before exposing it beyond loopback. The token file is required, must be a regular non-symlink file with mode 0600, and contains one bearer token. The adapter opens it once with no-follow semantics, validates that handle, and bounds the read to 8 KiB. Tokens are never accepted on argv. The state directory must be owned by the current user and not writable by group or others. The exclusive lock is opened relative to that verified directory with no-follow semantics, then its exact descriptor is checked for ownership, type, and private mode before the kernel lock is acquired.

--unix-socket adds a second listener for adapter connect; it does not replace --listen. Its existing parent directory must be owned by the current user and not writable by group or others. The adapter refuses to replace a foreign or non-socket path, removes only a stale current-user-owned socket, and installs the live socket with mode 0600. The outbound connector accepts only this Unix transport and verifies the server peer UID before sending the local bearer token.

Set --id to the same stable DNS-style ID used by crabbox adapter connect when the adapter is connected outbound to a coordinator. Child lifecycle commands then register both that adapter ID and the exact workspace ID with the coordinator. The portal can send Delete through the live relay. After the adapter proves stable provider absence, it sends an owner-scoped completion for that exact pending adapter/workspace registration generation before completing matching local-state cleanup. Each local claim persists a fresh registration ID; the coordinator retains it across refreshes and rejects stale completion retries after a later generation becomes active. If the coordinator record expires while the provider workspace remains live, the CLI rotates the persisted ID only after that explicit stale-generation rejection and retries registration. The old acknowledged ID remains durable beside the pending replacement until the replacement succeeds; confirmed-absence cleanup can safely try both after a crash or lost response. A workspace that never persisted a registration ID uses the legacy metadata-release cleanup path only after the coordinator confirms that its exact adapter/workspace binding also has no registration generation. Missing or malformed generation-aware claim state fails closed. Registration must return that exact adapter/workspace/registration binding before the workspace can become ready; a failed or mismatched registration instead enters exact-identity provider cleanup. Without --id, registered leases retain the metadata-only removal behavior.

Read the full file on GitHub · 566 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 566 lines · 0 tokens per session scan B c1b3108860d9

Subscribe to this mod's changes

adapter is a command published in the GitHub repository openclaw/crabbox (1,343 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,313 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.