Passkin

The legal policy engine and the optional Verified layer

Status: scaffolding built (2026-10-05). No vendor adapter is bundled and no capture exists: the feature is closed everywhere until an operator contracts a certified provider, counsel approves the consent text, and a place is cleared. Tests: packages/db/tests/legal.test.ts, apps/auth-broker/tests/legal.test.ts, apps/id/tests/verified.test.ts. Why it is built this way: legal/REGISTER.md §1 and §10; the product: PASSKIN-ID.md.

Signing in with Face ID or a fingerprint is a passkey: the device checks the person and Passkin never receives a face. That is not this page. This page is the other thing — an optional, one-time check that a person is who they say they are, with a document and a selfie, run by a certified verification partner — and the rules that keep it from becoming a legal liability: Illinois BIPA, Texas CUBI, Washington's statute, and GDPR / UK GDPR Article 9 all treat a face measurement as special. Passkin therefore never runs the biometric engine itself, never stores an image, a video or a template, and offers the check only where, and only after, someone accountable has said it may be.

The policy engine

Features with legal conditions read a policy instead of carrying a country list. decide(feature, place) answers one of

blocked do not start it
consent start it only with the person's recorded consent
allowed start it

and says why. The features today: verified_layer (sensitive), sms and whatsapp (one-time codes; the messaging guards will read them when phone sign-in ships).

How a decision is reached (packages/db/src/legal/policy.ts, pure and tested):

  • Most specific rule wins: a region (US-IL) beats a country (US), a country beats a group (@EEA, @EU), a group beats *. At the same level an operator's decision beats the built-in default. So clearing the US does not clear Illinois, Texas or Washington — each stays shut until it is cleared on its own, with its own reference.
  • A sensitive feature is closed wherever the place is not known. A location that cannot be established is not a place anyone has cleared. (The place comes from the platform's geo headers behind a trusted proxy — Vercel, Cloudflare, CloudFront — and is unknown otherwise.)
  • Defaults are conservative. verified_layer is blocked everywhere, with the reason on record (biometric_statute for IL/TX/WA; gdpr_art9 for the EEA and the UK, with what a clearance must cover: explicit consent, a DPIA, a processor agreement). SMS is allowed for transactional codes in the US, Canada, the UK and the EEA and blocked elsewhere (sender registration); WhatsApp is blocked until a route exists.
  • Loosening a default needs counsel's reference. An operator writing a row that is looser than the built-in policy at that scope must give the clearance — where the written sign-off can be found — or it is refused. Tightening never needs one. A face check can never be merely allowed: its loosest answer is consent, whatever a row says. A sensitive feature cannot be opened for *: it is cleared country by country.
  • Nothing is deleted. Removing a decision marks the row; who allowed what, where, when and on whose sign-off stays.

Operator API

Only the people running Passkin (PASSKIN_OPERATOR_EMAILS) — everyone else, and every API key, gets a 404:

GET /v1/manage/operator/legal each feature's built-in rules with reasons and what a clearance must cover, the live decisions, and the consent text counsel is asked to approve (both languages)
GET …/legal/decide?feature=&country=&region= a dry run: what would happen there, and why
POST …/legal/overrides { feature, scope, effect, reason, clearance } — scope is *, US, US-IL or @EEA
DELETE …/legal/overrides/:id take a decision back (it stays in the history)
GET …/legal/history every decision ever recorded
POST …/legal/notices/verified_layer/approve { reference } — counsel's approval of the text as it stands; DELETE …/approval withdraws it

What a person goes through

In their Passkin ID (/account/verified, English, Arabic, Spanish and French), only if an operator has contracted a partner:

  1. Not available — said in one sentence, whatever the reason (closed here, unknown place, text not approved): the rule that closed it is the operator's business.
  2. The notice: what the partner will do (photograph an identity document, record a short selfie video, measure the geometry of the face), that Passkin keeps only the result, how long the partner keeps images ("within 30 days": from its contract), how to withdraw, and that nothing changes about signing in if they decline. Two boxes, both unticked: "I agree that Partner may measure my face for this one check" and "I am 18 or older". Needs a proof from the last ten minutes, like any change to how one gets in.
  3. Start — they go to the partner and return; the partner's signed notice of the result arrives at POST /verification/webhook/:vendor (checked by the adapter; anything not genuine gets a bare 400).
  4. Withdraw — always one press, never needs a recent proof, and works even when the feature has since been closed. The outcome ends at once; the partner is asked to delete; if it cannot be reached the job POST /internal/cron/verification (CRON_SECRET) asks again until it has.

What is kept

Consent person, text version and hash (every word, every language), language shown, partner, country and region at the time, adult confirmed, given/withdrawn
The check partner, partner's reference (kept only so the partner can be asked to delete), method, status, assurance (low / substantial / high; anything else a partner sends is low), dates; a failure is a short code, never the partner's words
Never an image, a video, a measurement, a template, a document number, a name or a birth date from the document

A verified outcome counts for two years, then expires. Account export includes both tables without the partner's reference; account deletion asks the partner to delete first.

Adding a partner (an operator task)

A partner is a contract (data-processing agreement, sub-processor listing, retention terms) and an adapter implementing VerificationVendor (packages/db/src/services/verification.ts): name, displayName, methods, retention (in words, from the contract), start(), deleteData() and outcomeFromWebhook() (which must authenticate the notice and throw if it cannot). Pass the adapters to the Passkin ID app as verificationVendors. Then, in this order — each step is a recorded decision:

  1. counsel reviews the consent text (GET …/legal) and approves it: POST …/legal/notices/verified_layer/approve;
  2. counsel clears a place: POST …/legal/overrides with effect: "consent" and the reference;
  3. the DPIA (EEA/UK) and, for IL/TX/WA, the written release and retention schedule are done before those regions are cleared.

Changing a word of the notice changes its hash: the approval no longer matches, the feature closes, and people who agreed to the old words are asked again.

Not built

Any real vendor adapter; digital credentials (EUDI wallet, mobile driving licence — which need no biometric processing by us); min_assurance=verified as a requirement a product can set in its sign-in (the standing outcome is available to the code as verifiedStatus, and nothing is shared with a product yet); an operator dashboard page for the policy (the API is there); parental flows for minors (adulthood is confirmed by the person and no more); retention beyond the outcome. Each is gated by legal/REGISTER.md.

Ready to try it?

Create a project — the dashboard fills these snippets in with your own keys.

Open the dashboard