# BillionSend Docs > Documentation for BillionSend: a Resend-compatible email API and SMTP relay with per-domain unsubscribes and real-time analytics. # Introduction Source: https://billionsend.com/docs BillionSend is an email platform with a Resend-compatible API. Send emails at scale. Sign up at [billionsend.com](https://billionsend.com), verify a domain and send. The API lives at `api.billionsend.com`. Call it from the [Node.js](/docs/sdks/node), [Python](/docs/sdks/python), [Go](/docs/sdks/go), [Ruby](/docs/sdks/ruby), [PHP](/docs/sdks/php), [Rust](/docs/sdks/rust) or [Java](/docs/sdks/java) SDK, or over plain HTTP from any language. ## Start here - [Quickstart](/docs/quickstart): your first email in a few minutes. - [Migrate from Resend](/docs/migrate-from-resend): move your account data and point your code at BillionSend. - [SDKs](/docs/sdks): the BillionSend packages for each language. - [API basics](/docs/api-reference/basics): authentication, errors, limits, pagination. ## What you get ### Sending | Feature | What it does | | --- | --- | | [Emails](/docs/concepts/emails) | Send one email or a batch, schedule it, follow it from accepted to delivered. | | [Domains](/docs/concepts/domains) | Verify a domain with guided DNS. Each domain can have its own tracking and unsubscribe subdomains. | | [Templates](/docs/concepts/templates) | Reusable content with merge fields. | | [Broadcasts](/docs/concepts/broadcasts) | Send one email to all contacts, a segment or a topic, on a schedule. | | [SMTP relay](/docs/smtp) | Send from anything that speaks SMTP, with an API key as the password. | | [Webhooks](/docs/concepts/webhooks) | Signed events for every step of an email's life. | ### Audience and consent | Feature | What it does | | --- | --- | | [Contacts](/docs/concepts/contacts) | One list of contacts per team, with custom properties. Check them with list verification (paid plans). | | [Segments](/docs/concepts/segments) | Saved filters over your contacts. | | [Topics](/docs/concepts/topics) | Subscription categories each contact can opt in or out of. | | [Unsubscribes](/docs/concepts/unsubscribes) | A recipient leaves the brand that sent the email, not your whole team. Each domain gets its own branded unsubscribe page. | | [Suppressions](/docs/concepts/suppressions) | Hard bounces and complaints are blocked automatically. | ### Receiving and agents | Feature | What it does | | --- | --- | | [Receiving](/docs/receiving) | Receive mail on your domain, read it through the API and get an `email.received` webhook. Beta. | | [Inboxes](/docs/inboxes) | Addresses with threads, replies and drafts, for AI agents or for people. Beta. | | [Agent safety](/docs/agent-safety) | Quarantine, prompt-injection screening and send rules protect an agent inbox. | | [MCP server](/docs/mcp) | Let AI agents send mail and read your data through the Model Context Protocol. | ### Insight | Feature | What it does | | --- | --- | | [Analytics](/docs/concepts/analytics) | Delivery statistics a few seconds behind the events, in the dashboard and at `GET /emails/metrics`. | | [Deliverability insights](/docs/concepts/deliverability-insights) | Checks and a score for every email you send. | ### Team and account | Feature | What it does | | --- | --- | | [Team roles](/docs/team-roles) | Owner, admin, developer and marketing: each member can do what their job needs. | | [Two-factor sign-in](/docs/two-factor) | A code from an authenticator app at each sign-in. | | Notifications | Account notices by email, and to a Slack channel if you connect one (**Settings → Notifications**). | | [Plans and limits](/docs/billing) | Prices, included volume and limits per plan. | | [CLI](/docs/cli) | Move an account from another email provider from your terminal. | ## For AI agents Every documentation page is available as Markdown: add `.md` to its URL, or send `Accept: text/markdown`. [/llms.txt](/docs/llms.txt) is a short index, [/llms-full.txt](/docs/llms-full.txt) lists every page, and [/api.openapi.json](/docs/api.openapi.json) is the OpenAPI 3.1 spec. --- # Agent safety Source: https://billionsend.com/docs/agent-safety Anyone can write to an inbox, and an AI agent that reads mail can be talked into things: a message can carry instructions hidden from people, pose as the agent's owner, or ask it to forward a password-reset link. An [agent inbox](/docs/inboxes) answers in layers. The agent only reads mail that passes the inbox's rules; what it reads is cleaned of hidden text and fenced as untrusted; and what it sends goes through rules that turn risky sends into drafts for a person. None of this makes received mail trustworthy. Screening is one signal, not a guarantee: your agent should still treat every message as data, never as instructions. ## At a glance | Layer | What it does | | --- | --- | | Recipient check | Mail to an address without an inbox is refused unless catch-all is on; a flooded inbox answers "try again later". | | Virus scan | Infected mail is quarantined and its downloads are blocked for good. | | Spam score | Failing mail goes to the `spam` folder. | | Sender trust | Ranks each sender, from your own team's addresses down to failed authentication. | | Accept rules | Mail from senders the inbox does not accept is quarantined. | | Screening | Scores mail from outside senders for prompt injection and phishing; high scores are quarantined. | | Hidden text | Text a person cannot see is removed from everything an agent or model reads. | | Fencing | MCP results put message text between untrusted-content markers. | | Codes | Verification codes and sign-in links are extracted for the agent and cannot be sent on to strangers. | | Send rules | Replies only inside threads, daily caps, a ramp for new recipients, a loop guard; risky sends become drafts. | | Activity | Every action and decision is recorded, and owners hear about what waits. | ## Sender trust Every received message gets a `sender_trust`, shown in `screening` on reads and as **Trust** in the dashboard. The first row that matches wins: | `sender_trust` | The sender | | --- | --- | | `failed` | Failed authentication, and the domain asks receivers to quarantine or reject such mail (or publishes no DMARC policy and fails SPF with no DKIM signature of its own). This beats every other row, so a forged owner never passes. | | `owner` | One of your team members' sign-in addresses, or an address in the inbox's `owner_addresses`, and the domain vouches for it. | | `allowlisted` | Matches the inbox's allowlist, and the domain vouches for it. | | `known_thread` | Replies in a thread the inbox wrote in, from an address the inbox wrote to, proven by the thread token or an `In-Reply-To` naming a message the inbox sent. No authentication needed. | | `external` | Any other sender whose domain vouches for it, other addresses at your own domains included. | | `unauthenticated` | Everyone else: the domain does not vouch for the From address, or the message names more than one sender. | A domain **vouches** for the From address when DMARC passes or, for a domain with no DMARC policy, when a DKIM signature from it or an SPF pass for its organization is present. - Only your team members' sign-in addresses and the inbox's `owner_addresses` are owners. Everyone else at your company's domain is `external`, so a colleague's address, or a system that sends as your domain, cannot command the agent or receive its private codes. - The tier is set when the message arrives and does not change. An allowlist edit counts for mail that arrives afterwards; mail already held is released by hand. ## What reaches the agent `accept_from` decides, by tier: | `sender_trust` | `anyone` | `verified` (default) | `allowlist` | | --- | --- | --- | --- | | `owner`, `allowlisted`, `known_thread` | delivered | delivered | delivered | | `external` | screened | screened | quarantined, `not_allowlisted` | | `unauthenticated` | screened | quarantined, `unauthenticated_sender` | quarantined, `not_allowlisted` | | `failed` | quarantined, `failed_auth` | quarantined, `failed_auth` | quarantined, `failed_auth` | **Screened** mail is delivered unless screening quarantines it. On top of the table: - A virus quarantines the message in every inbox, whatever the sender. - Mail from owners or the allowlist that forwards someone else's message is screened too: forwarded content inherits no trust. - Delivered mail that fails the spam score goes to the `spam` folder, which thread lists leave out unless asked for it. - Delivered mail reads `screening.verdict: "suspicious"` when the sender is `unauthenticated` or `failed`, the spam score is gray, or screening found something below its line; otherwise `clean`. A `human` inbox accepts `anyone` by default: everything is delivered except viruses, and mail from a `failed` sender goes to the `spam` folder. Screening runs on agent inboxes only. ## Quarantine Quarantined mail is kept as long as any received mail, listed and releasable; it is never dropped and never returned to its sender. | `quarantine_reason` | Held because | | --- | --- | | `failed_auth` | The sender failed authentication. | | `unauthenticated_sender` | The sender's domain does not vouch for it, and the inbox accepts verified senders (or lists the address as an owner or on its allowlist). | | `not_allowlisted` | The inbox accepts only its allowlist. | | `injection` | Screening scored prompt injection at 80 or more. | | `phishing` | Screening scored phishing at 80 or more. | | `virus` | The virus scanner found malware. | | `unscreened` | The message needed screening and the judge could not answer. | | `screening_cap` | The message needed screening past the day's screening limit. | **Agents never see held mail.** Inbox-scoped keys and every MCP call skip held messages: reading one answers `403 email_quarantined`, a wait reports only its id, and no code is served from it. While screening runs, usually seconds, a message is pending and its id answers `404`. People in the dashboard see everything, flagged. **No webhook announces held mail.** `email.received` and `inbox.email.received` fire when a message is delivered or released; `inbox.email.quarantined` tells endpoints that subscribe to it. **Releasing.** A person releases from the inbox's **Needs review** tab, a full-access team key with `POST /inboxes/{id}/quarantine/{email_id}/release`, and an MCP client with `release_email` under `receiving:manage`. An inbox-scoped key never can. - A person or a full-access team key releases any hold. - An MCP client is the agent the mail is aimed at: it releases nothing held for prompt injection, phishing, a virus or failed authentication (`403 forbidden`), and any other hold only once screening reads the message under 80 (`409 held_by_screening` otherwise; `503 screening_unavailable` while screening cannot run). - **Release and trust sender** (`trust_sender`) also adds the sender to the allowlist, only for a `not_allowlisted` hold from a verified sender and only for owners, admins, developers and full-access team keys (`403 trust_not_allowed` otherwise). - A released message is delivered as if it had just arrived, webhooks included. A virus stays a virus: its attachments and raw message stay blocked. Owners get one email a day, **Your inboxes need a look**, while messages wait in quarantine, drafts wait for approval or sends were refused, with counts and a link, never senders or subjects. It is the **Inboxes need a look** alert under **Settings → Notifications**; see [Notifications](/docs/notifications). ## Prompt-injection screening On an agent inbox with `screening` on, mail from `external` and `unauthenticated` senders that the rules would deliver is screened before the agent can see it. The judge reads the message as shown, with hidden text set apart: the sender, its authentication and Reply-To; the subject and visible text; the hidden text that was removed; links as anchor text and domain (never fetched); attachment names. Codes are masked and addresses cut to their domain before any of it leaves. The answer is two scores from 0 to 100, `injection_score` and `phishing_score`, and the `reasons` that applied: | Reason | The message | | --- | --- | | `targets_agent` | Addresses an AI, assistant, model or "system" rather than a person. | | `override` | Tries to change the reader's instructions, role or priorities. | | `exfiltration` | Asks the reader to send out codes, links, keys, other mail, contacts or data. | | `unsafe_action` | Asks for an action with effects outside the conversation: paying, approving, deleting, running something. | | `concealed` | Hides instructions: in hidden text, encoded or reversed, after a fake end of message or inside a fake quote. | | `credential_lure` | Asks for passwords, codes or card details on a page the claimed sender does not own. | An injection score of 80 or more quarantines the message as `injection`; otherwise a phishing score of 80 or more, as `phishing`. A score from 50 to 79 delivers it as `suspicious`. The scores are always shown, on reads in `screening` and in the dashboard. - **It fails closed.** A judge that times out or errors quarantines the message as `unscreened`, and so does a screening that never completes (its job keeps failing or stalls): no message stays pending for more than about an hour. Past 200 screened messages in one inbox in a day, mail that needs screening is quarantined as `screening_cap`, so a flood turns into quarantine, never into unscreened delivery. - **It never affects your sending.** Verdicts on mail you received never count toward your own sending reputation or abuse review. ## Hidden text and extracted_text Mail can carry text no person sees but a model reads: an instruction in white on white, a `display:none` block, characters that render as nothing. Before any text reaches an agent or a model, BillionSend removes hidden elements (`display:none`, `visibility:hidden`, near-zero opacity, tiny fonts, content pushed off screen, text the color of its background, comments, `