openclaw - 💡(How to fix) Fix [Feature]: Allow writable custom binds with workspaceAccess: "none" for least-privilege sandbox access [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59718Fetched 2026-04-08 02:41:26
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Allow sandboxed agents to edit explicitly writable custom bind mounts while workspaceAccess remains "none".

Root Cause

Allow sandboxed agents to edit explicitly writable custom bind mounts while workspaceAccess remains "none".

Fix Action

Fix / Workaround

  • workspaceAccess: "none" keeps /workspace isolated and disposable
  • custom binds remain the source of truth for explicitly exposed real files/directories
  • if a custom bind is mounted :rw, normal file tools (write, edit, apply_patch, etc.) can modify files on that bind
  • if a custom bind is mounted :ro, file tools can read it but cannot modify it
  • writes outside writable binds remain blocked
  • /workspace remains read-only or sandbox-local according to existing workspaceAccess: "none" semantics
  • no reserved-target override is needed as long as custom binds target neutral paths such as /persona, /projects, /memory, /history

Code Example

{
  agents: {
    defaults: {
      sandbox: {
        mode: "all",
        scope: "session",
        workspaceAccess: "none",
        docker: {
          dangerouslyAllowExternalBindSources: true,
          binds: [
            "/home/user/.openclaw/workspace/AGENTS.md:/persona/AGENTS.md:rw",
            "/home/user/.openclaw/workspace/SOUL.md:/persona/SOUL.md:rw",
            "/home/user/.openclaw/workspace/HEARTBEAT.md:/persona/HEARTBEAT.md:rw",
            "/home/user/.openclaw/workspace/projects:/projects:rw",
            "/home/user/.openclaw/workspace/memory:/memory:rw",
            "/home/user/.openclaw/agents/main/sessions:/history/sessions:ro"
          ]
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Allow sandboxed agents to edit explicitly writable custom bind mounts while workspaceAccess remains "none".

Problem to solve

I want to keep the main agent workspace isolated so the sandbox cannot write broadly to the real workspace, but I still need the agent to modify a small, explicit subset of real files.

My target model is:

  • workspaceAccess: "none" so /workspace remains the isolated sandbox working area
  • explicit docker.binds for only the files/directories the agent actually needs
  • writable binds for selected persona/bootstrap/project/memory files
  • read-only binds for sensitive or historical data such as session logs/history

Today this is blocked in practice for two reasons:

  1. In the current implementation, normal file tools appear to require workspaceAccess: "rw" for writes, even if the resolved target is on a writable custom bind.
  2. The overall bind behavior is difficult to use for least-privilege access to real files, especially when those files live under the normal OpenClaw state tree.

That forces an undesirable choice:

  • either use workspaceAccess: "rw" and grant broad write access to the real workspace
  • or use workspaceAccess: "none" and lose the ability to modify the specific real files the agent actually needs through normal file tooling

Proposed solution

Support a least-privilege sandbox mode where:

  • workspaceAccess: "none" keeps /workspace isolated and disposable
  • custom binds remain the source of truth for explicitly exposed real files/directories
  • if a custom bind is mounted :rw, normal file tools (write, edit, apply_patch, etc.) can modify files on that bind
  • if a custom bind is mounted :ro, file tools can read it but cannot modify it
  • writes outside writable binds remain blocked
  • /workspace remains read-only or sandbox-local according to existing workspaceAccess: "none" semantics
  • no reserved-target override is needed as long as custom binds target neutral paths such as /persona, /projects, /memory, /history

Example desired config shape:

{
  agents: {
    defaults: {
      sandbox: {
        mode: "all",
        scope: "session",
        workspaceAccess: "none",
        docker: {
          dangerouslyAllowExternalBindSources: true,
          binds: [
            "/home/user/.openclaw/workspace/AGENTS.md:/persona/AGENTS.md:rw",
            "/home/user/.openclaw/workspace/SOUL.md:/persona/SOUL.md:rw",
            "/home/user/.openclaw/workspace/HEARTBEAT.md:/persona/HEARTBEAT.md:rw",
            "/home/user/.openclaw/workspace/projects:/projects:rw",
            "/home/user/.openclaw/workspace/memory:/memory:rw",
            "/home/user/.openclaw/agents/main/sessions:/history/sessions:ro"
          ]
        }
      }
    }
  }
}

Desired behavior:

  • the agent can modify /persona/, /projects/, and /memory/*
  • the agent can read but not modify /history/sessions/*
  • the agent cannot broadly write to the real workspace
  • the main sandbox working directory stays isolated

Alternatives considered

Alternatives considered

  • workspaceAccess: "rw"
    • Works functionally, but grants much broader write access than desired.
  • workspaceAccess: "none" with exec-only writes through shell commands
    • Reduces friction in some cases, but does not solve the core least-privilege sandboxing need.

Impact

Affected: operators using Docker sandboxes who want real-file access without broad real-workspace write permissions Severity: High for hardened/self-hosted deployments Frequency: Always when trying to combine isolation with selective persistence Consequence: Either overexpose the real workspace with rw, or accept a sandbox that cannot edit the specific persistent files it needs

Evidence/examples

Related docs and issues suggest this is adjacent to existing user needs:

A likely implementation path would be to make file-tool write authorization depend on the resolved target mount’s writability, not only on workspaceAccess === "rw".

Additional information

This request is specifically about a safer least-privilege model:

  • keep the default working area isolated
  • expose only explicitly approved real files
  • preserve RO/RW semantics per bind
  • avoid forcing broad writes to the canonical workspace just to let the agent update a few persistent files

extent analysis

TL;DR

To achieve least-privilege sandboxing, modify the file-tool write authorization to depend on the resolved target mount's writability, rather than solely on workspaceAccess being "rw".

Guidance

  1. Review the proposed solution: The suggested approach involves supporting a least-privilege sandbox mode where workspaceAccess is set to "none", and custom binds are used to expose explicitly approved real files/directories.
  2. Update file-tool write authorization: Modify the write authorization logic to check the writability of the resolved target mount, rather than relying solely on workspaceAccess being "rw".
  3. Configure custom binds: Set up custom binds with the desired read-write permissions, as shown in the example configuration, to control access to specific files and directories.
  4. Test the implementation: Verify that the agent can modify files on writable binds, read but not modify files on read-only binds, and cannot write to the real workspace outside of the explicitly exposed files/directories.

Example

The example configuration provided in the issue body demonstrates how to set up custom binds with read-write permissions:

{
  "agents": {
    "defaults": {
      "sandbox": {
        "mode": "all",
        "scope": "session",
        "workspaceAccess": "none",
        "docker": {
          "dangerouslyAllowExternalBindSources": true,
          "binds": [
            "/home/user/.openclaw/workspace/AGENTS.md:/persona/AGENTS.md:rw",
            "/home/user/.openclaw/workspace/SOUL.md:/persona/SOUL.md:rw",
            "/home/user/.openclaw/workspace/HEARTBEAT.md:/persona/HEARTBEAT.md:rw",
            "/home/user/.openclaw/workspace/projects:/projects:rw",
            "/home/user/.openclaw/workspace/memory:/memory:rw",
            "/home/user/.openclaw/agents/main/sessions:/history/sessions:ro"
          ]
        }
      }
    }
  }
}

Notes

This solution assumes that the custom binds are properly configured and that the file-tool write authorization logic is updated to support the least-privilege sandbox mode.

Recommendation

Apply the proposed workaround by modifying the file-tool write authorization to depend on the resolved target mount's writability, rather than solely on workspaceAccess being "rw", to achieve the desired least-privilege sandboxing behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING