Skip to main content
Every agent runs in a filesystem sandbox. The platform gives each agent session the same three mount points and controls who can see whose files. This is the filesystem and process side of agent isolation: an agent works in its own space and cannot reach another agent’s working tree.

The three standard mounts

Every agent session gets exactly these three, and no others. Products cannot add mount points; they only configure the scope of /workspace (below). Read-only mounts are enforced at the filesystem level: an agent cannot write to /data or /opt/swarm/contracts. The runtime never varies these mounts by memory, model, or anything else; the workspace class is the only thing that changes /workspace.
Runtime-owned host storage, such as the artifact repository (/var/lib/swarm/artifacts, SWARM_ARTIFACT_ROOT) written by artifact_repo_commit, is not one of these mounts and is never exposed to agents. Agents reach committed artifacts only through opaque swarm-artifact:// URLs, never a raw host path.

Isolation: per-agent vs per-flow-instance

The one configurable dimension is the scope of /workspace:
  • per-agent gives each agent its own private /workspace, invisible to every other agent. Use it when an agent’s working files are its own business.
  • per-flow-instance shares one /workspace among all agents in the same flow instance, and isolates it from other instances. Use it when collaborators on the same item need a shared scratch space (one fulfillment instance’s agents share files; a different order’s instance cannot see them).
The guarantees the runtime enforces: a per-agent workspace is never visible to another agent; a per-flow-instance workspace is visible only to agents in that instance. /data and /opt/swarm/contracts are always global and read-only regardless of class.

Choosing the scope: workspace_classes

You declare workspace classes in policy.yaml and reference one from an agent. Each class sets the /workspace scope; that is the only thing a class controls.
policy.yaml
Every workspace_class an agent names must be defined here, or boot fails (workspace_class_exists). At boot the platform also checks that /data is readable, that contracts are loaded, and that each agent’s /workspace can be created at its declared scope; it aborts if any mount cannot be satisfied.

Lifecycle

/workspace lifecycle follows the scope and the agent’s memory setting:
  • per-agent: created when the agent is registered, cleaned up when the agent terminates. It persists across turns for memory: true agents, and is ephemeral per task for memory: false.
  • per-flow-instance: created when the instance is created, and preserved when the instance terminates (for post-mortem). Nothing cleans it up automatically.

Deployment and configuration

Mount paths are invariant: /workspace, /data, and /opt/swarm/contracts are the same on a laptop, in Docker, and in production. Only the backing storage changes. A contract that runs on local dev runs on Docker and production without changes.

Docker backing (the claude_cli runtime)

When the runtime spawns containers (the Claude CLI runtime, selected with --backend claude_cli), it creates one per workspace from a base image, on a shared network, and reuses it by name. The defaults are overridable. These Docker-backing variables are read from the process environment — they are deployment settings, not swarm.yaml keys.
The base image must actually contain the agent CLI for the claude_cli runtime to work. If the image is missing, the runtime builds one from Dockerfile.workspace, but that build does not install the CLI by default, so agent turns fail with exit 127 ("claude": not found) until you build the image with the CLI included. Once an image or a named container exists, it is reused as-is. See Running the runtime.

Container identity

Platform-created containers are labeled so recovery and reset tools identify them by label, not by name guessing.
  • Kinds: scaffold, system, entity, agent, flow. Filter with docker ps --filter label=dev.swarm.container.kind=agent.
  • Names: per-agent workspaces are swarm-agent-<id>; per-flow-instance workspaces are swarm-flow-<path>.
  • Labels: dev.swarm.owner, dev.swarm.container.kind, dev.swarm.reset.eligible, plus lineage (dev.swarm.run_id, dev.swarm.entity_id, dev.swarm.agent_id, dev.swarm.flow_instance).

Agents and sessions

Session scoping and conversation modes, the other half of agent isolation.

Policy

Where workspace_classes and permission_bundles are declared.