openclaw - 💡(How to fix) Fix [Feature]: Granular `tool.fs.workspaceOnly` configuration per tool [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#52793Fetched 2026-04-08 01:19:19
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Author
Participants
Timeline (top)
labeled ×1

tool.fs.workspaceOnly is currently a single global boolean for filesystem tools.
When set to true, it restricts all fs-related tools (including read operations) to the workspace root. In real-world setups, this is too coarse-grained. We often need:

  • strict restrictions for write/edit/patch operations, but
  • selective read access outside workspace (e.g. shared/global skill directories).

Root Cause

tool.fs.workspaceOnly is currently a single global boolean for filesystem tools.
When set to true, it restricts all fs-related tools (including read operations) to the workspace root. In real-world setups, this is too coarse-grained. We often need:

  • strict restrictions for write/edit/patch operations, but
  • selective read access outside workspace (e.g. shared/global skill directories).

Fix Action

Fix / Workaround

tool.fs.workspaceOnly is currently a single global boolean for filesystem tools.
When set to true, it restricts all fs-related tools (including read operations) to the workspace root. In real-world setups, this is too coarse-grained. We often need:

  • strict restrictions for write/edit/patch operations, but
  • selective read access outside workspace (e.g. shared/global skill directories).

Please support per-tool (or per-operation) workspace policy, for example:

  • read / read_file
  • search
  • write / write_file
  • edit / apply_patch A possible direction:
{
  "tools": {
    "fs": {
      "workspaceOnly": {
        "default": true,
        "read": false,
        "search": false,
        "write": true,
        "edit": true,
        "apply_patch": true
      }
    }
  }
}

This would enable safer practical deployments:

  • keep write/edit strictly confined to workspace
  • allow controlled read access to shared resources (skills, docs, templates, etc.)
  • avoid custom plugin-level workarounds for a common policy need

Code Example

{
  "tools": {
    "fs": {
      "workspaceOnly": {
        "default": true,
        "read": false,
        "search": false,
        "write": true,
        "edit": true,
        "apply_patch": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

tool.fs.workspaceOnly is currently a single global boolean for filesystem tools.
When set to true, it restricts all fs-related tools (including read operations) to the workspace root. In real-world setups, this is too coarse-grained. We often need:

  • strict restrictions for write/edit/patch operations, but
  • selective read access outside workspace (e.g. shared/global skill directories).

Problem to solve

With the current all-or-nothing behavior:

  • If workspaceOnly = true: safety is good for writes, but valid read use cases break.
  • If workspaceOnly = false: reads work, but write/edit protections are weakened. This creates a security-vs-usability tradeoff that should not be necessary.

Proposed solution

Please support per-tool (or per-operation) workspace policy, for example:

  • read / read_file
  • search
  • write / write_file
  • edit / apply_patch A possible direction:
{
  "tools": {
    "fs": {
      "workspaceOnly": {
        "default": true,
        "read": false,
        "search": false,
        "write": true,
        "edit": true,
        "apply_patch": true
      }
    }
  }
}

Alternatives considered

  • per-tool allow/deny outside workspace
  • optional allowlisted external paths for read/search

Impact

This would enable safer practical deployments:

  • keep write/edit strictly confined to workspace
  • allow controlled read access to shared resources (skills, docs, templates, etc.)
  • avoid custom plugin-level workarounds for a common policy need

Evidence/examples

No response

Additional information

Thanks for considering this enhancement.

extent analysis

Fix Plan

To implement per-tool workspace policy, follow these steps:

  • Update the configuration to support per-operation workspace policies:
{
  "tools": {
    "fs": {
      "workspaceOnly": {
        "default": true,
        "read": false,
        "search": false,
        "write": true,
        "edit": true,
        "apply_patch": true
      }
    }
  }
}
  • Modify the tool.fs.workspaceOnly check to use the per-operation policy:
def check_workspace_only(operation):
    config = get_config()
    workspace_only = config["tools"]["fs"]["workspaceOnly"]
    return workspace_only.get(operation, workspace_only["default"])
  • Use the check_workspace_only function to enforce workspace policies for each operation:
if operation == "read":
    if not check_workspace_only("read"):
        # allow read outside workspace
        pass
elif operation == "write":
    if not check_workspace_only("write"):
        # deny write outside workspace
        raise Exception("Write operation not allowed outside workspace")
  • Update the code to handle each operation separately, using the check_workspace_only function to determine the workspace policy.

Verification

To verify the fix, test each operation with the updated configuration:

  • Set workspaceOnly.read to false and verify that read operations are allowed outside the workspace.
  • Set workspaceOnly.write to true and verify that write operations are denied outside the workspace.

Extra Tips

  • Consider adding additional logging or monitoring to track workspace policy violations.
  • Review the configuration and code changes to ensure they align with the desired security and usability tradeoffs.

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

openclaw - 💡(How to fix) Fix [Feature]: Granular `tool.fs.workspaceOnly` configuration per tool [1 participants]