[Feature] Let agents securely read task attachments, including text and images
Problem
Paca task attachments are visible to users and discoverable by agents through the Paca MCP tools, but the agent cannot consume their actual contents.
In a smoke test on a self-hosted Paca instance, an agent could:
- read the task and its activity history;
- list an attached
.txtfile and.pngimage; - obtain attachment metadata and presigned download URLs.
However, the agent runtime had no HTTP/file-content tool that could download and parse those URLs. It therefore could not read the text file or understand the image. This makes attachments unusable in common workflows such as bug reports with screenshots, requirements with PDFs, or logs/configuration files attached to a task.
Expected behavior
Paca should expose a first-class, permission-aware attachment-reading capability to agents. For example:
read_attachment(attachment_id)for supported textual files;- extracted text for Markdown, plain text, office documents and PDFs;
- image input for multimodal models, with an OCR fallback where appropriate;
- clear capability/error reporting when a model or file type is unsupported.
Paca should remain responsible for resolving the attachment, checking project/task permissions, enforcing size and MIME-type limits, and auditing access. The underlying extraction or vision implementation may remain pluggable.
Suggested design
- Resolve attachments by ID rather than asking an agent to fetch an arbitrary URL.
- Validate that the current agent can access the owning project/task.
- Enforce configurable size, MIME-type, timeout and extraction limits.
- Return structured content (
text,image,unsupported,too_large, etc.). - Pass images to a vision-capable model only when the configured provider/model supports them.
- Record attachment access in an auditable activity/log without exposing storage credentials.
Acceptance criteria
- An agent mentioned on a task can read the body of a small text attachment and quote a unique value from it.
- With a vision-capable model, the agent can describe or extract text from a PNG/JPEG attached to that task.
- An agent without access to the task cannot read the attachment by ID or presigned URL.
- Unsupported/oversized files produce an explicit error instead of silently exposing only metadata.
- The feature works for both UI-started conversations and task-comment-triggered agent sessions.
Why this belongs in Paca
Paca owns the relationship among project, task, comment, agent and attachment. Implementing this independently in every agent or MCP client would duplicate authorization and security logic and would make attachment behavior inconsistent across providers.
Thanks for detailing this issue so clearly. I'll pick this up and implement the feature soon!
