Skip to main content
Workspaces are the storage that survives beyond a single sandbox. For a sandbox-backed agent, a mounted workspace is its filesystem memory — the agent works through the sandbox, and whatever lands under /workspace is still there next run. The main guide is Workspaces. The detailed REST reference is split between Manage Workspaces and Workspace Files. Workspace metadata is managed by the main API. File bytes are served by the storage API, which validates workspace ownership, path safety, upload limits, and storage quota before touching the workspace root.

Management API

Workspace metadata lives on the main API:
Creation returns only after the backing storage root is created. If storage quota or root creation fails, the workspace is not usable and the request fails closed. Workspace lists include both workspaces and an org storage summary.

Mount Into A Sandbox

Mount paths must be /workspace or a subpath under /workspace. Only organization workspaces can be mounted into sandboxes; Personal workspaces are reserved for user files and thread storage.
An agent linked to workspace-runner can use /workspace for durable repo files, generated artifacts, and task notes. Threads preserve conversation context; workspaces preserve files.

Storage API

Workspace file endpoints use the storage service:
They accept the same customer auth style as the control plane: Authorization: Bearer <session-or-api-key> or X-API-Key: <api-key>. List files:
Inspect workspace or path size:
Create a folder:
Upload a file:
Rename a file:
Move or copy multiple files:
Download a file:
Delete files by ID:

Permissions

File APIs require files:read, files:write, files:*, or *. WorkOS dashboard sessions can read and write files for visible workspaces; API keys must carry the required scopes. Personal workspaces are owner/admin scoped and are not mountable into sandboxes. Org workspaces can be mounted at /workspace or a safe subpath under /workspace.

Safety Limits

  • Paths are normalized inside the workspace root. .., null bytes, and escaped paths are rejected.
  • Uploads default to 100 MB unless the deployment config raises the limit.
  • Batch move/copy/delete operations default to 250 files per request.
  • If storage quota is exceeded, write operations return an error and the workspace becomes effectively read-only until usage is reduced or credits are added.
  • Workspace deletion is soft-deleted in metadata and removes the backing storage root. Deleting a workspace that is still mounted or referenced returns WORKSPACE_IN_USE unless the caller confirms with force=true.