Design: "Only the App Sees It" — Privacy by Default for a Finance Aggregator
I don't want to see my users' balances, and I don't want to be able to. The design for encrypting every financial field, masking the operator, and unmasking only with the user's time-limited grant.
Status, up front
This is a design writeup. Bank tokens are encrypted today (X07). Encrypting every financial field, the masked operator view and user-granted access must ship before any tester connects a real bank.
The goal, stated honestly
The app's own jobs (sync, forecast, alerts) decrypt a user's data in memory to do the math. Nothing else does. Not me, not future staff, not logs, analytics, error reports or database dumps. People are private about money. I am too.
Envelope encryption
- Every financial field encrypted per user: amounts, balances, merchants, descriptions, account names, bills, paychecks, plans and notes.
- Each user has a data key. Data keys are wrapped by a master key in a managed key service, never in the database or environment files.
- Role separation: the web app's database role can read ciphertext; only the job role can ask the key service to unwrap keys.
- Readable fields are only what the database needs to filter and sort: user ID, dates, category and record types. Sorting by amount happens in memory, per user, after decryption.
Masked by default, unmasked by consent
- No admin screen that browses user data. Internal tools show
$•,•••andMerch•••. - The user grants support access, not me: a scope (one account or all) and a duration (24 hours by default, 7 days at most), revocable anytime. Every view is logged, and the user gets an email listing what was viewed. The operator can't self-grant.
- Emergency access (a legal order, an active incident) needs a written reason, is logged, and the user is told as soon as the law allows.
Closing the side channels
- Allow-list logging: IDs, counts, durations, error codes. A CI check fails the build if an amount or merchant field reaches a logger.
- Analytics carry event types and counts, never amounts.
- Dev and local use the sample household and Plaid Sandbox only. Production data is never copied down "just to debug".
- Beta accuracy is stored as an error percentage, never the balances behind it.
Leaving
Export everything as CSV or JSON. Delete everything removes the rows and destroys the user's data key, so any copy left in a backup becomes unreadable before the backup even ages out.
Level 2 (later)
An optional mode where even the server can't read the data: the forecast runs on the device, data is stored as blobs encrypted with a key derived from the user's passkey (the WebAuthn PRF extension), plus a printed recovery code. It costs server-side digests and adds real key-management work, which is why it comes second.
How I'll prove it
- Reading a financial column through the web role returns ciphertext
- A support view without an active grant is denied, and the attempt is logged
- A planted dollar amount in a log line fails CI
- After delete-everything, a restored backup can't be decrypted
- The forecast is identical before and after encryption
Sources: DecoupleX Finance session notes §8 (10 Nov 2026), roadmap, v0.3 Step 0 (10 Nov 2026)