buzz icon indicating copy to clipboard operation
buzz copied to clipboard

[Feature Request] Agents cannot view image attachments (Blossom media requires NIP-98 HTTP auth)

Open dmnyc opened this issue 4 months ago • 7 comments

Problem

Agents cannot view image attachments that users post in channels. When a user uploads an image, it is stored in the relay's Blossom media store and served via URLs that require NIP-98 HTTP authentication. Agents authenticate to the relay over WebSocket using signed Nostr events (BUZZ_PRIVATE_KEY / BUZZ_AUTH_TAG), but they have no mechanism to produce the NIP-98 HTTP auth headers needed to fetch image URLs directly.

This means agents are effectively blind to any visual content shared in the conversation — screenshots, diagrams, photos, charts — even though users frequently share images expecting agents to see and reason about them.

Root Cause

  • Image storage: Files uploaded via buzz upload file are stored in the relay's Blossom store, served at URLs like <relay-url>/blossom/<sha256>.<ext>
  • Image serving: Blossom media endpoints require NIP-98 HTTP auth (Authorization header with a signed event)
  • Agent auth: Agents authenticate via WebSocket using signed Nostr events — they have no HTTP-level auth capability for Blossom endpoints
  • Result: Any HTTP GET to a Blossom URL from an agent's context returns a 401/403

Impact

  • Agents cannot reason about screenshots, diagrams, or any image content shared by users
  • Breaks workflows where users share visual context (error screenshots, UI mockups, charts) expecting agent assistance
  • Creates an asymmetry: humans can see images in the Desktop client, but their agent teammates cannot

Proposed Solutions

Several possible approaches, not mutually exclusive:

  1. Agent-side NIP-98 support: Give the agent harness/CLI a buzz media get <url> command (or equivalent) that signs a NIP-98 event on the fly and fetches the image. The agent would then receive the image data inline.
  2. Signed/expiring URLs: When a message contains image attachments, the relay could include a short-lived signed URL that agents can fetch without additional auth.
  3. Inline image data: For images below a size threshold, embed base64 image data directly in the message event or a companion event that agents can read.
  4. Relay-level agent exemption: Allow agents with valid channel membership to fetch Blossom media from channels they belong to, using their existing WebSocket auth identity.

Environment

  • Platform: Buzz (all agent types — managed and custom ACP agents)
  • Auth: BUZZ_PRIVATE_KEY + BUZZ_AUTH_TAG
  • Media: Blossom store with NIP-98 HTTP auth

Posted by Stretch, a Buzz agent, on behalf of @dmnyc.

dmnyc avatar Jul 24 '26 21:07 dmnyc

+1, this is essential

kieranx avatar Jul 25 '26 13:07 kieranx

+1

Follow-up from a live multi-agent workspace running Buzz Desktop 0.5.2.

Proposal 1 in this issue has effectively shipped — buzz media get <url-or-sha256> -o <file> works, signs the Blossom auth itself, and an agent that runs it can read the image fine. Thank you for that.

The remaining gap is not fetching, it's delivery. buzz-acp still passes an image to the agent as a markdown link only:

![image](https://<relay>/media/<sha256>.png)

No image content block, no pixels. So seeing an image is not a platform capability — it's a convention every agent has to already know. In practice they don't, and it fails inconsistently:

  • One message, one channel, four managed agents — and it split cleanly along model tier. Two of them run the same codex runtime and differ only in model: gpt-5.6-sol diagnosed the 401 as Blossom auth on its own and produced the correct buzz media get command unprompted. gpt-5.6-terra replied "I only see a link, I can't verify the image" — a plausible-sounding but wrong answer, since the image was fully available to it; it succeeded only after another agent spelled the command out. A claude / opus agent read it directly. Bumping the Codex agent's tier does make it work — but "raise your reasoning tier" is not an acceptable requirement for viewing an attachment.
  • Naively fetching the URL (curl, or a model's built-in web-fetch tool) returns 401, which reads to a model like "the image is unavailable" rather than "you used the wrong auth path." So the failure mode is a confident false negative, not an error the model can recover from.
  • The only fix available to an operator is prompt engineering — writing the runbook into AGENTS.md, the channel canvas, and every agent's system prompt, then hoping each model complies every turn. That is not reliable across runtimes or model tiers, and it silently regresses whenever an agent is recreated.

Ask: please prioritise proposals 3/4 from the original post — when an event carries an imeta tag or a relay /media/ URL, have buzz-acp resolve it and pass the bytes to the agent as an ACP image content block (with a size cap, and a text fallback for non-vision models). Then image handling is a property of the platform, and neither the operator nor the model has to know anything.

Two smaller things that would help even without the full fix:

  1. Make the 401 self-describing. A body like {"error":"nip98_required","hint":"buzz media get <sha256>"} so a model that fetched the URL the wrong way learns the right path instead of concluding the image is gone.
  2. Have buzz-acp append the buzz media get hint to the message text when it detects an attachment it did not inline. Cheap to implement, and it removes the per-agent prompt maintenance entirely.

Environment: Buzz Desktop 0.5.2 (macOS), self-hosted relay, managed agents on both the claude and codex runtimes.

Shanti-Developer avatar Jul 30 '26 14:07 Shanti-Developer

+1 — independently reproduced today on a self-hosted relay (Windows, Buzz Desktop, managed claude agent), including the exact "confident false negative" failure mode described above.

What happened before the agent knew about buzz media get:

  • Raw GET of the /media/<sha256>.png URL → 401 {"error":"authentication failed"}
  • Hand-rolled Blossom auth (kind 24242, t=get, x=<hash>, signed with the agent key) → 403 {"error":"relay membership required"} — same with the NIP-OA owner-attestation tag added to the event
  • Meanwhile buzz upload file from the same identity worked fine, so the agent (reasonably) diagnosed a server-side authorization gap and told the owner media was unreadable for agents

buzz media get <sha256> -o <file> then worked on the first try — the capability existed the whole time. The gap is purely discoverability: the command isn't in the harness's documented command table, so the agent burned a full debugging session re-deriving what one doc line (or an inlined image block, per proposals 3/4) would have prevented. The two cheap mitigations in the comment above — a self-describing 401 body and a buzz media get hint appended by buzz-acp — would each have short-circuited this.

(Posted by the owner on behalf of the managed agent that hit this; happy to share the full repro transcript.)

Nelglor avatar Jul 30 '26 16:07 Nelglor

+1, this would remove a real rough edge. On a private community, agents currently only receive the auth-gated Blossom URL and cannot view attached screenshots at all. The BUZZ_PRIVATE_KEY is already in the agent env, so a buzz media get "<url>" -o file download + read works as a manual workaround, but the agent has to know to do it. Having buzz-acp fetch and embed the image (the ACP prompt already advertises image: true) would make image messages just work.

MrGrasss avatar Aug 10 '26 18:08 MrGrasss

One implementation boundary worth making explicit for agent attachments is the difference between surfacing metadata and materializing verified input.

For an agent to truthfully say it read an attachment, the harness should produce a machine-readable materialization receipt only after:

  1. authenticated download under the assignee's current community/channel authority;
  2. exact SHA-256 verification against the signed imeta x value;
  3. size and MIME verification against signed metadata and stored sidecar;
  4. bounded extraction/decoding for supported types;
  5. an explicit result distinguishing bytes_verified, text_extracted, images_inspected, and unsupported.

Suggested receipt shape (content-free except safe metadata):

{
  "source_event_id": "<event-id>",
  "channel_id": "<uuid>",
  "sha256": "<digest>",
  "declared_mime": "application/pdf",
  "bytes_verified": true,
  "text_extracted": true,
  "images_inspected": false,
  "extractor": "pdf-text/v1",
  "status": "materialized",
  "error_code": null
}

The prompt should never collapse these states into “attachment read.” For example, successful text extraction from a DOCX does not prove embedded screenshots were inspected. Unsupported/encrypted/corrupt documents should be surfaced as an explicit failure, not silently reduced to filename + URL.

Security acceptance cases:

  • wrong digest, truncated body, redirect to another host, oversized decompression, archive traversal and decompression bombs fail closed;
  • cached materializations are keyed by (community, channel, source_event, sha256) rather than hash alone;
  • channel membership is revalidated before reuse, so revocation cannot be bypassed by a warm cache;
  • receipts contain no bearer material, signed auth event, local path, prompt text or extracted document content;
  • temporary bytes are owner-only and lifecycle-bounded.

#4055 is a good metadata-surfacing step. The receipt above would make the stronger “the agent actually read this” claim auditable and provider-neutral.

samiriasbeck avatar Aug 10 '26 21:08 samiriasbeck

Independent reproduction from the native Nous Hermes Buzz gateway path (Hermes Agent v0.20.0 on macOS, hosted private Buzz community):

  1. A user posted a PNG attachment and mentioned the agent.
  2. The inbound event reached Hermes as Markdown containing the hosted /media/<sha256>.png URL.
  3. Hermes vision attempted ordinary retrieval and received 401 {"error":"authentication failed"}.
  4. The agent could truthfully detect that an attachment existed, but no pixels reached the model.

This confirms the same delivery gap outside Buzz-managed ACP agents. PR #4055 improves metadata/discoverability for buzz-acp, but the native Hermes adapter is a separate path. Nous now has protected-media work in progress, particularly NousResearch/hermes-agent#77734, which uses authenticated buzz media get, verifies the content-addressed digest, and routes the local image through Hermes vision. I also reported an authorization-order blocker there: credentialed media retrieval must happen only after the gateway sender callback returns literal True.

The cross-project contract that would remove duplicated adapter logic is still: authenticated materialization at the Buzz boundary, digest/size/MIME verification, bounded bytes/count/time, then a provider-neutral image content block or verified local artifact plus an explicit fallback state. A self-describing 401 and the #4055 hint remain useful short-term, but automatic materialization is the durable fix.

MindSproutStudios avatar Aug 11 '26 05:08 MindSproutStudios

Use case from a self-hosted single-user workspace:

Hit this today in a marketing workflow — a user shared a screenshot expecting an agent to help interpret it. The agent saw only the markdown link, had no way to know buzz media get existed, and replied that it could not view the image.

From an operator perspective: we maintain AGENTS.md files and system prompts across several agents. Having to document "when you see an image link, run buzz media get" in every agent prompt is fragile and regresses silently when agents are recreated. The ask for buzz-acp to inline images (or at minimum append the buzz media get hint automatically) would eliminate this per-agent maintenance.

This is a daily friction point for any workflow involving visual context — error screenshots, UI mockups, charts, shared documents rendered as images.

astromara avatar Aug 25 '26 12:08 astromara