AgentConnect
Operate & GovernSandboxing

Mounts

Share host directories with sandboxed agents as read-only, writable, or per-session overlays.

Use sandbox.mounts to expose host directories such as reference data, package caches, or toolchains to sandboxed agents. The daemon mounts the workspace and runtime home automatically.

Mount options

FieldMeaning
sourceExisting host path (~ expands to the daemon user's home)
targetPath inside the sandbox (~ expands to the session home in microsandbox)
modereadonly (default), writable, or overlay
ModeHost filesSession changesStrategies
readonlyReadableNot written through this mountBoth
writableReadable and writableShared with the host and other sessionsBoth
overlayReadablePrivate to each sessionmicrosandbox; read-only under SRT

Paths must be absolute after ~ expansion, and source paths must exist before the daemon starts. Writable mounts require host permissions that let the runtime user write to them (usually UID 10001 inside microsandbox).

sandbox.mounts applies to every sandboxing strategy the daemon enables. If a strategy can't support a configured mount (for example, a different source and target under SRT), that strategy becomes unavailable and reports the validation error as the reason, while the daemon still starts. If you don't plan to use that strategy, disable it (for example, "srt": false). See Configure the daemon.

SRT: share a writable cache

Under SRT, source and target must resolve to the same path:

{
  "sandbox": {
    "mounts": [
      {
        "source": "/srv/agent-cache/pnpm",
        "target": "/srv/agent-cache/pnpm",
        "mode": "writable"
      }
    ],
    "env": {
      "PNPM_CONFIG_STORE_DIR": "/srv/agent-cache/pnpm"
    }
  }
}

SRT mounts only add access. A readonly entry can't revoke write access that a workspace or another writable mount already grants.

microsandbox: map a host directory

microsandbox can mount a host directory at a different path inside the VM:

{
  "sandbox": {
    "mounts": [
      {
        "source": "/srv/reference-data",
        "target": "/reference",
        "mode": "readonly"
      }
    ]
  }
}

Mounts can't overwrite protected runtime paths or map multiple sources to the same target. A nested mount uses its own read/write mode.

microsandbox: share a cache with private writes

Use overlay to reuse a warm host cache while keeping each session's writes isolated:

{
  "sandbox": {
    "mounts": [
      {
        "source": "/srv/agent-cache/pnpm",
        "target": "~/.local/share/pnpm/store",
        "mode": "overlay"
      }
    ],
    "env": {
      "PNPM_CONFIG_STORE_DIR": "${HOME}/.local/share/pnpm/store"
    }
  }
}

The host directory stays read-only. Each session's additions and deletions persist across VM stop/start cycles, then disappear when the VM is rebuilt or removed. Packages downloaded inside a session aren't written back to the shared host cache.

Keep the host cache unchanged while sessions are using it. Overlay sources must be directories, and overlay targets can't overlap other mounts.

Apply configuration changes

sandbox.env sets default environment variables for sandboxed runtimes. Agent and runtime settings can override them, except for daemon-managed HOME, XDG, and security variables. Values are passed literally (in the example above, pnpm itself expands ${HOME}).

Restart the daemon after changing config.json. Environment-only changes take effect when the runtime restarts. Changes to mounts, VM resources, credential layout, or image contents rebuild affected VMs on refresh or next use. Host-mounted files are preserved, while VM-local files, Docker data, and overlay writes are reset.

If you're migrating an older configuration:

  • Replace security.sandboxReadRoots with readonly mounts and security.sandboxWriteRoots with writable mounts (keep source and target equal for SRT).
  • Replace each mount's old readOnly field with mode.
  • Remove the old fields once migrated. The daemon refuses to start if any of them are still present.

How is this guide?

On this page

How is this guide?