Tend

On this device.

How Tend works

Tend helps sexual assault survivors apply for crime victim compensation from their state, without giving Tend their name.

Every state and DC has a program that can pay back costs like medical bills, counseling, and lost pay. In 2022, 96 percent of violent crime victims got none of it (sources). The forms are long and each state's rules are different. Tend reads a survivor's own records on their device, checks every cost against the state's law, and builds the claim, with the exact sentence of law behind each dollar.

Design for safety

A survivor may open Tend on a phone or laptop that someone else can pick up. Each protection below links to the files behind it, so you can check.

  • Exit this page

    The button sits in the top right corner of every page, with a copy inside every panel that opens. Pressing Esc twice within a second does the same. Tend blanks the screen and locks any saved progress. It clears the tab's storage, keeping only a flag that marks the exit, and swaps the page for a Google search for the weather.

    Exit replaces only the page that was open. Back can still reach an earlier Tend page in the same tab. That page opens without the person's answers, and if the browser kept a copy in memory, the flag hides that copy and reloads the page. Even so, the page shows Tend was in use, and the browser's history lists the visit. Other tabs stay open too, such as a bill opened in its own tab.

    See web/components/QuickExit.tsx, web/components/flow/ExitControl.tsx, and docs/UX.md.

  • No name, no story

    Check asks four things: the state, the date, whether there was a medical forensic exam, and whether it has been reported to police. Beyond the state, no field anywhere asks where it happened, and none asks what happened or who did it.

    Michigan's application is the only state form Tend fills so far. It checks only the boxes for kinds of cost, plus one line noting the attached itemized list and its total. Name, signature, Social Security number, and every question about the crime stay blank. Then Tend reads the saved file back and refuses it if any other field holds a value.

    See web/components/flow/check/CheckScreen.tsx, web/lib/packet/specs.ts, and web/lib/packet/forms.ts.

  • On this device

    The law runs in the browser as WebAssembly, and bank statements and bills are read there too. There is no account and no analytics. The site's security policy blocks scripts from other sites and stops the page from sending requests to them in the background.

    Costs, files, and every answer except the state stay on the device until the person taps to send something. Cloud AI runs only after a yes on a screen that names what would be sent. It goes through Tend's server to Google's free Gemini service. Google's terms let Google keep it, use it to improve its products, and have people read it.

    Checking the law on Tend's server also waits for a yes, and is offered only when the law engine cannot run in the browser. It sends the state, the date, the answers, and every cost the person has not left out. That includes bank rows Tend could not sort, which can be ordinary spending. Each goes with its amount, its date, and its kind, never the words from the bank or bill. Tend asks once, and that yes covers later checks.

    A line at the top of every page starts as "On this device. Nothing has left it since this page opened." The page builds that line from the requests it actually makes. It changes when any of the person's data is sent. Picking a state changes it: the line then says the state went to Tend's server, because the law files a browser asks for are named for the state. Opening a state's own page, such as /mi, changes it the same way. Loading other pages does not change it, though those requests still reach Tend's web host.

    See web/lib/engine/index.ts, web/components/flow/claim.ts, web/lib/local/index.ts, web/lib/api.ts, web/lib/netlog.ts, and web/next.config.ts.

  • Saved progress

    Saving is optional. Until then, progress is held only in the page's memory and is gone when the tab closes or reloads. Saved progress is encrypted with AES-256-GCM in the browser's own storage. It opens with a passkey, such as Touch ID or the phone's screen lock, or with a passcode. A passcode is turned into a key by PBKDF2-SHA-256 with 600,000 iterations.

    The unlocked key is held only in memory. The vault locks after five minutes without a tap, key press, or scroll. Closing or reloading the tab locks it too, as does going to another site. Switching to another app or tab does not lock it, though the five-minute clock keeps running.

    A passcode can be as short as six characters, and Tend cannot reset a forgotten one. Anyone who opens Check or another step in that browser later can see that saved progress exists, though not what it holds.

    A passkey is saved for this site under the name Tend. Many devices keep it in their password manager, which can sync it to other devices. It stays there after saved progress is deleted.

    See web/lib/vault/crypto.ts, web/lib/vault/index.ts, web/lib/vault/idle.ts, web/components/flow/FlowProvider.tsx, and web/components/flow/FlowFrame.tsx.

  • Sharing with an advocate

    The browser locks the packet with a new AES-256-GCM key before anything is sent. Tend's server gets the locked packet, its expiry, and whether it opens once, but never the key. The key sits after the # in the link, and browsers never send that part of an address to a server.

    A link expires after one, three, or seven days. Until then, anyone holding the whole link can open it, unless it was set to open once and has already been opened. The survivor can stop it sooner on the Packet step, during the same visit or after opening saved progress. Tend shows no stop button for a link from a visit that was never saved.

    See web/lib/share/index.ts, web/components/flow/packet/ShareBox.tsx, and api/tend_api/share.py.

  • Payments

    In the demo, Tend can pay what is left on a bill from Capital One's Nessie mock bank, in mock money. Tend shows a 6-digit code, and nothing moves until it is typed back. The code works once, for ten minutes, and five wrong tries lock the payment.

    The server will not pay a held exam line, alone or together with other lines of the same bill. The code makes paying deliberate. It does not stop someone who is holding the phone.

    See api/tend_api/actions.py.

What Tend cannot stop

Malware on the device, or someone watching the screen.

Someone watching the network, such as whoever runs the home Wi-Fi, can still see that Tend's site was visited, though not what was sent.

Anything downloaded from the packet, such as the filled form, is an ordinary file on the device, outside Tend's lock.

After someone uses Check or a later step, the browser keeps an offline copy of Tend's pages and every state's law. That copy shows Tend was used.

Tend's server can read what it is asked to act on while it handles it. That means a payment, a check of the law, a request to the demo bank, or what goes to cloud AI, which also reaches Google. A shared packet is different: it arrives locked.

The protections above are aimed at someone using the same browser later, a breach of Tend's database, and anyone watching the network. The full contract is in docs/PRIVACY.md.

The path of a claim

All four steps run in the browser. Nothing in them needs a server.

  1. Read on the device

    A bank statement (CSV, OFX, or PDF) and an itemized bill, read by parsers in the browser. Nothing is uploaded unless you say yes to cloud AI.

  2. Law engine

    A C++ VM, built to WebAssembly, runs the state's law. The law was compiled ahead of time from that state's verified rules (2,730 across all 51).

  3. Cited decisions

    Each cost gets a status, an amount in integer cents, and the exact quote of the law behind it.

  4. Packet

    Michigan's form with safe fields only (for other states, a link to the program's form when Tend found one), a cited summary, and letters. The survivor sends it.

Before any of this, when the law is built

  1. Source saved with sha256
  2. Quote checked word for word
  3. Compiled by tendc (C++20) to bytecode
  4. Checked byte by byte before it runs

The numbers

51 jurisdictions
Every state and DC. Each runs its own crime victim compensation program with its own law.
824 saved sources
Statutes, regulations, and program pages, each saved with a sha256 fingerprint. 120 are copies of state statutes and regulations from Justia or Cornell's Legal Information Institute, which reprint state law.
2,730 rules quoted word for word
A rule exists only if its quote is found, exactly, in a saved source whose fingerprint still matches.
121,000 test claims, 0 mismatches
A separate Python engine, written from the same spec, must match the C++ engine byte for byte on every valid random claim, on real and random laws, and refuse the same broken ones.
183 KB law VM
The loader, verifier, and VM that run a state's compiled law, as WebAssembly. It downloads once and runs in the browser. Each state's law arrives already compiled, as its own 23 to 55 KB file.

Each number comes from a command you can rerun. The commands are in the README and docs/EVAL.md.

Real and fictional

Real
The law: 51 jurisdictions' statutes, regulations, and program pages, with every quote verified. Michigan's real application form. The engine and its tests.
Fictional
Rowan Hale, Riverbend General Hospital, every merchant, and every dollar. All people and money in the demo are made up.
Mock
The bank. Nessie is Capital One's mock bank API. On this site a confirmed payment writes a real Nessie record, in mock money. No real money moves, and Tend files nothing.

The stack

Web
Next.js, React, and TypeScript. pdf.js and pdf-lib read and fill PDFs in the browser.
Engine
A law compiler (tendc) and a bytecode VM, both in C++20. tendc compiles each state's law ahead of time and is not part of the WebAssembly build. The VM, with the loader and verifier that check a law before it runs, is built to WebAssembly for the browser. A Python reference engine, written from the same spec, checks it.
Server
FastAPI on Vercel. The C++ engine is not built there, so the Python reference engine runs the law on the server: the bill check before a payment, and a claim the survivor agrees to send when the browser cannot run the VM. Neon Postgres holds the public law, encrypted shares, short-lived payment requests, and a hash-chained payment log.
AI
Gemini Nano on the device suggests labels for costs the rules miss. The engine decides. Cloud Gemini runs only after a yes, on Google's free tier.
Hackathon tools
Tend used these at MHacks 2026, where each had a sponsor prize: Capital One's Nessie (the mock bank), Neon, Google Gemini, Figma, and a .tech domain. The sponsors backed the hackathon, not Tend.

Limits

  • Tend is not legal advice. Every total says "The program decides."
  • Only Michigan's application is pre-filled. For 47 other states, Tend links the program's blank form. For Maine, North Dakota, and Tennessee, it found no form to link.
  • The engines were written from one spec, in one project, so a shared misreading would not show up as a mismatch.

Built by Sanat Gupta at MHacks 2026 (Oct 3 to 4). Winner of Capital One's Best Use of Nessie prize. The last commit before the submission deadline is 5d1f7bd. Every commit after it is later work, including this page and the guided tour.