Inspiration

A few months ago I broke both my legs and ended up in hospital. Lying there, I kept thinking about the AI agents I had allowed to pay for me. If something happened to me, who would stop them? My family wouldn't even know they existed, what they paid, or how often.

AI agents now pay on our behalf. Their permission to pay is tied to a PayPal account, not to whether its owner is still there. PayPal already has a process for families after a death. Nothing like it exists yet for the agents that keep paying in the meantime. So I built what I wished I'd had.

What it does

NextOfKin is a continuity plan for AI agents that pay with PayPal.

  1. The owner sets a plan once. After how many days of silence agents pause, and when the family steps in. An emergency fund, with a cap and a destination chosen in advance.
  2. They pick a trusted contact, who accepts an invitation. Only that person can confirm an emergency.
  3. They connect PayPal once. The permission stays in PayPal's Vault, held by NextOfKin's gate. Agents never see it: they can only ask the gate to pay, within a spending cap. Claude maps the owner's recurring PayPal payments: what must continue in an emergency (rent, electricity) and what can wait (streaming).
  4. Every payment is held, not taken. The gate places a PayPal authorization, so it can still be cancelled. A payment above the cap is refused before PayPal is called, and the reason is logged.
  5. Every day, one question: are you OK? If the owner stops answering, the plan steps in gradually:
Level When What happens on PayPal Can it be undone?
1 · Pause 3 days of silence Held payments by non-essential agents are voided. Essential bills keep being paid. Yes, one answer from the owner
2 · Protection 7 days, and the trusted contact confirms Subscriptions in the plan are suspended, not cancelled. The emergency fund is sent with Payouts. Yes, subscriptions come back
3 · Closure The trusted contact reports a death, and 72 hours pass Every agent loses its permission to pay No, that's why it waits 72 hours
  1. The family can ask what was paid. After closure, a read-only assistant answers the trusted contact from the plan's records only. It says what it doesn't know, and never moves money.

The AI proposes. Fixed rules decide. Claude classifies, prepares and explains. Every action on money goes through the gate, which applies fixed rules and logs each decision.

How I use PayPal

PayPal API What NextOfKin does with it
Vault (payment method tokens) Keeps the owner's permission inside the gate, never in the agents
Orders, authorize Every agent payment is held, not taken, so it can still be stopped
Payments, void and capture Level 1 voids held payments. Settled payments are captured.
Subscriptions, suspend and activate Level 2 pauses subscriptions without cancelling them. The owner's answer reactivates them.
Payouts The emergency fund, once every 30 days, to an account registered in advance
Transaction Search The 30-day payment map that Claude classifies, with people's names replaced by codes

How I built it

  • The gate: a FastAPI service on Render, with Postgres on Neon. It is the only part that talks to PayPal. It checks the agent's status, the plan level, the currency and the spending cap, then refuses with a reason or places a PayPal authorization. Every decision is logged with its PayPal ID.
  • The plan: Zapier Tables, Interfaces and 18 Zaps run the check-ins, the escalation, the trusted contact's confirmations and the family pages.
  • The AI: Claude by Anthropic, in four narrow jobs:
    • Claude Haiku 4.5 classifies payments and prepares grocery orders;
    • Claude Sonnet 5.5 explains rehearsals to the owner and answers the family.
    • People's names become stable codes before any payment data reaches the AI.
  • Built with Claude Code: the service, its tests and the eval scripts were written with Claude Code. I designed the system, the rules and the evals, and built every Zap and page in Zapier.

Challenges I ran into

  • Claude can't add up. The grocery agent got the total wrong in its first two orders (73.10 instead of 72.58). Now a code step recomputes every total from the items, and the gate enforces the cap anyway.
  • A missing description almost stopped the electricity. A bill paid by an agent reached Claude with no description, and Claude chose "pause". Now the payment's description comes from the PayPal cart, and an unclear payment always defaults to "continue".
  • Safety versus kindness. Every level had to be reversible except the last, and nothing irreversible could happen without a person and a wait. That's where the 72 hours come from.

Accomplishments that I'm proud of

  • Tested at every step:
    • payment classification, 20 of 20 emergency actions right;
    • level decisions, 40 of 40;
    • hidden instructions in payment data, 7 of 7 ignored;
    • family assistant, 7 of 7;
    • grocery agent: Claude stayed under the cap 13 of 15 times, and the gate stopped the other 2.
  • 14 of 14 attacks stopped: a fake death, changing the fund's account, paying above the cap, made-up keys, asking for the family briefing too early.
  • A judge can try it in minutes, and watch the gate's decisions live.

What I learned

An AI agent is only as safe as the permission it holds. Keeping that permission outside the agent, in PayPal's Vault behind fixed rules, makes everything else simpler. The AI can be wrong, and the money is still safe.

What's next for NextOfKin

  • Connect PayPal for any new user, straight from the onboarding form.
  • Inside PayPal. Today the demo app's own account stands in for the owner's, because a service can read only its own transactions and pause only the subscriptions it sells. With PayPal, an owner could share their real payment history and subscriptions with their legacy contact.
  • Two trusted contacts, a PIN for check-ins, and a second channel (SMS) for the daily question. ## What it does

Built With

Share this project:

Updates

Submission history