New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@send0/ai-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@send0/ai-sdk

send0 tools for the Vercel AI SDK: give any agent an email inbox

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
21
-94.53%
Maintainers
1
Weekly downloads
 
Created
Source

@send0/ai-sdk

send0 tools for the Vercel AI SDK. Give an agent its own email inbox: sign up for things, read verification codes, and hold real email conversations.

npm install @send0/ai-sdk ai zod

Usage

import { anthropic } from "@ai-sdk/anthropic";
import { send0Tools } from "@send0/ai-sdk";
import { generateText, stepCountIs } from "ai";

const { text } = await generateText({
  model: anthropic("claude-opus-5-5"),
  tools: send0Tools(), // reads SEND0_API_KEY
  stopWhen: stepCountIs(10),
  prompt:
    "Create an inbox called signup-agent, then wait for the verification email and tell me the code.",
});

send0Tools() returns a record of AI SDK tools, so it works with generateText, streamText and Agent, and you can spread it next to your own tools.

Tools

ToolWhat it doesKind
create_inboxMake a new address, e.g. signup-agent@send0.emailCreates
list_inboxesInboxes this key can useRead-only
wait_for_emailBlock until a matching email arrives; returns the code and link it extractedRead-only
search_messagesFull-text search, filter by sender (*@github.com) or directionRead-only
get_messageRead one message (new text only by default, to save tokens)Read-only
list_threadsConversations in an inbox, most recent firstRead-only
get_threadA whole conversation, oldest firstRead-only
send_emailStart a new threadSends
replyAnswer in the same threadSends

Options

send0Tools({
  apiKey: "s0_live_…", // default: process.env.SEND0_API_KEY
  baseUrl: "https://send0.example.com", // self-hosted send0
  client: new Send0(…), // or pass a configured @send0/sdk client
  inboxId: "ibx_…", // default inbox, so the model doesn't need inbox_id
  include: ["create_inbox", "wait_for_email"], // only these tools
  exclude: ["send_email", "reply"], // or everything but these
  requireApproval: true, // ask before send_email and reply run
});

Approval

With requireApproval: true, send_email and reply don't run until you approve them: the AI SDK returns a tool-approval-request instead of executing, and you answer with a tool-approval-response (in useChat, addToolApprovalResponse). You can also set approval per call with the AI SDK's toolApproval option:

import { send0ToolApproval, send0Tools } from "@send0/ai-sdk";

await generateText({ model, tools: send0Tools(), toolApproval: send0ToolApproval, prompt });

An API key limited to one inbox, and an inbox with the approval send policy, are the safest setup for an agent.

Untrusted content

Email is written by strangers. Tools that return mail wrap each body in <untrusted_email> tags with a note to treat it as data, and messages send0 flags for prompt injection carry a visible warning. Don't give an agent that reads email tools it shouldn't be talked into using.

Errors

API errors are returned to the model as text, for example send0 error recipient_not_allowed: …, so it can recover instead of the call failing.

License

MIT

Keywords

email

FAQs

Package last updated on 09 Oct 2026

Related posts