Launch offer: the first 1,000 users get Settl free for a year* Claim your spot
settlbuilding in public

The data-isolation audit playbook (find leaks before users do)

The short version

A pre-launch audit found that one lookup would return other people's contact details to anyone who asked. Nothing crashed, no error was ever thrown, and no alarm would ever have fired. The app looked completely healthy.

Bugs that leak do not announce themselves, which means monitoring will never find them. The only thing that finds them is a test that deliberately asks: can this user reach something that belongs to someone else.

Copy these prompts

Paste them into Claude Code (or any AI that can see your project), in this order. Each one answers a different question, and the first is usually the one that matters.

1. List every way your app hands back a person's data

List every route, screen or function in my app that can return information about a person, including lookups by phone number, email, username or id. I want the complete list, not the obvious ones.

2. Try to read somebody else's, deliberately

For each of those, write me a check that signs in as one user and deliberately tries to fetch a different user's data. Tell me which ones currently return something they should not.

3. Turn them into tests that keep running

Turn those checks into permanent tests that run automatically on every change, so a new feature next month cannot quietly reopen the hole. Show me where they live and how I would know when one fails.

The scariest bug never crashes. A pre-launch isolation audit found a user-lookup endpoint of mine quietly returning other people's phone numbers, and an edge case where "me" could resolve to a friend's identity. Zero exceptions thrown, ever. Your crash reporter is structurally blind to the bug class that actually kills startups.

The audit playbook

  1. Ask the one question, per table: "What does user A see of user B?" Write the intended answer down for every table/collection before you test anything. Anything you can't answer crisply is already a finding.
  2. Two-user test harness. Seed two users (A and B) with data, authenticate as A, and call every read endpoint fishing for B's data: direct IDs, list endpoints, search, lookups, exports. Automate it so it runs in CI forever.
  3. Hunt the "helpful" endpoints first. Leaks hide in convenience routes: lookup-by-phone/email, search, autocomplete, invite flows. Mine was a user-lookup endpoint: built for contact matching, leaking phone numbers as a side effect.
  4. Test identity resolution edges. "Me" endpoints, session caching, and impersonation-ish flows. My worst edge: me resolving to a friend. Test with fresh tokens, stale tokens, and back-to-back requests as different users.
  5. Return 404, not 403, for other people's resources. 403 confirms the resource exists. That's an enumeration leak. Strangers should get the same response as for a nonexistent ID.
  6. Enforce scoping in one place. Every query joins through the membership table (one shared JOIN memberships WHERE user_id = me.id helper), not per-route WHERE clauses someone will forget. Middleware or query-builder helpers, reviewed once.
  7. Write isolation tests for every new table, permanently. My rule since the audit: a migration adding a table isn't done until the "A can't see B" test exists. It's a checklist item, not a judgment call.
  8. Audit response shapes, not just access. You may be authorized to see a user but not their phone number. Strip fields at the serialization boundary with an explicit allowlist (wire schemas), never by spreading DB rows.
  9. Prove it with tests, not vibes. "We use an ORM / we have auth middleware" is not evidence. The passing two-user suite is.

Steal this for your app

Run this on your codebase

Paste this into Claude Code in your repo:

Audit this repo for cross-user data isolation leaks.
For every table or collection, answer: what does user A see of user B? Flag any answer that is unclear.
List every read endpoint and verify its query scopes to the authenticated user, especially lookup, search, autocomplete, invite, and export routes.
Check identity resolution: "me" endpoints, session caching, and token reuse across users.
Flag 403 responses on other users' resources where a 404 would prevent enumeration.
Check serialization: flag responses built by spreading DB rows instead of explicit field allowlists.
Propose a two-user test harness that authenticates as A and fishes for B's data on every endpoint.
Report findings as a checklist before changing anything.

Get the next one in your inbox