| 1 | # Verification |
| 2 | |
| 3 | The reframe — attestation-with-revocation instead of CI-as-gate, and the failure-mode trade it makes |
| 4 | — is an architecture bet; see [architecture.md](./architecture.md). This document holds what the |
| 5 | attestation phase actually needs: the two kinds of checks, and what makes an attestation hard to |
| 6 | forge. |
| 7 | |
| 8 | ## Two kinds of checks, two kinds of attestation |
| 9 | |
| 10 | The system must distinguish what an attestation is claiming. A single "checks passed" signature is |
| 11 | the SLSA mistake worth avoiding. |
| 12 | |
| 13 | - **Pure checks** — `nix build`, `nix flake check`, lint/type-check as derivations, |
| 14 | `nixosTest`-style integration tests (effectful inside, pure outside). Inputs content-addressed, |
| 15 | outputs deterministic; the attestation carries input, derivation, and output hashes, so **any |
| 16 | verifier can re-derive and confirm**. These are the strong attestations. |
| 17 | - **Effectful checks** — real-network tests, external APIs, benchmarks, anything not |
| 18 | bit-reproducible. The attestation is a notarization: "sealed environment $E ran $T at time $t and |
| 19 | observed $result." Trust here is closer to "I trust the signer." |
| 20 | |
| 21 | Wherever a check can be moved from effectful to pure (via `nixosTest` or microVM sandboxing), it |
| 22 | should be. |
| 23 | |
| 24 | ## The mechanism stack |
| 25 | |
| 26 | Without a TEE, attestations are exactly as trustworthy as the signing key — the same trust model as |
| 27 | code signing, plenty for non-adversarial settings. But the mechanisms stack: |
| 28 | |
| 29 | | Mechanism | What it gets you | Residual attack | |
| 30 | | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | |
| 31 | | Signing key | "Patrick says these checks passed" | Anyone with the key can lie | |
| 32 | | Content-addressed attestation tool | The tool itself is a known Nix derivation; the attestation names its hash | Malicious dev can ship a patched tool, but it will not match the canonical hash | |
| 33 | | Hermetic sandbox | `nix build` sandbox; `nixosTest` VMs; microVMs for non-Nix checks | Local root can still bypass — but bypass leaves evidence | |
| 34 | | Re-derivation audit | Pure attestations encode every input hash; verifier re-runs and confirms bit-identical | None for pure checks; effectful checks not re-verifiable | |
| 35 | | Witness sampling | Random fraction of attestations re-run on another node; trust score per attester | None — this is the backstop | |
| 36 | | Transparency log (Tessera-backed) | Every attestation appended to an external append-only log with an inclusion proof; anyone can audit existence and content over time | Orthogonal to the others — gives non-repudiation and tamper evidence, not correctness of the computation. Independent and complementary. | |
| 37 | |
| 38 | Stacked, a determined local-root actor can still forge an attestation — but only visibly (tool hash |
| 39 | mismatch), temporarily (re-derivation eventually detects), and within a bounded window (before their |
| 40 | trust score is recalculated). For pure-derivation checks this lands roughly at SLSA Level 3; for |
| 41 | effectful checks, lower — but the system knows which kind each attestation is. |