# Verifying a GuardHelm receipt without trusting GuardHelm Every event a guard's device signs is countersigned by GuardHelm on acceptance. That countersignature is a **receipt**: a small JSON object naming the tenant, the event, the order it was accepted in, the instant it was accepted, and the hash of the event itself, signed with an ES256 key whose public half is published. This document is the procedure for checking one. `scripts/verify-receipt.ts` is the same procedure as a program. Neither needs an account with us, a credential, or our cooperation on the day. If you only read one paragraph: the signed bytes are the ASCII string `guardhelm.receipt.v1`, one line feed, then the receipt's RFC 8785 canonical JSON. The signature is 64 raw bytes of `r‖s`, not ASN.1 DER. The public key is the one whose `kid` equals the receipt's own `server_key_id`. ## Run it ``` pnpm verify:receipt -- --bundle ./receipt.json --jwks https://api.guardhelm.com/v1/verification-keys/jwks.json pnpm verify:receipt -- --bundle ./receipt.json --jwks ./jwks.json --tsa-trust ./trusted pnpm verify:receipt -- --self-test pnpm verify:receipt -- --release ./release.json --jwks ./jwks.json # a client release; see below pnpm verify:receipt -- --share "https://console.example.com/shared-receipt?token=..." ``` `--bundle` reads the file the receipt page offers under "Verify it yourself". Prefer it to `--share`, which leaves the link, a bearer that opens the receipt for 45 days, in your shell history. guardhelm.com/verification publishes this recipe, its test vectors and this one file. Outside this repository, with no npm install, on Node 22.6 or later: ``` node --experimental-strip-types verify-receipt.ts --self-test ``` The script imports nothing from this repository. Copy that one file anywhere and it runs. Checking an RFC 3161 response also needs OpenSSL (`ts` and `cms`) on PATH and the relevant authority's CA in `--tsa-trust`. See [Independent timestamps](#independent-timestamps) for how to obtain it. **Run `--self-test` first.** It checks a receipt, a key and a signature frozen into the file itself. A pass means the verifier on your machine works, so a failure later is about the receipt you are holding rather than about the tool. A verification procedure nobody has executed is a hypothesis. Exit codes are not interchangeable: | code | meaning | |---|---| | 0 | the signature and canonical form verified; if timestamp responses were supplied, all verified. Not a witness claim when no responses were supplied | | 1 | signature or supplied timestamp proof **not verified**. The output distinguishes them | | 2 | the requested check could not complete (for example missing receipt key, trust file or OpenSSL). Not an accusation of forgery | | 3 | verified, but the signed bytes are not canonical. Authenticity holds; see step 2 | Codes 1 and 2 are separate because "this receipt is forged" and "I could not reach the key endpoint" are different sentences, and only one of them is ever true. ## Or let an agent do it — the MCP tool There is one machine-readable face of this procedure: an MCP tool at `POST https://console.guardhelm.com/mcp` named `gh_guardhelm_receipt_verification_v1`. It is the current MCP protocol revision (2026-07-28), stateless, unauthenticated, and it needs no account with us — same as the rest of this document. The release configuration enables the public checker, not a firm's private tools. See [`DEPLOY.md` §10](DEPLOY.md) for the deployment checks. It requires the exact header `Origin: https://console.guardhelm.com`, so it is reachable from that console and from a client that sets the header itself, not from anywhere else. Supply `canonical` and `signature`. Without a proof, or with `timestamp_anchor: null`, the original signature-only answer is unchanged: ```json { "status": "complete", "signature_valid": true, "canonical_form_valid": true, "server_key_id": "9f2c1e6a-4b70-4d18-9a3e-1c5f80b2d743", "signing_domain": "guardhelm.receipt.v1", "reason": null, "scope": "guardhelm_signature_only", "event_existence_checked": false, "chain_checked": false, "third_party_witnessed": false, "current_key_status_checked": false } ``` For a signature-only request, `status: "complete"` with `signature_valid: true` and `canonical_form_valid: true` corresponds to exit 0. A genuine signature over noncanonical bytes corresponds to 3, a failed signature to 1, and **`status: "incomplete"` is 2** — the check did not run, `signature_valid` and `canonical_form_valid` are both `null`, and `reason` is one of four: | reason | means | |---|---| | `malformed_receipt` | the string is not one well-formed receipt: not JSON, or not exactly the seven fields with their exact types. All seven are validated before any key is looked up | | `malformed_signature` | not 64 bytes of standard base64 — the frozen ES256 `r‖s` form | | `published_receipt_key_not_found` | one forced asset read completed and the id is absent, or the matching key has an unsupported purpose, algorithm, curve, or string `use` | | `verification_unavailable` | our side could not complete the check: the asset failed validation, a `kid` is duplicated, the matching JWK is malformed, a key would not import, or the request's two seconds elapsed | `incomplete` and `signature_valid: false` are as separate here as codes 2 and 1 are there, and for the same reason. A `reason` is never a statement about your receipt. Optionally pass `timestamp_anchor` from the saved receipt alongside those two arguments. A bad receipt signature never establishes a witness. With a valid signature and a supplied proof, `scope` is `guardhelm_signature_and_timestamp`; `signature_valid` is still about the signature. The separate `timestamp` result has one of these meanings: | `timestamp.status` | `third_party_witnessed` | meaning | |---|---|---| | `no_tokens` | false | the inclusion path matches the claimed root, but no authority response was supplied | | `invalid` | false | the path, root, authority, signed time or response failed verification; no witnesses are reported, even if another token was genuine | | `verified` | true | `witnesses` lists **only** verified `{authority, time}` pairs. One verified response means one witness, not two | Structurally malformed tool arguments are rejected by the MCP input schema. No receipt or timestamp is looked up, and the tool does not contact a timestamp authority. `event_existence_checked`, `chain_checked` and `current_key_status_checked` remain false in every result. **It reads a deployed static document and refreshes once for an absent key id.** The tool loads the key set from the console's asset store rather than by fetching its own endpoint. Fetching the Worker's hostname would re-enter the Worker, open a database pool, and read private signing material to answer a public question. If the receipt's `kid` is absent from the isolate's cached set, the tool bypasses that cache and reads the asset once. A failed read returns `verification_unavailable`. A successful read that still lacks the id returns `published_receipt_key_not_found`. The refresh cannot find a key missing from the deployed asset, so the rotation procedure still deploys the updated document before a new key signs anything (`docs/DEPLOY.md` §10a). **One deliberate difference from the script, and it is about revoked keys.** `verify-receipt.ts` answers a trust question — *may I rely on this receipt?* — so a revoked key gives exit code 1. The tool answers a narrower, mathematical one — *did the private half of the key published under this id produce these bytes?* — which revocation does not change, so it reports `status: "complete"`, `signature_valid: true` and `current_key_status_checked: false`. Neither is wrong; they are different questions, and the tool says which one it answered rather than letting you assume. If what you need is the trust question, read `guardhelm.state` from the key set yourself, or use the script. ## The key set ``` GET https://api.guardhelm.com/v1/verification-keys/jwks.json GET https://api.guardhelm.com/.well-known/jwks.json (identical document) ``` Unauthenticated, `Cache-Control: public, max-age=300`, strong `ETag`, `Access-Control-Allow-Origin: *`. Both addresses are one document, and a deployed GuardHelm serves it from a static asset exported from its `server_key` table rather than by querying that table per request — so reading it costs us no database connection and can never depend on one being available. An RFC 7517 JWK Set with one extra top-level member and one extra member per key, both named `guardhelm`, both safely ignored by any standard JWKS library. ```json { "keys": [ { "kty": "EC", "crv": "P-256", "x": "QBfuJWhV8Vuz8LnseIwuQr7Ymg0w-cehI88UuLHK3DA", "y": "A26FwU8rd2ncH0KCGfLqQPxhW-Sm6eZy6hgTSa93xWw", "kid": "a89b74b9-793f-4b20-9a89-3a3ad33b5af1", "use": "sig", "alg": "ES256", "guardhelm": { "purpose": "event", "state": "active", "created_at": "2026-08-23T10:44:16.537Z", "retired_at": null } } ], "revoked_keys": [], "guardhelm": { "signing_domains": { "guardhelm.receipt.v1": "…", "guardhelm.event.v1": "…" } } } ``` `kid` is the key's identifier and it is the same string a receipt carries as `server_key_id`. There is no translation step. **`purpose` matters and must be checked.** A receipt is signed by a `receipt`-purpose key and an event by an `event`-purpose key. The two are separate keys held for separate jobs, and accepting one where the other belongs gives back the property that separation exists to hold. The script refuses it. **Retired keys are served forever.** `state: "rotated"` means the key no longer signs anything new; it does not mean the signatures it already made stopped being real. A receipt signed in 2026 must still verify in 2036, so a rotated key never leaves `keys`. Dropping one would silently convert a decade of valid history into "signed by a key nobody has heard of", which reads as forgery. **`revoked_keys` is a separate array on purpose.** A revoked key is one whose private half we no longer vouch for. A verifier asking "is this `kid` trusted?" looks in `keys` and correctly gets no. But the key is still published, so an auditor holding a real receipt whose `kid` appears nowhere else can find out that it was revoked rather than being left unable to tell "revoked" from "fabricated". **On an unknown `kid`, refetch past your cache before concluding anything.** Rotation activates the new key before retiring the old one, so a receipt signed sixty seconds ago can name a key that a copy of the document five minutes old does not contain. The script fetches with `cache: "no-store"` for exactly this reason. An empty `keys` array is a fault on our side and says nothing about the receipt in your hand. ## The recipe ### 1. Get the exact bytes A shared receipt carries them at `receipt.server_receipt`: ```json { "canonical": "{\"accepted_at\":\"2026-…\",…}", "signature": "gOKlzY8pNJ…==" } ``` `canonical` is a **string**, and it is the string that was signed. Do not parse and re-serialize it before verifying. Do not reformat, re-indent, or re-order it. One byte different is a different signature. ### 2. Check that those bytes are canonical Parse `canonical`, canonicalize the result per RFC 8785, and compare byte for byte with what you were given. This step is what makes the receipt independently checkable rather than merely signed: if the two agree, anyone holding the receipt's *fields* can rebuild the exact bytes and check them. GuardHelm's canonicalization is RFC 8785 with two narrowings, both of which refuse inputs rather than accepting more: - **Only safe integers.** JCS's floating-point rules are a cross-runtime hazard we decline to own. A receipt carries no fractional number, and `ingest_ordinal` — which is a 64-bit database sequence — travels as a decimal **string**. Past 2^53 two different ordinals are the same double, so a number there would let one signature cover two different facts. - **`undefined` is an error, not a skipped key.** Skipping would make `{"b":1}` and `{"a":undefined,"b":1}` produce identical bytes: two inputs, one signature. Two details catch most independent implementations: - Keys sort by **UTF-16 code unit**, which is a plain `Array#sort()` on strings. `A` (0x41) before `z` (0x7A) before `é` (0xE9). A locale-aware sort gets this wrong. - **You cannot use `JSON.stringify` for objects.** JavaScript enumerates integer-like keys in ascending numeric order, so `{"10":1,"9":2}` stringifies as `{"9":2,"10":1}` and throws the sort away. Serialize the sorted key list by hand. Failing this step while passing step 4 means the signature is genuine and the bytes are not canonical. That is our defect, not a problem with the record — hence exit code 3 rather than 1. ### 3. Find the key Read `server_key_id` from **inside** the canonical bytes, never from any envelope around them, and find the JWK whose `kid` equals it. Confirm `guardhelm.purpose` is `receipt`. ### 4. Rebuild the signing input ``` "guardhelm.receipt.v1" || 0x0A || ``` as UTF-8. One line feed, not CRLF. No trailing newline. The domain tag is inside the signed bytes so that a signature over a receipt can never be replayed as a signature over an event envelope. ### 5. Verify ECDSA over P-256 with SHA-256. **The signature is 64-byte raw `r‖s`** per RFC 7518 §3.4, which is what WebCrypto's ECDSA produces and consumes. If you reach for `openssl dgst -verify`, it will fail, and it will fail for the wrong reason: openssl expects an ASN.1 DER `SEQUENCE { INTEGER r, INTEGER s }`. Split the 64 bytes in half and DER-encode them first, or use a WebCrypto implementation and skip the conversion. ## Independent timestamps First verify the receipt signature, as above. A saved receipt carries its optional `timestamp_anchor` beside `server_receipt` (under `receipt` in the share API response). Missing or `null` means the file has no timestamp evidence. An empty `tokens` list supplies no independent witness either. The included `time` and `authority` are labels to **check**, not inputs to trust. **Rebuild the root.** Hash the single byte `00`, the exact signing input from step 4 and the decoded 64-byte signature, in that order, with SHA-256. Walk `path` from leaf to root. At each step hex-decode the 32-byte sibling; `side` names the *sibling's* position. Hash the single byte `01` followed by the raw left and right children. An odd unpaired node advances unchanged, without a path entry. For a singleton the path is empty and the root is the leaf. Require equality with `timestamp_anchor.root`. Here is an independent implementation using only Python 3's standard library. Run it in an empty working directory with the saved file named `receipt.json`; it writes only fixed names and refuses duplicate or unrecognized operators. `root.hex` is the recomputed root, not one copied from the file. ```sh python3 - <<'PY' import base64, hashlib, json, re from pathlib import Path doc = json.loads(Path("receipt.json").read_bytes()) r = doc.get("receipt", doc) s, a = r["server_receipt"], r.get("timestamp_anchor") if a is None: raise SystemExit("No timestamp proof supplied") if not isinstance(a["path"], list) or len(a["path"]) > 12: raise ValueError("bad path") if not isinstance(a["tokens"], list) or len(a["tokens"]) > 2: raise ValueError("bad response list") def digest(text): if not re.fullmatch(r"[0-9a-f]{64}", text): raise ValueError("bad SHA-256 hex") return bytes.fromhex(text) sig = base64.b64decode("".join(s["signature"].split()), validate=True) if len(sig) != 64: raise ValueError("bad signature length") h = hashlib.sha256(b"\x00guardhelm.receipt.v1\n" + s["canonical"].encode("utf-8") + sig).digest() for step in a["path"]: sibling = digest(step["hash"]) if step["side"] == "left": children = sibling + h elif step["side"] == "right": children = h + sibling else: raise ValueError("bad side") h = hashlib.sha256(b"\x01" + children).digest() if h != digest(a["root"]): raise ValueError("receipt does not lead to supplied root") Path("root.hex").write_text(h.hex()) seen = set() for t in a["tokens"]: name = t["authority"] if name not in ("FreeTSA", "Sigstore") or name in seen: raise ValueError("bad authority") seen.add(name) der = base64.b64decode(t["response_base64"], validate=True) if (not 2 <= len(der) <= 32768 or der[0] != 0x30 or base64.b64encode(der).decode() != t["response_base64"]): raise ValueError("bad response") n = der[1] if n < 128: end = 2 + n else: k = n - 128 if k not in (1, 2) or len(der) < 2+k or der[2] == 0: raise ValueError("bad DER length") size = int.from_bytes(der[2:2+k], "big") if size < 128: raise ValueError("bad DER length") end = 2 + k + size if end != len(der): raise ValueError("truncated or padded response") Path(name.lower() + ".tsr").write_bytes(der) print(name, "claimed UTC time (not verified):", t["time"]) if not seen: print("Inclusion matches; no independent response supplied") PY ``` **Establish trust separately.** Use a previously trusted operator CA or authenticate its publication through an independent channel. Never put a certificate from the receipt or response in `-CAfile`. Use a separate CA for each operator, **not** a system-wide or combined trust bundle. A response's included certificates may supply the signer/chain but must not choose the trust anchor. * **FreeTSA:** obtain [`cacert.pem` from FreeTSA](https://www.freetsa.org/files/cacert.pem) and save the single root certificate as `trusted/freetsa.pem`. * **Sigstore:** obtain its authenticated [TUF trust root](https://docs.sigstore.dev/about/security/). The [pinned publication](https://github.com/sigstore/root-signing/blob/8aaffe4419c50fdc0f65aa7f091dd2f20a6b163c/targets/trusted_root.json) lists the dedicated timestamp CA under `timestampAuthorities`, **not** the Fulcio CA. To extract it from your independently obtained `trusted_root.json`: ```sh mkdir -p trusted python3 - <<'PY' | openssl x509 -inform DER -out trusted/sigstore.pem import base64, json, sys t, = [t for t in json.load(open("trusted_root.json"))["timestampAuthorities"] if t["uri"] == "https://timestamp.sigstore.dev/api/v1/timestamp"] sys.stdout.buffer.write(base64.b64decode(t["certChain"]["certificates"][-1]["rawBytes"], validate=True)) PY ``` The SHA-256 fingerprints of these individual DER certificates (not their PEM file contents) are: | authority | CA SHA-256 | timestamp signer SHA-256 | |---|---|---| | FreeTSA | `a6379e7cecc05faa3cbf076013d745e327bbbaa38c0b9af22469d4701d18aabc` | `32e841a95cc1164101ffde41298ef2fc75c1c4372ef095e88a6bbd47dfb191fc` | | Sigstore | `2aca8fea5d3ce48b01cc77076293c280e6c23ffe44034757ee7833ca9f45d633` | `85f927bc07ab62cac3b44356c10efc81b2c6883fda7ab9e6d870d9d13acd05b7` | **Verify the original RFC 3161 response**, once per operator present in the file. For FreeTSA: ```sh openssl x509 -in trusted/freetsa.pem -noout -fingerprint -sha256 openssl ts -verify -digest "$(cat root.hex)" -in freetsa.tsr -CAfile trusted/freetsa.pem openssl ts -reply -token_out -text -in freetsa.tsr openssl ts -reply -token_out -in freetsa.tsr -out token.der openssl cms -verify -binary -inform DER -in token.der -noverify -signer signer.pem -out content.der openssl x509 -in signer.pem -noout -fingerprint -sha256 ``` For Sigstore, use `sigstore.tsr` and `trusted/sigstore.pem` instead. Require **Verification: OK**, matching CA **and actual signer** fingerprints, `Hash Algorithm: sha256`, and a `Time stamp` equal to that token's claimed ISO UTC time. The `cms` step identifies the signer after `ts -verify` has already verified its timestamping purpose and chain; `cms -noverify` alone does **not** establish trust. Use `-digest` with the recomputed 64 hex characters: the root **already is the SHA-256 imprint**. `-data root.hex` hashes the hex text; `-data` on the binary root also hashes it a second time. The file is a complete TimeStampResp, not a bare CMS token; do not use `-token_in`. For archival verification, add `-attime ` for the token's signed `Time stamp` to validate the certificate at issuance. None of these offline checks consults a live revocation service. A valid response means the countersigned bytes existed **by that operator's signed time**, not that the guard was present, that either clock in the record was accurate, or that the entire ledger was complete or in that order then. A later timestamp on an older receipt proves only the later upper bound. One valid response is one witness; a second, different operator supplies its own bound. Do not count an absent, repeated, malformed, mislabeled or untrusted response as a witness. Do not report the supplied bundle as verified if any included proof fails. This is the authority's **stated UTC time** (`genTime`), not a subsecond physical UTC guarantee. Read the signed `Accuracy` field, if supplied, and the authority's clock policy when interpreting that bound. In `test/fixtures/receipt-tsa/`, FreeTSA gives no `Accuracy` and Sigstore specifies one second. The `.000Z` in a JSON display is formatting, not a precision claim. ## Test vectors Frozen, generated once, never regenerated. The private half existed inside one `node` process and was discarded. ``` canonical {"accepted_at":"2026-03-14T09:26:53.589Z","event_hash":"5d41402abc4b2a76b9719d911017c592a1b2c3d4e5f60718293a4b5c6d7e8f90","event_id":"01936f2a-7c58-7a1b-9e44-2d8c0f5b3a97","ingest_ordinal":"41","schema_version":1,"server_key_id":"9f2c1e6a-4b70-4d18-9a3e-1c5f80b2d743","tenant_id":"3a7d5c92-8e41-4b6f-90ad-6f2b1c4e8d05"} signature gOKlzY8pNJiABhYqdN9nLUdPCV4bm++ZdtPFvv8wJyheCvNHXmsbvSDKZNE1Q7rsuDrYOO+Uhy9fgE/gTFF5nw== kid 9f2c1e6a-4b70-4d18-9a3e-1c5f80b2d743 x AlFo0yCTqgyCfVldRTAc6FGZFGhPkYX4wS_ylDRP3-o y kTp63Ue6qt0anK-C9uECPyBFeU1t5imscM7CF4Lm77I ``` Canonicalization vectors, for step 2: | input | canonical output | |---|---| | `{b:1,a:2}` | `{"a":2,"b":1}` | | `{"é":1,z:2,A:3}` | `{"A":3,"z":2,"é":1}` | | `{"10":1,"9":2,"1e3":3}` | `{"10":1,"1e3":3,"9":2}` | | `{nested:[1,{y:null,x:[true,false]}],"":0}` | `{"":0,"nested":[1,{"x":[true,false],"y":null}]}` | The third one is the `JSON.stringify` trap. If your implementation produces `{"9":2,"10":1,…}`, it will disagree with us on any receipt whose fields happen to sort differently from their insertion order — which is most of them. ## What a verified receipt proves, and what it does not It proves that **GuardHelm's receipt key signed exactly these bytes**: this tenant, this event id, this stated position in the acceptance order, this stated acceptance time and this event hash. It does not rule out conflicting receipts that were never disclosed. It does not, on its own, prove that the event was signed by a particular guard's device, that the device's key was attested by hardware, or that the position attached to it is honest. Those are separate claims carried by separate fields of the event, and the shared-receipt document labels each one rather than folding them into a single green tick. A receipt binds the record to a moment in our ledger; it does not launder everything the record asserts. The signature alone says nothing about independent time. Only a matching inclusion proof and a verified timestamp response establish the independent upper bound described above. ## Verifying a client release A client release is the one document a firm sends its client automatically: a shift report or an incident report, written field by field so it carries no guard identity, place, hours or pay. The server signs it as an event of kind `client_release`. Its evidence bundle carries everything needed to check it: ```json { "format": "guardhelm.client_release_bundle.v1", "release_id": "…", "envelope": "{\"actor_id\":…,\"kind\":\"client_release\",…}", "signature": "…", "signer_key_id": "…", "body": { "action": "release", "content_digest": "…", "document": { … }, … }, "body_key": "…", "receipts": [ { "canonical": "…", "signature": "…" } ] } ``` ``` pnpm verify:receipt -- --release ./release.json --jwks ./jwks.json ``` The script checks five things, in this order: 1. **The envelope signature.** The signed bytes are `guardhelm.event.v1`, one line feed, then the envelope exactly as given. The key is the one whose `kid` is `signer_key_id`, and its purpose must be `event`, not `receipt`. 2. **That the envelope is this release.** `kind` is `client_release`, `signer_kind` is `server`, and `event_id` equals `release_id`. 3. **The body commitment.** HMAC-SHA256, keyed with the 32 bytes of `body_key`, over the RFC 8785 canonical JSON of `body`, must equal the envelope's `body_commit` in hex. This is the step that covers the prose. GuardHelm stores a release's summary and activity text encrypted, and the bundle carries them decrypted, so this step is what stops a server restoring different words. 4. **The document.** `content_digest` is SHA-256 over the canonical JSON of the document without `reference`, `released_at` and `released_by_label`. A supervisor previewed exactly that content, and the release was refused unless it matched. `reference` must be `CR-` plus the first twelve hex digits of the release id, upper case, and `released_at` must equal the envelope's `captured_at`. 5. **The records it cites.** Each bundled receipt is checked with the receipt recipe above. Each must name this tenant and one of `included_event_ids`, and the document's `receipts[].fingerprint` values must be exactly the receipts' `event_hash` values. Exit 0 means all five hold. A one-byte change to the document exits 1. A key missing from the key set exits 2, as for a receipt. A release is fixed when it is signed. A record that reaches GuardHelm afterwards, such as a scan from a phone that was offline, is not in it, and appears only if a supervisor releases the report again. The new release names the one it supersedes. A withdrawal is a separate signed event, so a withdrawn release still verifies: withdrawal is a later statement about the release, not an edit to it. **The release check does not verify independent timestamps.** A verified release proves that GuardHelm's keys signed these bytes, not when a third party first saw them. Check a saved receipt with its own inclusion path and timestamp evidence separately. **Addenda signed by older guard apps.** An incident addendum signed by a guard app built before the v2 addendum commitment covers only its narrative. It does not sign which report it answers; the server's record of the incident it was filed against is the only link. A v2 addendum signs `{incident_id, narrative}`. ## Where this lives | file | what it is | |---|---| | `apps/api/src/verification-keys.ts` | the endpoint | | `packages/domain/src/verification-keys.ts` | the published document, built from `server_key` rows | | `scripts/verify-receipt.ts` | the recipe, executable, no repository imports | | `packages/evidence/src/canonical.ts` | GuardHelm's own canonicalization | | `packages/evidence/src/receipt.ts` | the receipt shape, its signing bytes, and `verifyReceiptBytes` — the one verifier both the API and the MCP tool call | | `apps/api/src/site-mcp.ts` | the MCP tool: admission control, the published-key reader, and the one tool | | `scripts/export-verification-keys.ts` | `pnpm keys:export` writes the deployed asset from `server_key`; `--check` compares the live rows with the file byte for byte | | `apps/web/public/guardhelm-verification-keys.jwks.json` | generated by `pnpm keys:export -- --write`; it must be checked and committed before deployment | | `test/verify-receipt.test.ts` | proves the two implementations agree, and both agree with the frozen vector | | `apps/api/src/client-release.ts` | signs client releases and builds the evidence bundle `--release` checks | | `test/client-release.test.ts` | releases a report under a vault key, reads it back and verifies the bundle offline | | `test/site-mcp.test.ts` | proves the tool agrees with that same frozen vector, and that it claims nothing more |