Summary
After updating to 2026.3.2, the image tool can no longer read iMessage attachments from their native paths (~/Library/Messages/Attachments/...).
Error
Local media path is not under an allowed directory: /Users/aikoorhon/Library/Messages/Attachments/df/15/0449D7CE-A973-4444-BAD7-514214D5F00A/IMG_3719.png
Root Cause
The image tool validates paths via assertLocalMediaAllowed using roots from getAgentScopedMediaLocalRoots, which only includes:
- System temp dir
~/.openclaw/media/
~/.openclaw/agents/
~/.openclaw/workspace/
~/.openclaw/sandboxes/
- Agent workspace (e.g.
~/clawd/)
~/Library/Messages/Attachments is not in any of these.
The iMessage channel has its own separate attachmentRoots config (default: /Users/*/Library/Messages/Attachments) that correctly validates inbound attachments — but those roots are not passed through to the image tool's localRoots parameter. The two security checks are disconnected.
Steps to Reproduce
- Configure iMessage channel with
includeAttachments: true
- Send an image via iMessage
- Call the
image tool with the path from the inbound message metadata
- →
LocalMediaAccessError: path-not-allowed
Expected Behavior
The iMessage channel's attachmentRoots should be merged into mediaLocalRoots when dispatching to the agent, so the image tool can read inbound attachments from their native Messages paths. This worked before 2026.3.2.
Config
channels.imessage.includeAttachments: true
No explicit attachmentRoots set (using default /Users/*/Library/Messages/Attachments).
Suggested Fix
In the iMessage inbound dispatch path, merge attachmentRoots into the mediaLocalRoots passed to the tool execution context — similar to how other channels handle scoped media roots.
Summary
After updating to 2026.3.2, the
imagetool can no longer read iMessage attachments from their native paths (~/Library/Messages/Attachments/...).Error
Root Cause
The
imagetool validates paths viaassertLocalMediaAllowedusing roots fromgetAgentScopedMediaLocalRoots, which only includes:~/.openclaw/media/~/.openclaw/agents/~/.openclaw/workspace/~/.openclaw/sandboxes/~/clawd/)~/Library/Messages/Attachmentsis not in any of these.The iMessage channel has its own separate
attachmentRootsconfig (default:/Users/*/Library/Messages/Attachments) that correctly validates inbound attachments — but those roots are not passed through to the image tool'slocalRootsparameter. The two security checks are disconnected.Steps to Reproduce
includeAttachments: trueimagetool with the path from the inbound message metadataLocalMediaAccessError: path-not-allowedExpected Behavior
The iMessage channel's
attachmentRootsshould be merged intomediaLocalRootswhen dispatching to the agent, so theimagetool can read inbound attachments from their native Messages paths. This worked before 2026.3.2.Config
channels.imessage.includeAttachments: trueNo explicit
attachmentRootsset (using default/Users/*/Library/Messages/Attachments).Suggested Fix
In the iMessage inbound dispatch path, merge
attachmentRootsinto themediaLocalRootspassed to the tool execution context — similar to how other channels handle scoped media roots.