Inspiration

Email service providers put thousands of customers on shared sending IPs. When one of them blasts a scraped list, spam complaints spike, Gmail and Yahoo lower the reputation of those IPs, and everyone's mail starts landing in spam. Since 2024, Gmail and Yahoo require bulk senders to stay under a 0.3% spam-complaint rate. Today a provider can only react after the damage is done: suspend the account, clean up, warm the IPs again. New senders, meanwhile, wait days for manual review before they may send at volume.

I work in marketing technology, and I kept wondering why the one party that causes the damage never has anything at stake. SenderBond gives them something at stake, and PayPal's authorize-and-capture flow turns out to be the perfect primitive for it.

What it does

SenderBond is a "security deposit" layer an ESP can put in front of new or risky senders.

  1. AI prices the risk. Before a campaign is sent, an AI reviewer reads it like a deliverability analyst: deceptive or fake "RE:" subjects, fake urgency, prize claims, missing unsubscribe link or postal address, misleading sender identity. It returns a risk score with quoted evidence and a compliance checklist. Deterministic code (not the model) turns that into a bond price: a clean newsletter pays $10, a scam-looking blast pays $120.
  2. PayPal holds the bond. The sender approves a PayPal payment created with Orders v2 intent: AUTHORIZE. The money is held, not charged.
  3. Recipients decide. For 72 hours the ESP counts spam reports. Recipients' replies are read by AI too, so an angry "I never signed up, stop emailing me" counts as a complaint while "is this real?" does not.
    • under 0.1% → the authorization is voided, the sender pays nothing
    • 0.1%–0.3% → a proportional partial capture, the rest is released
    • over 0.3% (the Gmail / Yahoo limit) → the bond is captured
  4. Reporters get paid. Half of a forfeited bond is split among the people who reported the spam and paid instantly with PayPal Payouts. An AI check looks at each reporter's history and withholds the reward from accounts that report wanted mail just to farm rewards.
  5. The ESP console (AG Grid) shows every bond, complaint rate, capture and payout, kept in sync by PayPal webhooks.

Good senders pay nothing. Bad senders pay before they can hurt anyone else's deliverability.

How we built it

  • Next.js 16 (App Router) + React 19 + TypeScript + Tailwind CSS 4, SQLite through Node 24's built-in node:sqlite, AG Grid 36 for the console, zod 4 for validation.
  • PayPal (sandbox): JS SDK v6 (createInstance, findEligibleMethods, createPayPalOneTimePaymentSession, <paypal-button>); Orders v2 create + authorize; Payments v2 void and capture with final_capture: true for partial forfeits; Payouts v1 for reporter rewards; Webhooks with verify-webhook-signature. Every mutating call carries a PayPal-Request-Id so retries never double-capture or double-pay. The PayPal base URL is hard-coded to the sandbox and the app refuses to start unless PAYPAL_ENV=sandbox.
  • AI: Groq (openai/gpt-oss-120b) first, Google Gemini (gemini-3.5-flash-lite) as automatic fallback on errors or rate limits, both through the OpenAI-compatible chat API with JSON output validated by zod and one schema-repair retry. Results are cached by prompt hash so replaying the demo costs nothing.
  • Design rule: the model judges, code computes money, PayPal moves money. The AI never decides an amount directly.
  • Hosted on a small Linux VM (Node 24 under systemd, behind Caddy and Cloudflare) at https://weilunli.me/senderbond.
  • The demo video was produced programmatically with Remotion: Playwright recorded the real app (including the PayPal sandbox popup), the edit zooms on logged focus points, narration is neural TTS with word-level captions.

Challenges we ran into

  • Holding money instead of charging it. Vaulting a PayPal wallet is refused in the sandbox, so the bond is an authorization: AUTHORIZE now, then void, partial capture or full capture later. Getting partial capture right meant final_capture: true so the remainder is released automatically.
  • Declined test cards. A generic test card returns INSTRUMENT_DECLINED and leaves the order unusable, so every attempt creates a fresh order.
  • Making AI safe around money. The model output is schema-validated, the bond price and settlement math are deterministic, and the reward-farming check only runs when a reporter's history looks suspicious.
  • Proving it honestly. Most of a 1,000-recipient list is a clearly labelled simulation, but three demo inboxes are real and every click there changes the outcome.

Accomplishments that we're proud of

  • All three settlement paths verified end to end in the sandbox: void (full refund), partial capture (50%) and full capture, plus reporter Payouts reaching SUCCESS and signature-verified webhooks.
  • The reward-farming guardrail actually triggered during testing: two recipients who reported a clean newsletter had their rewards withheld.
  • A product an ESP could plausibly run: it uses the industry's own 0.3% threshold and PayPal primitives that already exist.

What we learned

Authorize-then-capture is a natural fit for "pay only if something goes wrong". And AI is most useful around payments when it is limited to the fuzzy judgement (reading an email, reading a reply) while plain code guards the money.

What's next for SenderBond

  • Feed real mailbox-provider feedback loops (FBL) and List-Unsubscribe signals instead of the simulated list.
  • Reputation that carries over: senders with a clean history post smaller bonds.
  • The same mechanism for any inbox flooded by AI slop: cold pitches, bug-bounty reports, grant applications.

Built With

Share this project:

Updates

Submission history