Summary
Enable users to upload files to agents through external channels (Telegram, Slack, public chat links). Files are stored in the agent workspace and the agent is notified via chat message.
Architecture Decisions
Storage Model
- Shared space: All uploads go to
/home/developer/uploads/ regardless of user
- Agent instructions (CLAUDE.md) decide how to handle multi-user scenarios
- Metadata preserved: WHO uploaded, WHEN, via WHICH channel
Flow
Channel (Telegram/Slack/Web)
→ Channel Adapter (download from native API)
→ Backend (validate, audit, store)
→ Agent workspace (/home/developer/uploads/)
→ Inject chat message: "User alice@example.com uploaded report.pdf"
Constraints
- Max file size: 10MB (configurable per-agent later)
- Allowed types: Whitelist — images (png, jpg, gif, webp), documents (pdf, txt, md, csv, json)
- Filename sanitization: Strip path traversal, normalize unicode
- No retention policy v1: Files persist until manually deleted
Acceptance Criteria
Backend
Channel Adapters
Agent Integration
Security
Out of Scope (v1)
- Per-user namespaced folders
- Storage quotas
- Automatic cleanup/retention
- Virus scanning
- Image/document preview in UI
Related
- Depends on channel adapter infrastructure (SLACK-002, Telegram adapter)
- Audit log infrastructure (SEC-001)
Summary
Enable users to upload files to agents through external channels (Telegram, Slack, public chat links). Files are stored in the agent workspace and the agent is notified via chat message.
Architecture Decisions
Storage Model
/home/developer/uploads/regardless of userFlow
Constraints
Acceptance Criteria
Backend
POST /api/agents/{name}/files/uploadendpoint/home/developer/uploads/{sanitized_filename}file_uploadstable or entries inaudit_logagent_name,filename,file_size,mime_typeuploaded_by_email,channel(telegram/slack/web/api)timestamp,file_pathChannel Adapters
ChannelAdapterABC withdownload_file(file_ref) -> (bytes, metadata)getFile+ file pathAgent Integration
[File uploaded by {email}]: {filename} ({size}) saved to /uploads/{filename}Security
.., no/, truncate length)Out of Scope (v1)
Related