Skip to content

iMessage attachments blocked by local media path allowlist #60046

@Cuttingwater

Description

@Cuttingwater

Summary

When an iMessage includes an image attachment, the agent attempts to analyze it via the image tool. The attachment path points to ~/Library/Messages/Attachments/..., which is not in the hardcoded media local roots. This causes a LocalMediaAccessError: path-not-allowed and the agent cannot process any iMessage image attachments.

Environment

  • OpenClaw version: 2026.4.1 (da64a97)
  • Channel: iMessage
  • OS: macOS (Darwin 25.4.0 arm64)

Error

[tools] image failed: Local media path is not under an allowed directory: 
/Users/.../Library/Messages/Attachments/.../file.pluginPayloadAttachment

Root Cause

buildMediaLocalRoots() in web-media-CkaAIY0r.js only allows:

  • Preferred tmp dir
  • ~/.openclaw/media
  • ~/.openclaw/workspace
  • ~/.openclaw/sandboxes

There is no config option to add additional allowed paths, and the iMessage channel plugin does not copy attachments into an allowed directory before passing them to tools.

Suggested Fix

Either:

  1. Config option: Add a tools.media.localRoots (or similar) config key to allow users to add custom allowed directories
  2. Channel-level fix: Have the iMessage channel plugin copy attachments into ~/.openclaw/media/ before passing them to tools
  3. Automatic widening: When a channel plugin provides an attachment path, automatically add that path's parent to the allowed roots for that tool invocation

Option 2 seems safest - the channel plugin already knows about the attachment and can stage it.

Version

OpenClaw 2026.4.1 (commit da64a97)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions