Skip to content

Bug: image tool allowed-path list doesn't inherit channels.imessage.attachmentRoots #79975

@Nickanbe

Description

@Nickanbe

Summary

When an iMessage attachment is passed to the image tool via a local path (e.g. /Users/.../Library/Messages/Attachments/...), the tool rejects it with:

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

Config

The iMessage channel is correctly configured with attachmentRoots:

"channels": {
  "imessage": {
    "includeAttachments": true,
    "attachmentRoots": ["/Users/straylight/Library/Messages/Attachments"]
  }
}

Expected Behavior

The image tool (and other media tools) should recognize paths under channels.imessage.attachmentRoots as allowed. The iMessage plugin has already been granted operator-level trust for that directory via attachmentRoots — the image tool's path validation should inherit that trust rather than enforcing a separate, narrower allowlist.

Actual Behavior

The image tool enforces its own hardcoded allowed-path list that does not include the Messages Attachments directory, even when attachmentRoots is explicitly configured.

Impact

iMessage attachments (photos, screenshots) cannot be analyzed by the agent using the image tool. The workaround is to share images via URL or copy them to the workspace manually, which defeats the purpose of includeAttachments: true.

Suggested Fix

When building the image tool's allowed-path set, include paths from channels.<channel>.attachmentRoots for any enabled channel with attachment support.

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