Proof and the Trust badge
This content is not available in your language yet.
Each AI call writes a receipt: a record, signed on the user’s device, of which mode ran, what the device checked and what it did not. A receipt holds fingerprints, never chat text.
The Trust badge shows the mode in plain words and opens the receipt. The badge itself is not proof. Anyone can draw a badge. The receipt file, checked by a checker you run yourself, is the proof.
Vault receipts are not written yet (Vault does not call the proof module). Sealed AI and Masked AI receipts are.
What this does not protect
- A receipt is not a guarantee about your app. It says what ran on the user’s device and what that device checked. Code in your page could make the device sign a false receipt. It does not prove your app has no other code that reads text.
- A Masked AI receipt says “pattern-based; names only when you list them”. It never says sealed.
- A receipt holds no chat text. You cannot rebuild a chat from it.
- An anchor from the same device shows the file was not changed after the device signed it. It does not show who controls the key.
The full list: limits.
The badge words
Section titled “The badge words”The words are fixed in the package. You cannot rename them.
| Mode and outcome | Badge says |
|---|---|
| Sealed AI, sent | Sealed AI: server checked, chat encrypted to it |
| Sealed AI, refused | Sealed AI: server not verified, chat not sent |
| Masked AI, sent | Masked AI: pattern-based, not encryption |
| Masked AI, refused | Masked AI: chat not sent |
| Vault, key change | Vault: keys changed on this device |
Click the badge to open the receipt panel. It shows the receipt’s one fixed sentence, what was checked (each check passed, failed or does not apply), what was not checked in fixed words, and three buttons: Export receipt, How to check it and Close. Escape closes it.
What a receipt holds
Section titled “What a receipt holds”| Part | Meaning |
|---|---|
mode, outcome |
sealed-ai or masked-ai; sent or refused (vault has key-event). |
statement |
One fixed sentence per mode and outcome. |
checks |
What the device checked: passed, failed or does not apply. |
not_checked |
What it did not check, as fixed ids. Some can never be left out (the app’s own code, this copy of the SDK, the device, who controls the signing key). |
| Sealed AI part | The evidence the key came from: the chip’s report digest, the code measurement and where its approval came from (measurement_source: sigstore with the release, or sdk-pin when you pinned it), previous_release (true when a rollout made the release before the latest vouch), firmware level, the key and how it was bound, freshness (static today: the provider’s evidence has no nonce), gpu (not-checked-by-device), the model name, and salted fingerprints of the request and answer. A refused receipt has failure (the error code) and no fingerprints. |
| Masked AI part | The provider and host (provider_source: app-route means your route said so, which the device cannot check; request-path means it was read from the path), counts by type, how many names you listed, salted fingerprints, and whether the answer ended cleanly. |
Fingerprints are salted hashes. The salts stay on the device. Nobody can test guesses against a fingerprint.
One full example: a badge and an export button
Section titled “One full example: a badge and an export button”import { useMemo, useState } from "react";import OpenAI from "openai";import { findTrustError, sealedFetch } from "@geometer/trust/sealed-ai";import { TrustBadge } from "@geometer/trust/react";import type { Receipt } from "@geometer/trust/proof";
const APP = "my-app";
export function PrivateChat({ userId }: { userId: string }) { const [answer, setAnswer] = useState(""); const [receipt, setReceipt] = useState<Receipt | null>(null);
// Make the client once: sealedFetch keeps the verified key between calls. const ai = useMemo(() => new OpenAI({ baseURL: `${window.location.origin}/api/trust/sealed-ai/v1`, apiKey: "not-used", dangerouslyAllowBrowser: true, maxRetries: 0, fetch: sealedFetch({ app: APP, user: userId, onReceipt: setReceipt }), }), [userId]);
async function ask(question: string) { try { const reply = await ai.chat.completions.create({ model: "<model>", // an open model that Tinfoil offers messages: [{ role: "user", content: question }], }); setAnswer(reply.choices[0]?.message.content ?? ""); } catch (err) { setAnswer(findTrustError(err)?.message ?? "Something went wrong."); } }
return ( <div> <button onClick={() => ask("Hello")}>Ask</button> <p>{answer}</p> {receipt && <TrustBadge receipt={receipt} ledger={{ user: userId }} />} </div> );}onReceipt gives you each receipt after it is written, so you do not need listReceipts(). The panel’s Export receipt button downloads trust-receipts.json. Pass ledger={{ user }} (and receiptStore if you passed one) so the button reads the same ledger that wrote the receipt.
To build your own export button, call exportReceipts({ app, user }) from @geometer/trust/proof. It returns the receipt file as one string. listReceipts({ app, user }) returns the receipts on this device.
To delete old receipts and save space, call deleteReceipts({ app, user, keepLast: 100 }) or deleteReceipts({ app, user, before: new Date(Date.now() - 90 * 86400_000) }) (give either or both; a receipt goes if either says so). It removes receipts from the start of the list only, never the newest one, and the next export still verifies: the file says where the kept receipts join the older ones. It returns { deleted, kept }. It cannot be undone, so export first if you want to keep the old ones.
The ledger belongs to one app and user. Without user, people who share a browser share a ledger and can export each other’s receipts (no chat text, but times and fingerprints). Always pass user.
Check a receipt
Section titled “Check a receipt”Use the receipt file, not the badge.
trust-verify receipts trust-receipts.jsontrust-verify unpack trust-receipts.json --out ./checkgeo-verify ./check/pack.json --anchor ./check/anchor.jsonTo prove that a request or an answer is exactly what a receipt covers, export with the salts (exportReceipts({ withOpenings: true }); the file then holds the salts, which let anyone who has the text test it, so share it only with the reviewer) and give the reviewer the text:
# files named <receipt id>.request and <receipt id>.response in ./texttrust-verify receipts trust-receipts.json --openings --plaintext-dir ./textEach fingerprint is reported as MATCH, MISMATCH, NOT-SUPPLIED or NO-OPENING (the file has no salt). The text is never printed. A MISMATCH makes the verdict invalid.
| Checker | Checks | Where |
|---|---|---|
trust-verify receipts FILE |
The whole file: the signatures, each receipt’s fixed rules, and the hardware evidence the file carries, re-checked from the raw bytes | Trust’s own checker (closed) |
trust-verify unpack FILE --out DIR |
Writes pack.json and anchor.json |
Same program |
geo-verify |
Only that the file was not changed after the device signed it | Public, free |
Exit codes of trust-verify: 0 verified, 1 invalid, 3 unverifiable, 64 usage or unreadable file. A Sealed AI receipt whose evidence is not in the file is not re-checked; the output says how many were. The next steps are in for security teams.
Common mistakes
Section titled “Common mistakes”| Mistake | What goes wrong | Do this instead |
|---|---|---|
| Showing a badge with no receipt | It proves nothing. | Pass receipt to <TrustBadge />. |
| Writing your own badge words | The words may promise more than the mode does. | Use <TrustBadge />. |
| Showing a Sealed AI badge on a Masked AI chat | The user is told something false. | Show the badge from that call’s receipt. |
Leaving out user |
People who share a browser share receipts. | Pass the signed-in user’s id. |
| Logging chat text next to the receipt | You defeat the point. | Log nothing from the chat. |
See also: API reference.