Skip to content

Feature: configurable mediaLocalRoots for image tool #47856

Description

@chad42777

Problem

The image tool only allows reads from a fixed set of directories (~/.openclaw/workspace/, sandbox paths). There is no way to configure additional allowed roots.

This is a problem for iMessage users with includeAttachments: true. Attachment paths arrive as something like:

/Users/<user>/Library/Messages/Attachments/xx/xx/<uuid>/image.png

...which is outside the allowed roots. The image tool rejects it with:

Local media path is not under an allowed directory: /Users/.../Messages/Attachments/...

Workaround

Manually cp the attachment into the workspace before calling the image tool. This works but requires an explicit copy step on every inbound image — easy to forget and creates friction.

Request

Add a tools.image.mediaLocalRoots (or similar) config field to openclaw.json that allows extending the allowed directory list:

{
  tools: {
    image: {
      mediaLocalRoots: [
        "/Users/openclaw/Library/Messages/Attachments"
      ]
    }
  }
}

This would let attachment-heavy workflows (iMessage, etc.) work without a copy step.

Context

  • Channel: iMessage (imsg CLI integration)
  • Config: includeAttachments: true
  • Version: 2026.3.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions