Skip to content
tmoody1973Public

About

Tether: a parent signs spending rules for a teen; an AI agent proposes, code decides, PayPal pays. PayPal AI hackathon 2026.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tether

Tether

A parent signs the rules. An AI agent proposes. Code decides. PayPal pays.

Tether lets a parent give a teenager real spending freedom online without handing over a card. The parent (Amara) signs a short set of weekly rules. Her teen (Zoe, 15) shops inside those rules. Every purchase is checked by plain code before a single PayPal call is made. Zoe earns more freedom by keeping her own savings promise four weeks in a row.

Built for the PayPal AI Hackathon 2026 (Devpost). Submission deadline: Thursday 12 November 2026, 12:00 PT.

Live app: https://tether-five-beta.vercel.app (sandbox only, no real money moves) Demo video: link coming with the submission

Tether: Delegated spending, built for trust

AI shopping is making it easier for software to act on a consumer's behalf. But what happens when the shopper is a teenager and the person who controls the money is a parent?

Tether demonstrates one answer.

A parent establishes spending rules. A teenager shops with an AI agent. Deterministic software evaluates the proposed purchase, and PayPal processes authorized payments with a record of the applicable rules and permission.

The result is an approach to supervised family commerce that could extend PayPal's role from payment processing into managing trusted, delegated purchasing experiences.

The problem

Who One cited number Tether's answer
Parents: kids spend their money without real permission The FTC made Epic Games refund $245M for children's charges made "without any parental involvement"; Epic "ignored more than one million user complaints" (FTC, Dec 2022). No card changes hands. The parent signs weekly rules, code checks every cart before PayPal is called, and each payment uses a single-use permission slip bound to that one cart.
Teens: they want autonomy, and classes barely change behaviour Across 201 studies, financial-education classes explained 0.1% of the differences in money behaviour, with negligible effects 20 months on; the authors point to "just in time" teaching (Fernandes, Lynch & Netemeyer, 2014). She shops herself inside the rules. A refusal explains itself at the moment of decision, with her real numbers and two ways forward, and her freedom grows from her own track record.
Saving: most teens don't put money aside for later Only 36% of US teens aged 13–18 say they save part of the money they receive for their future (Junior Achievement and MissionSquare, Feb 2025, 1,000 teens). What she doesn't spend is recorded as savings: an amount the parent promises her. Tether tracks the promise; it doesn't hold or set aside money. She sets her own weekly savings promise (nothing is locked; keeping it is rewarded), sees one number, weeks to her goal, and four kept weeks move her up a level. A design grounded in commitment and goal research, not yet tested on teens.
Investing: teens are interested, but don't know much 70% of teens aged 13–17 are very or extremely interested in investing; only 14% say they know a lot (Schwab, Oct 2025, 1,000 teens; Schwab sells teen accounts). From Level 2, funds or stocks, with facts only: what's inside, about the company, one line against the whole market, no daily moves or red and green. She gives her reasons in her own words, the parent approves each one, and leveraged products are blocked.
Payments and AI: nobody has settled how an agent proves it was allowed to buy Google's AP2, with PayPal as a named partner, lists "proving that a user gave an agent the specific authority to make a particular purchase" as an open question (Sept 2025). The parent's signed rules are the mandate. The agent only proposes, code decides, a model can only add friction, and every payment's proof can be checked against PayPal's own records.

Sources, sample sizes and the claims we deliberately avoid: docs/research/problem.md.

Try it in five minutes

  1. Open https://tether-five-beta.vercel.app and click Open Zoe's view. Her week shows one number: what she has left. Go to Shop, ask for something ("headphones under $30"). The AI agent searches only her allowed shops and labels every card Fits your week, Needs Amara's OK or Over budget. Open an over-budget card to see the amber refusal sentence and its two ways forward.
  2. Back on the landing page, click Open Amara's view. Home shows what needs her: Zoe's over-budget ask. Open it: the budget consequence comes first. Tap Approve: Tether checks the cart against the signed rules again, mints a single-use permission slip and charges Amara's saved sandbox PayPal. In Activity, open Proof on that payment for its PayPal capture id, the permission slip and the rules version it ran under.
  3. In Zoe's rules, search for a shop (try "Lego") and add it, or remove one. Each change asks once, then applies at once as a new rules version. Zoe can also search for a shop and ask Amara for it.
  4. Ask the month assistant on Home: "What did Zoe buy this month?" It reads PayPal's transaction list and Tether's receipts, and can't move money.
  5. On Amara's Home, press Turn on notifications, then ask for something as Zoe (in another tab or on another device): Amara's browser gets one push, and tapping it opens that request. The demo family is shared, so anyone who turns this on gets the demo's asks (at most 200 a day).
  6. Open Demo controls at the bottom of Home and press Advance to end of month. Zoe kept her savings promise four weeks running, so the check-in in Activity moves her to Level 3 and offers the savings release. From Level 2 (where the demo starts) Zoe can search the whole market, read a facts-only page for a fund or stock and propose an investment; Amara approves and Tether places a sandbox Alpaca order.

Sandbox PayPal login (fake money): email [email protected], password [email protected]. Use it whenever PayPal asks you to sign in: to start your own family, or to save Amara's PayPal again after a reset. It's a shared PayPal sandbox test account; nothing real is charged.

Or start your own family. Under the demo buttons, click Log in with PayPal and sign in with the sandbox login above (never a real PayPal account). Name your teen, then follow the three steps on Home: save your PayPal, sign the first rules, send the link (copy it, or scan the QR code with a phone). With the shared sandbox login, each browser gets its own family: you never see another judge's, and Log in with PayPal brings you back to yours only in the browser you made it in (another browser, or cleared cookies, starts a new one). With your own sandbox account, Log in with PayPal brings you back to your family from anywhere. New families are removed after 7 days, and at most 30 can start a day.

The demo is one shared family. Reset demo (in Demo controls on Amara's Home) puts it back, and it also resets itself when someone arrives more than 6 hours after the last reset. Dates are on a demo clock set to late December 2026 so a month fits in a few clicks; the screen says so.


How it works

  1. Amara saves her PayPal once. Tether stores a vault token (PayPal's way of letting a merchant charge you later without your password). Zoe never has a PayPal account; PayPal requires users to be 18+. A parent can add several teens, at sign-up or later; each is its own family with its own rules, budget, link and record, and a switcher shows which teen has something waiting.
  2. Amara signs weekly rules. Weekly amount, which shops, whether every purchase needs her OK or anything up to an amount she picks goes through without asking, her sales tax and shipping estimate, how much Zoe promises to save. The signing screen reads like a contract. No AI is involved in it. A new weekly amount starts next week, and a level change never loosens what she chose. She can pause spending (every purchase then waits for her yes) or stop the rules (purchases end and her saved PayPal is disconnected, while what Zoe didn't spend this week still counts as promised).
  3. Zoe asks the shopping agent ("headphones under $30") or pastes a product link. The agent can only search the shops Amara allowed (via Channel3). It proposes 2–3 options. It cannot buy anything. Each option shows a photo, its full estimated cost (price, tax and shipping) and how far it would set Zoe's goal back.
  4. Gate 1, code: a deterministic rule engine checks the cart against the signed rules. Allowed, needs Amara's OK, or refused with one plain sentence saying which rule and what would change it.
  5. Gate 2, AI, can only tighten: a model checks things code can't (is this item actually a book?). It can add friction; it can never remove it. "A model may add friction. Only code may remove it."
  6. PayPal charges Amara's saved wallet, using a single-use permission slip (a signed token, valid 120 seconds, bound to that exact cart). The PayPal order carries the split: item total, shipping and tax. If the store refunds it, the money comes back exactly once: to Zoe's week, or to what Amara has promised if the week has closed.
  7. Every week, what Zoe didn't spend counts as savings. Four kept weeks in a row moves her up a level: more money, more shops, and from Level 2, investing. Tether tracks allowance and savings promises. It doesn't hold or set aside money. Purchases charge the parent's saved PayPal when they happen. So Zoe's savings is an amount Amara has promised her, paid when Amara sends it herself and records it. If Amara's balance runs low, nothing was reserved, so the promise doesn't change; a purchase PayPal declines charges nothing. Money Zoe invests is different: with Amara's OK it does move, into Zoe's own investing account (a simulated sandbox deposit in this build).
  8. Investing (from Level 2): Zoe searches the whole market and proposes a fund or stock. Tether shows facts only and recommends nothing, and blocks products whose names say they're leveraged or inverse. Amara approves each one; Tether places the order through Alpaca.
  9. Amara can ask about the month ("How much at the bookshop in October?", "How are Zoe's investments doing?"). A read-only assistant answers from PayPal's transaction list, Tether's receipts, Zoe's investments, what's inside her funds, and the news. News shows only here, only when Amara asks; never on Zoe's screens (decision 022). It cannot move money.

Investing, from Zoe to Amara

Zoe proposes; Amara decides; code moves the money. No model is involved in any step that moves money.

sequenceDiagram
  participant Z as Zoe (phone)
  participant T as Tether (code)
  participant A as Amara (phone)
  participant AL as Alpaca (sandbox)
  Z->>T: Searches the whole market, opens a fund ("Look closer")
  T-->>Z: Facts only: what it is, one-year line, five years vs the whole market, what's inside
  Z->>T: Answers three questions and proposes $5.00 (about 0.0138 of a share)
  T->>T: Rule engine checks: investing level, fund on Amara's list, enough savings
  Note over Z,T: Not on Amara's list yet? Proposing asks her to add it first.
  T-)A: One push: "Zoe proposes investing $5.00 in VTI"
  A->>T: Taps it: the request page shows about 0.0138 of a share, what's inside VTI, her savings, Zoe's answers, her recent weeks
  alt Amara approves
    A->>T: Approve $5.00
    T->>T: Single-use permission slip, savings debited
    T->>AL: Deposit $5.00 into Zoe's investing account
    T->>AL: Dollar-amount order for VTI
    AL-->>T: Bought, or queued for market open
    T-->>Z: Your investments: VTI, 0.0138 share, worth $5.00, too soon to tell
    A->>T: Asks "How are Zoe's investments doing?"
    T-->>A: A short answer and Zoe's investments card, from the same numbers
  else Not this time
    A->>T: Not this time
    T-->>Z: Amara's answer. Nothing moves.
  end
  Note over A,T: Missed the push? The request waits on Home under "Needs you" until it is answered or runs out of time.
Loading

Once the deposit lands, the money belongs to Zoe and Tether never takes it back (decision 010). An answered request opened later says what happened ("Already approved", with a link to Zoe's investments).

Where the money moves: this demo vs production

flowchart LR
  subgraph DEMO["In this demo (sandbox)"]
    D1["Zoe's savings<br/>Tether ledger: Amara's promise, no money held"] -- "Amara approves" --> D2["Alpaca sandbox<br/>simulated deposit"]
    D2 --> D3["Dollar-amount order<br/>in a stand-in account"]
  end
  subgraph PROD["In production"]
    P1["Amara's PayPal"] -- "Amara withdraws" --> P2["Amara's bank"]
    P2 -- "ACH transfer, started by Tether after her approval" --> P3["Zoe's custodial account at Alpaca<br/>Amara is the custodian"]
    P3 --> P4["Dollar-amount order"]
  end
Loading

PayPal is not in the investing money path, in the demo or in production: Alpaca funds accounts by bank transfer or wire, not PayPal. PayPal stays central where it already is: Amara's consent (PayPal Vault), Zoe's purchases (Orders v2 on the saved wallet) and the proof (every receipt checked against PayPal's own records). We looked at eToro, which does take PayPal deposits, and stayed on Alpaca: eToro has no accounts for under-18s and its personal API keys can't be used on someone else's behalf (decision 023).

How PayPal and AI are used

What How
PayPal Vault (save a wallet without a purchase) Setup token → Amara approves → payment token. Charges use payment_source.paypal.vault_id.
PayPal Orders v2 Each approved cart is one order, charged to the vaulted wallet. Completes in one call, no separate capture.
PayPal Webhooks Payment events reconcile Tether's ledger with PayPal.
PayPal Agent Toolkit (@paypal/agent-toolkit) Read-only: only list_transactions is exposed, wrapped so the model sees only this family's rows (date, amount, status).
Claude (claude-haiku-5-5 via the Vercel AI SDK, except the month assistant, which uses claude-sonnet-5-5) The propose-only shopping agent, the "is it a book?" check, plain-English refusal sentences, fund descriptions, and the month assistant. Every model output is validated, with a code fallback.
Channel3 Product search scoped to the parent's allowed shops; turns a pasted link into a real cart.
Alpaca Broker API (sandbox) Investing: account, deposit, dollar-amount orders; market search and price history.
Financial Datasets Only what Alpaca lacks (decision 021): what's inside a fund (its SEC filing) and, for Amara's assistant only, headlines. Narrow, cached, capped calls: market headlines, or only what's on Zoe's list and the companies inside her funds. Fund holdings 40 a family a day, headlines 20 a day and at most two per question.

Why charges use PayPal's REST API directly: the Agent Toolkit doesn't cover charging a vaulted wallet (or payouts), and Tether deliberately gives no model a tool that moves money. The toolkit is used where it fits: read-only questions about the month.

Why it matters for PayPal

Tether demonstrates how PayPal could let one person make purchasing decisions under spending authority granted by another.

PayPal is already building for AI shoppers. Its agentic commerce services help customers find products, manage carts and complete purchases through AI assistants, and Agent Ready supports "both supervised and automatic shopping scenarios" using delegated payment tokens. Tether works on the question those services leave open: what happens when the person shopping isn't the person whose money it is?

  • A permission layer for agent-assisted commerce. An agent proposes; the payer's signed rules decide. Every payment carries the rules version and a single-use, cart-bound permission slip, so anyone can trace why it was allowed. Families are the first case. The same model fits other delegated purchases, such as an employee buying on a company account.
  • More use of the parent's PayPal. Supervised purchases run on the wallet the parent already has: no separate teen account, no card handed over.
  • A record both sides can trust. The parent sees why each payment was allowed; the teen sees what's left. Neither has to take the other's word for it.

Tether is the decision layer PayPal's agent payments already expect. When an AI platform pays a PayPal merchant through Agent Ready, Braintree checks the one-time payment token's limits: the merchant, a maximum amount, the currency and an expiry (PayPal's ACP guide). Tether's single-use permission slip (src/engine/token.ts) carries the same limits (the merchant, the exact amount, a two-minute expiry) plus the exact cart. PayPal checks a token's limits at payment time; Tether decides whether the token should exist at all, and with what limits, under rules signed by someone other than the shopper.

What PayPal would need to settle before real money moves:

  • Who may start a payment. PayPal accounts are for adults, so Tether keeps the account in the parent's name. PayPal would still need to approve a teen initiating purchases on it.
  • Real merchant checkout and refunds. PayPal's agentic commerce services are by application and onboarding today, not an open checkout API; the sandbox pays one stand-in merchant.
  • How savings is shown. Tether's savings is a promise the parent makes, never money set aside, and every screen has to say so.

Next: Give, through PayPal Giving Fund. The same permission layer extends to giving: the teen picks a cause, the parent approves, and PayPal Giving Fund's Charity Search API supplies over a million vetted charities. A donation would follow the same path as a purchase (rules check, parent's OK, single-use permission slip, a PayPal order marked as a donation), and the parent stays the donor of record. Spend, Save and Invest work today; Give is next.

How Channel3 is used

Channel3 is the shopping agent's only source of products, and the parent's signed rules decide what Channel3 may return (src/adapters/channel3/client.ts).

When Channel3 call What Tether does with it
Zoe asks for something Product search, with website_ids set to the shops Amara allowed The agent only ever sees Zoe's shops. Out-of-stock offers are dropped.
Zoe pastes a product link Lookup Turns the link into a Channel3 product, then keeps it only if one of her shops sells it.
Amara adds a shop Website search Finds the store, whose domain then becomes a search filter.
Right before PayPal is charged Product details (free) Fetches every item's price at that shop again (src/flows/purchase.ts, reprice). Gone: refused. Price changed: the cart no longer matches its single-use permission slip, so nothing is charged.

Channel3's buy links are affiliate-tracked, and Tether never shows them to Zoe: every purchase has to pass the rules and be paid from Amara's PayPal.

The AI: two agents, three checked calls

Tether uses AI where judgement helps and keeps it away from anything that decides or moves money. Only two pieces are agents (a model that loops, calling tools); the other three are single model calls whose output is checked by code. Every one has a plain code fallback, so the app works with the model switched off.

Who can touch money. Every AI piece sits on the left. Nothing on the left has a path to PayPal or Alpaca except through code that checks the signed rules and a human approval.

flowchart LR
  subgraph AI["AI: proposes, explains, answers"]
    A1[Shopping agent]
    A2["Is it a book? check"]
    A3[Refusal sentences]
    A4[Fund descriptions]
    A5[Month assistant]
  end
  subgraph CODE["Code: decides"]
    R[Rule engine<br/>signed rules]
    AP[Amara's approvals]
    TK[Permission slip<br/>single use, 120 s]
  end
  subgraph MONEY["Money: moves"]
    PP[PayPal<br/>charge saved wallet]
    AL[Alpaca<br/>deposit and order]
  end
  A1 -- proposed carts --> R
  A2 -- can only tighten --> R
  R --> AP
  R --> TK
  AP --> TK
  TK --> PP
  TK --> AL
  A3 -. reads decisions .-> R
  A5 -. reads only .-> PP
Loading
flowchart LR
  Z[Zoe asks for something] --> A[Shopping agent<br/>proposes 2-3 carts]
  A --> G1{Gate 1: rule engine<br/>plain code}
  G1 -->|allowed| G2{Gate 2: AI check<br/>can only tighten}
  G1 -->|refused| E[Refusal sentence]
  G1 -->|needs OK| M[Amara approves<br/>one tap]
  G2 -->|still allowed| T[Single-use permission slip<br/>120 s, bound to this cart]
  G2 -->|tightened| M
  M --> T
  T --> P[PayPal charges<br/>Amara's saved wallet]
Loading

1. Shopping agent (agent) — src/ai/agent.ts

  • What it's for: Zoe types "headphones under $30" or pastes a product link.
  • What it can see and do: two tools — search the shops Amara allowed (Channel3), and look up a pasted product link. At most 6 tool calls, then it must answer.
  • What it returns: 2–3 proposed carts, each with a reason of at most 80 characters. Each cart is run through the rule engine and labelled fits, needs Amara's OK or over budget before Zoe sees it.
  • What it cannot do: buy anything, mint a permission slip, approve anything, change a rule, or touch PayPal. A test fails the build if this file imports anything that can. Product titles from shops are treated as untrusted data, never instructions. It can only propose items its own tools returned.
sequenceDiagram
  autonumber
  actor Zoe
  participant App as Tether server
  participant Model as Claude (shopping agent)
  participant Search as Tool: search allowed shops
  participant Lookup as Tool: look up a link
  participant C3 as Channel3
  participant Rules as Rule engine (code)
  Zoe->>App: "headphones under $30"
  App->>Model: request + allowed shop list (no rules, no money)
  loop at most 6 tool calls
    Model->>Search: query, max price
    Search->>C3: search, filtered to Amara's shops only
    C3-->>Search: products and offers
    Search-->>Model: id, title, price (titles are untrusted data)
    opt Zoe pasted a link
      Model->>Lookup: product URL
      Lookup->>C3: lookup
      Lookup-->>Model: product, or "not available from your shops"
    end
  end
  Model-->>App: 2-3 proposals (product ids + short reason)
  App->>App: drop any id the tools never returned
  App->>Rules: each proposed cart vs the signed rules
  Rules-->>App: fits / needs Amara's OK / over budget
  App-->>Zoe: cards with labels (nothing bought yet)
Loading

2. "Is it a book?" check (gate 2, single call) — src/ai/classifier.ts, src/engine/gate2.ts

  • What it's for: rules code can't judge, like Level 2's "the bookshop, for books only" — Barnes & Noble also sells toys and games.
  • How it decides: the model returns a probability; code turns it into an outcome using fixed thresholds.
  • What it cannot do: loosen anything. Its outcome is combined with gate 1 so the stricter one wins. "A model may add friction. Only code may remove it."
  • When the model fails: a 4-second timeout, an error or a nonsense answer all count as refuse, not allow.

3. Refusal sentences (single call) — src/ai/explain.ts

  • What it's for: turning the rule engine's reasons into one kitchen-table sentence for Zoe, plus two ways forward (ask Amara, or wait).
  • Checks: it may restate only the dollar amounts the engine gave it; it may never say a purchase is approved; it is capped at 240 characters. Anything else falls back to a fixed template.

4. Fund descriptions (single call) — src/ai/fundWords.ts

  • What it's for: one plain sentence about what a fund is, on Zoe's investing screen.
  • Checks: the model never sees prices and may write no numbers, no comparisons ("beat the market"), and no selling words ("great investment", "top pick"). The price lines are written by code. Anything off falls back to a template. Tether recommends nothing.

5. "Ask about the month" (agent) — src/ai/monthAssistant.ts

  • What it's for: Amara asks things like "How much at the bookshop in October?"
  • What it can see: read-only tools, at most 5 steps:
    • tether_record: Tether's own receipts for a month.
    • list_transactions: PayPal's transaction list, through the PayPal Agent Toolkit, configured with only list_transactions.
    • paypal_check: whether the month's receipts match PayPal (the Activity page's check).
    • month_checkin: her level, this week, savings, and the next check-in.
    • zoe_investments: each fund she holds (shares, what she put in, worth now, the same money in the whole market, too soon to tell) and investments still on their way. Same numbers as her Investing page.
    • fund_inside(symbol): what one of Zoe's funds owns. Only a fund on her list or one she holds; anything else is refused before any paid call.
    • news(ticker?): market headlines, or headlines about a stock on her list or a company inside one of her funds (index funds have no news of their own). At most two news searches per question. Title, source, date and link only.
  • Facts only: it never advises, predicts, ranks or says what Amara or Zoe should do. For news it says what the headlines are about, never why a price moved.
  • Cards: the numbers under each answer (purchases, check-in, PayPal match, Zoe's investments, what's inside, headlines) are built by code from the tool results, never by the model (decision 019). Headline links open in a new tab, and only http(s) links are drawn.
  • Family-only: every family's charges land in Tether's one PayPal account, so the PayPal tool is wrapped: the server picks the dates, keeps only rows whose payment id matches this family's receipts, and passes only date, amount and status. The model never sees other families, balances or free-text notes.
  • What it cannot do: move money. No write tool exists in its toolset, and the toolkit can be imported only in this one file (enforced by lint). If the data isn't there it says "I can't see that."
sequenceDiagram
  autonumber
  actor Amara
  participant App as Tether server
  participant Model as Claude (month assistant)
  participant Rec as Tool: tether_record
  participant Tx as Tool: list_transactions (wrapper)
  participant Kit as PayPal Agent Toolkit
  participant PP as PayPal Transaction Search
  Amara->>App: "How much at the bookshop in October?"
  App->>App: check sign-in cookie, family id comes from it
  App->>Model: question + read-only tools
  loop at most 5 steps
    Model->>Rec: month "2026-10"
    Rec-->>Model: this family's receipts (shop, amount, rule version, how allowed)
    Model->>Tx: month "2026-10" (no dates, no ids)
    Tx->>Kit: server-chosen start and end dates
    Kit->>PP: list transactions (read only)
    PP-->>Kit: every transaction on Tether's account
    Kit-->>Tx: raw rows
    Tx->>Tx: keep only this family's payment ids, keep date, amount, status
    Tx-->>Model: filtered rows
  end
  Model-->>App: answer
  App->>App: tools used are all on the allowed list? any rows at all?
  App-->>Amara: answer, or "I can't see that."
Loading

Tech stack

Layer Technology
App Next.js 16 (App Router, Cache Components), React 19, TypeScript (strict)
Installable Progressive web app (manifest, icons, offline page; money screens are never cached)
Database Postgres via Drizzle ORM: Neon in production, PGlite (Postgres in-process) for local dev and tests
AI Vercel AI SDK 7, @ai-sdk/anthropic, Claude Haiku
Payments PayPal REST (Vault, Orders v2, Webhooks, Transaction Search), PayPal Agent Toolkit
Commerce data Channel3 SDK
Investing Alpaca Broker API + Market Data (sandbox)
Fund holdings and news Financial Datasets REST API (cached per family, capped per day)
Tests Vitest (unit, integration on PGlite), Playwright (end-to-end)
Hosting Vercel (production deploys from main), Neon Postgres

Status

Built, reviewed task by task, and running in production: the rule engine and permission slips, the AI gate, levels and the ledger, purchases, approvals (including Amara approving a one-off over budget, decision 013), weekly close and monthly level-ups, savings as a recorded promise with a closing statement (decision 029), several teens per parent (decision 028), the parent's choice of consent with pause, refunds and full estimated cost (decision 030), the goal at today's Channel3 price (decision 031), stopping the rules, investing, market search and fund facts, the month assistant, every parent and teen screen, the demo family with a month of real sandbox history, the installable app, and the deploy. About 950 unit and integration tests run in CI on every pull request, with type checks, lint and a production build. A 64-test Playwright suite (against a local fake PayPal) runs before every merge, and a separate live suite runs against the deployed site.

Limits on the public demo (it's one shared family whose link is public): Zoe's shopping agent 150 runs a day, searches and pasted links 400 a day, the month assistant 60 questions a day, and up to 300 shop look-ups an hour. Over a limit, the screen says so and no AI or Channel3 call is made. Families started with Log in with PayPal: at most 30 new ones a day across the site and one per browser an hour; their paid look-ups also share one daily pot the size of one family's limits, so one busy new family can use it up for the day and the others then see "try again tomorrow"; at most 30 new Alpaca sandbox accounts a day. "Stop Zoe's rules" on the demo family stops the rules but keeps the shared saved PayPal, so the next person can try it; for a real family it also removes Tether's saved wallet at PayPal.

Sandbox stand-ins (said plainly)

In this build In production
Every purchase pays one Tether sandbox business account; the receipt records which shop it was for. A saved PayPal wallet can only be charged by the business that saved it (verified: BILLING_AGREEMENT_NOT_FOUND). Tether pays shops as a PayPal platform partner, or through shops' own agent checkouts.
Shipping and tax are estimates the parent sets (Channel3 returns only an item price); the total, the permission slip and the PayPal order's breakdown all use them. Real store checkout, PayPal first, with the parent's approved total as the hard spending cap in every stage. Possible today: hand off to the store's own checkout through Channel3's tracked link, with the parent paying there with PayPal. Next: PayPal's agentic commerce services (Store Sync and Agent Ready merchants), which are by request for merchants, through a partnership. Later: card-network agent tokens in the PayPal wallet (Mastercard Agent Pay), with Channel3's coming checkout or Crossmint's Agent Checkout for other stores; either gives each store's real total.
Zoe's investments sit in an ordinary Alpaca sandbox account, labelled on screen as a stand-in. The sandbox refuses custodial accounts. One setting (ALPACA_CUSTODIAL_ENABLED=true) switches to the custodial request. A custodial account Amara manages for Zoe.
Paying Zoe her savings: Amara sends the money herself and taps "Record payment to Zoe". Same. Tether never holds money.
A demo clock moves time forward so a month fits in a video. Real time.
Sign-in is Log in with PayPal for families you start, or a private link (signed cookie) for the shared demo. Everyone logs in to PayPal's sandbox with test accounts, often one shared test login, so "PayPal accounts are for adults" proves nothing here; the "I'm their parent or guardian" checkbox carries that claim. Log in with PayPal against real accounts, or passkeys.
A family you start is removed after 7 days: its links stop working and its saved PayPal is deleted at PayPal. Its money rows stay, because the record is append-only. Families stay until the parent closes them.
One shared demo family that resets itself. One family per household.

Quick start

Prerequisites

  • Node.js 22+ (the AI SDK requires it)
  • pnpm 10 (corepack enable)
  • Sandbox credentials: PayPal developer app, Anthropic API key, Channel3 API key, Alpaca Broker sandbox keys

Install

git clone https://github.com/tmoody1973/tether.git
cd tether
pnpm install
cp .env.example .env.local
# fill in .env.local (see below)

For local development, point the database at an on-disk PGlite folder. It sets itself up on first use, no server needed:

# in .env.local
DATABASE_URL=pglite:./.pglite/dev

Generate a signing key:

node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"

Run

pnpm dev          # http://localhost:3000
pnpm test         # unit + integration tests (PGlite)
pnpm e2e          # Playwright end-to-end tests
pnpm typecheck
pnpm lint

To create the demo family locally (it makes small sandbox PayPal charges and a sandbox Alpaca deposit; the script refuses to run against anything but the sandboxes):

pnpm tsx --env-file=.env.local scripts/seed.ts

To deploy your own copy: set the variables below in Vercel, run DATABASE_URL=<neon url> pnpm tsx scripts/migrate.ts, deploy, seed before sharing the link, then register a PayPal sandbox webhook at https://<host>/api/paypal/webhook and set PAYPAL_WEBHOOK_ID.

Environment variables

Variable What it's for Required
DATABASE_URL Postgres URL (Neon), or pglite:<folder> locally Yes
APP_BASE_URL Public address, used for PayPal's return links and Zoe's link. Log in with PayPal returns to ${APP_BASE_URL}/g/login/paypal/return, which must match the Return URL registered in the PayPal app exactly Yes in production
TETHER_SIGNING_KEY Signs permission slips and the parent's sign-in cookie (long random string) Yes
PAYPAL_CLIENT_ID / PAYPAL_CLIENT_SECRET PayPal sandbox app. "Start your own family" also needs Log in with PayPal switched on for this app (Apps & Credentials → the app → Other features), sharing Full name, Email, Account verification status and PayPal account ID Yes
PAYPAL_BASE_URL https://api-m.sandbox.paypal.com (the app refuses anything else) Yes
PAYPAL_WEBHOOK_ID Verifies PayPal webhook signatures; the webhook refuses requests without it Yes in production
PAYPAL_DEMO_VAULT_ID Amara's saved sandbox PayPal, used by the demo seed For the seed
ANTHROPIC_API_KEY Claude, for the agent and the AI checks Yes
CHANNEL3_API_KEY Product search inside allowed shops Yes
ALPACA_BROKER_KEY / ALPACA_BROKER_SECRET Alpaca Broker sandbox (OAuth client credentials) For investing
ALPACA_BROKER_BASE_URL https://broker-api.sandbox.alpaca.markets For investing
ALPACA_DATA_BASE_URL https://data.sandbox.alpaca.markets No (this default)
ALPACA_FIRM_ACCOUNT_ID Funds deposits instantly by journal instead of a bank transfer No
ALPACA_CUSTODIAL_ENABLED true sends the custodial account request No (default false)
FINANCIALDATASETS_API_KEY Financial Datasets: what's inside a fund, and the assistant's headlines. Unset: no "What's inside" card, and the assistant says the news isn't available For fund holdings and news
FINANCIALDATASETS_BASE_URL Only for the e2e suite's local fake (honoured only on localhost with TETHER_E2E=1); otherwise https://api.financialdatasets.ai No
NEXT_PUBLIC_ONESIGNAL_APP_ID OneSignal app id (public). Shows Amara's "Turn on notifications" card; unset hides it For push
ONESIGNAL_REST_API_KEY OneSignal REST key, server only, never sent to a browser. Unset means push is off: asks still work, nothing is sent For push (production only)
DEMO_GUARDIAN_KEY / DEMO_TEEN_TOKEN Keys for the shared demo family (landing page buttons, Reset demo); leave both blank to hide the demo For the public demo

Never commit .env.local. It is git-ignored.

Project structure

src/
├── engine/      Pure rule engine: evaluate, decide, cart hash, permission slips, levels (no I/O, enforced by lint)
├── ai/          Shopping agent, "is it a book?" check, refusal sentences, fund words, month assistant
├── flows/       Purchase, approvals, week and month, investing: transactions under a per-family lock
├── adapters/    PayPal, Channel3, Alpaca clients
├── db/          Drizzle schema, repositories, client (Neon or PGlite)
├── ledger/      Append-only journal and savings maths
├── auth/        Parent sign-in cookie
├── clock/       Real or demo clock
├── ui/          Design tokens and components
└── app/         Next.js routes: /g (parent), /t/[token] (teen), /api
tests/           Mirrors src/; e2e/ for Playwright
drizzle/         SQL migrations
docs/            Design spec, build plan, decision records, spike results
doc/             Product docs and screen mockups

Design decisions

The reasoning behind the main choices is written up in plain English in docs/decisions/: why money stays with the parent, why savings is the unspent allowance, why no charts for the teen, why level-ups run on Zoe's own commitment, why the PayPal toolkit is read-only, and why money that reaches the broker never shows back in savings.

The full design is in docs/superpowers/specs/2026-11-05-tether-hackathon-design.md.

Team

Tarik Moody, built with Claude Code.

License

MIT

About

Tether: a parent signs spending rules for a teen; an AI agent proposes, code decides, PayPal pays. PayPal AI hackathon 2026.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages