Workspace Service
The workspace service is a lightweight HTTP REST sidecar provided by MosBot OS — it is not part of the standard OpenClaw distribution. It runs alongside OpenClaw, shares the same workspace directory or volume, and exposes the workspace filesystem over HTTP so MosBot API can read and write workspace files, manage configuration, and list agents.
You need to run the workspace service container (ghcr.io/bymosbot/mosbot-workspace-service) next
to your OpenClaw instance. See Setting Up OpenClaw for Docker and Kubernetes deployment
examples. :::
What the workspace service provides
- File access: read, create, update, and delete files in agent workspaces
- Directory listing: list files and directories recursively
- Configuration access: read and write
openclaw.json - Agent discovery: list agents defined in
openclaw.json
Architecture
MosBot API
│
│ HTTP (Bearer token auth)
▼
OpenClaw Workspace Service (port 8080)
│
│ Filesystem access
▼
Workspace PVC / directory
(workspace-coo/, workspace-cto/, skills/, shared/, etc.)
In Kubernetes, the workspace service runs as a sidecar container in the OpenClaw pod and shares the same PVC (Persistent Volume Claim). This means it has direct filesystem access to all workspace directories.
Authentication
The workspace service uses bearer token authentication. The token is shared between the workspace
service configuration and MosBot API's OPENCLAW_WORKSPACE_TOKEN environment variable.
Generating a token
WORKSPACE_TOKEN="$(openssl rand -base64 32)"
echo "Save this token: ${WORKSPACE_TOKEN}"
Configure the same token in:
- OpenClaw's workspace service (as
WORKSPACE_SERVICE_TOKENin its environment) - MosBot API's
.env(asOPENCLAW_WORKSPACE_TOKEN)
Security model
The workspace service is designed to be an internal service — not exposed to the public internet:
- Network isolation: in Kubernetes, deploy as a ClusterIP service (no public ingress)
- Bearer token auth: all requests require a valid token
- Path validation: the service normalizes paths and rejects directory traversal attempts (e.g.
..) - RBAC: MosBot API enforces its own role-based access control before proxying requests to the workspace service
Workspace directory structure
A typical OpenClaw workspace layout:
/ ← workspace root
├── workspace-coo/ ← agent workspace (COO agent)
│ ├── memory/ ← agent memory files
│ ├── skills/ ← agent-specific skills