Inspiration
Every AI vendor says “we don’t train on your data.” Maya still has to paste a diagnosis into a chat box to learn if she qualifies for help. That is not privacy. Midnight’s job is to prove which rules were followed when a model acted.
What it does
Oath is a policy-bound copilot.
- Maya seals a vault of ten facts. The ledger stores commitments, not plaintext.
- She publishes a grant-screen policy: city, income band, household size, age 18+. Diagnosis, SSN, name, exact income, and email stay closed.
- The copilot answers eligibility from the redacted view only.
- Compact attests the prompt hash, the openings, and the output hash.
- A grant officer verifies the attestation. Forcing a diagnosis bit fails the circuit.
How we built it
- Compact (
contracts/oath.compact) —registerVault,publishPolicy,attestwithdisclose(),persistentHash, bitmask subset, transcript anti-replay. - Compact JavaScript implementation (
src/lib/contract.ts) — same circuits, runnable in the browser without a proof server. - Redaction driver — the host may only forward fields the circuit allowed.
- Policy-bound copilot — local model that refuses sealed medical/financial questions.
Challenges
Privacy is the default in Compact: every witness-derived value needs an explicit disclose() before it can hit the ledger. The hard part was binding the model to those openings so attestation is not just “a hash happened.”
Accomplishments
- A complete Harbor City case: vault → policy → copilot → attestation → officer view → rejected leak.
- Tests that prove SSN/diagnosis never appear in ledger JSON.
- A split inspector: authorized vs sealed.
What we learned
Redaction without a circuit is theater. A bitmask on Midnight is a product: HR, clinics, and grant desks can use AI without becoming the data lake.
What’s next
Compile with compactc, deploy to Midnight preview, hold the vault secret in Lace, and point the copilot at any vendor that will accept authorized fields only.
Built With
- compact
- crypto
- midnight
- next.js
- typescript
- zero-knowledge
Log in or sign up for Devpost to join the conversation.