Repository navigation
Architecture question: How should A2UI handle private images/files from multiple backend systems? #2730
Replies: 2 comments
|
A2UI currently standardizes URLs for outbound media, not a generic attachment or resource handle. In v0.9.1, For a multi-system SuperApp, I would use approach 10 as the external contract and implement approaches 6 or 7 behind it:
For example: {
"component": "PrivateImage",
"resourceId": "res_01K...",
"version": "7",
"description": "Invoice preview"
}The ID should be unguessable and server-bound to the resource, tenant, version, and owning system. It is a locator, not authorization. I would not expose storage URLs, credentials, object keys, or model-controlled system prefixes. This also avoids one component per backend: routing remains server-side rather than becoming part of the model-visible catalog. If you must stay with the Basic Catalog, set For downloads, use the same gateway behind a custom Redirecting reduces gateway bandwidth and keeps signed URLs out of the A2UI transcript, although the browser still sees them. Proxying is preferable for immediate revocation, watermarking, detailed auditing, strict cache control, or when object-store URLs must remain hidden. The gateway can choose per resource classification without changing the A2UI payload. A2UI's FileUpload sample already demonstrates opaque |
|
One additional aspect I would consider is separating resource identification, authorization, and delivery. For a multi-backend architecture, I would avoid making the AI agent responsible for understanding storage providers or generating signed URLs. Instead, I would introduce a centralized resource abstraction:
I would also pay attention to a few security details:
This approach keeps the A2UI payload independent of the underlying storage implementation and makes it easier to integrate additional backend systems without changing the agent's logic. One question I would also consider: does the application need to support revoking access to an already rendered image immediately, or is short-lived access sufficient? That requirement could influence whether redirect-based delivery or backend streaming is the better choice. |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I'm designing a SuperApp based on A2UI, and I'm trying to figure out the right way to handle private images and file attachments coming from multiple existing backend systems .
I searched the A2UI Discussions for topics around images, files, attachments, resources, URLs, and MCP Resources, but I haven't found a discussion that directly addresses this architecture.
I'd appreciate feedback from people who have built or experimented with A2UI in enterprise applications.
Background
We have business systems (A, B, …) with images and attachments stored in object storage (OSS/S3-compatible). In the classic web UI, images are rendered directly via
and attachments are download links — in both cases the business system generates a pre-signed URL on the fly.
We are now integrating these systems into a Generative-UI platform (let’s call it SuperApp), following the A2UI-style philosophy
The problem: if the agent payload contains raw pre-signed URLs, the client renders them as plain text/links instead of images, and we get all the usual problems of URLs in LLM context (token waste, truncation, expiry on session replay). So the question is: what should the payload carry instead, and who resolves it into an actual file download?
More importantly, my SuperApp may eventually integrate many existing backend systems, each with its own storage implementation:
Candidate Approaches
1 No signature
make OSS URLs publicly accessible
2 Long-lived pre-signing + cron
a scheduled job rewrites all URLs in the DB with fresh signed URLs so any query returns accessible links.
3. Sign URLs during SQL/data processing
The business/data layer parses the SQL result and recognizes file fields, then replaces file references with signed URLs before the data reaches the Agent/A2UI layer.
This keeps the Agent relatively simple, but requires the data layer to understand which fields represent files.
4. Agent Skill / MCP file-signing service
expose a file-signing MCP interface, and provide an agent Skill that explains which fields need signing.
5. Replace SQL with file-aware APIs
Stop exposing SQL queries, and instead provide dedicated backend APIs(Rest/GraphQL) that return signed URLs.
6. Stable business URL + redirect
Expose a stable URL from the business system: https://system-a.example.com/files/123
The URL performs authorization and then redirects to a short-lived signed OSS URL
7. Stable business URL + backend proxy
Instead of redirecting, the business backend streams the file.This provides strong control over authorization, auditing, watermarking, etc., but increases backend bandwidth and load.
8. Move files to centralized/local storage
Attachments are stored locally in the business system (NFS or Kubernetes PV), and the URL is the business system's own address.
9. Per-System Client Component
Each business system registers its own file-related client component into the SuperApp's component catalog.
For example, system A registers MyFileA, and system B registers MyFileB. The agent then chooses the appropriate component based on the data context( fileId or address) or an explicit hint from the backend.
10. Globally unique FileId + independent FileServer
Use a globally unique fileId, and let a separate File Server handle permission checks, signed URL generation, redirect, or streaming.
11. System-prefixed FileId / namespace
MyFile parses the prefix
systemfrom the string ID, then uses the trailing local ID to request the corresponding business backend.All reactions