Skip to content
Back to skills

Handling Attachments

ASecurity

File attachment handling for XMTP agents. Use when sending or receiving images, files, or any encrypted remote attachments. Triggers on file upload, image sending, or remote attachment handling.

  • 54 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
ai-agentstypescriptgo

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add xmtplabs/xmtp-agent-examples --skill handling-attachments --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handling Attachments?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Handling Attachments
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xmtplabs-handling-attachments/badge)](https://www.skillsdirectory.com/skills/xmtplabs-handling-attachments)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: handling-attachments
description: File attachment handling for XMTP agents. Use when sending or receiving images, files, or any encrypted remote attachments. Triggers on file upload, image sending, or remote attachment handling.
license: MIT
metadata:
  author: xmtp
  version: "1.0.0"
---

# XMTP attachments

Handle file attachments using encrypted remote attachments. Files are encrypted locally, uploaded to your storage provider, and sent as a remote attachment message.

## When to apply

Reference these guidelines when:
- Sending files or images from an agent
- Receiving and downloading attachments
- Implementing custom upload storage
- Working with encrypted file transfers

## Rule categories by priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Send | CRITICAL | `send-` |
| 2 | Receive | CRITICAL | `receive-` |
| 3 | Upload | HIGH | `upload-` |

## Quick reference

### Send (CRITICAL)
- `send-remote-attachment` - Send encrypted file attachments

### Receive (CRITICAL)
- `receive-attachment` - Download and decrypt attachments

### Upload (HIGH)
- `upload-callback` - Implement custom upload storage (Pinata, S3, etc.)

## Quick start

```typescript
import {
  type AttachmentUploadCallback,
  downloadRemoteAttachment,
} from "@xmtp/agent-sdk";

// Send an attachment
const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
await ctx.conversation.sendRemoteAttachment(file, uploadCallback);

// Receive an attachment
agent.on("attachment", async (ctx) => {
  const attachment = await downloadRemoteAttachment(ctx.message.content);
  console.log(`Received: ${attachment.filename}`);
});
```

## How to use

Read individual rule files for detailed explanations:

```
rules/send-remote-attachment.md
rules/receive-attachment.md
rules/upload-callback.md
```

Files in this skill

  • SKILL.md1.8 KB
  • rules/receive-attachment.md1.2 KB
  • rules/send-remote-attachment.md1.1 KB
  • rules/upload-callback.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.