aien-receipts
Append-only AIEN verification receipts, indexed by repository and exact source commit. Read verdicts, signatures and retained logs before making a claim.
Brought by drakestapleton
aien-receipts / audit / VERIFY.md
| 1 | # Verifying an org audit stamp yourself |
| 2 | |
| 3 | Every step below runs on your own machine against public data. You need `git`, Python 3.10+, |
| 4 | a C compiler (for the pinned `crumb` checker) and, for the signature, the GitHub CLI. |
| 5 | |
| 6 | ## 1. Install the pinned tools |
| 7 | |
| 8 | ```sh |
| 9 | git clone https://github.com/aien-dev/aien-receipts && cd aien-receipts |
| 10 | python3 audit/tools/install_tools.py /tmp/audit-tools |
| 11 | ``` |
| 12 | |
| 13 | The installer downloads every binary listed in `audit/tools/tools.lock.json` and refuses any file whose |
| 14 | SHA-256 differs from the lock. Python tools (semgrep, zizmor) are pip-installed at exact versions into |
| 15 | `/tmp/audit-tools/venv`; the semgrep rules are checked out at the pinned commit; `crumb.c` is fetched |
| 16 | from `aien-architecture-mv` at the pinned commit and its SHA-256 compared before it is built. |
| 17 | |
| 18 | ## 2. Check that the stamp is well formed |
| 19 | |
| 20 | ```sh |
| 21 | python3 audit/tools/verify.py audit/stamps/<repo>/<sha> |
| 22 | ``` |
| 23 | |
| 24 | This validates the schema, recomputes the SHA-256 of every check output and review report the stamp |
| 25 | cites, and recomputes the verdict ceiling: a stamp may never claim a better verdict than its own |
| 26 | contents allow (see `audit/tools/stamp.py`). |
| 27 | |
| 28 | ## 3. Re-run the deterministic checks (public repositories) |
| 29 | |
| 30 | ```sh |
| 31 | git init -q /tmp/src && git -C /tmp/src fetch -q https://github.com/aien-dev/<repo> <sha> |
| 32 | git -C /tmp/src worktree add -q --detach /tmp/wt <sha> |
| 33 | python3 audit/tools/verify.py audit/stamps/<repo>/<sha> --rerun /tmp/src --worktree /tmp/wt --tools /tmp/audit-tools |
| 34 | ``` |
| 35 | |
| 36 | Exit codes: `0` every reproducible check output matched byte for byte; `1` a mismatch (named on |
| 37 | stderr); `2` NOT_RUN, because the checker source, the tool lock or a tool version differs from the one |
| 38 | the stamp recorded. `2` is not a pass. C11 (dependency advisories) queries the live OSV database, so it |
| 39 | is recorded with its date and is not compared. |
| 40 | |
| 41 | ## 4. Check the signature |
| 42 | |
| 43 | ```sh |
| 44 | gh attestation verify audit/stamps/<repo>/<sha>/stamp.json --repo aien-dev/aien-receipts \ |
| 45 | --signer-workflow aien-dev/aien-receipts/.github/workflows/audit-attest.yml |
| 46 | ``` |
| 47 | |
| 48 | A valid attestation shows that the `audit-attest` workflow, on a GitHub-hosted runner, validated the |
| 49 | stamp and re-ran its checks before signing. It does not show that a model review was right or complete: |
| 50 | read the review reports in the stamp directory and their `files_covered`. |
| 51 | |
| 52 | ## 5. Is the stamp current? |
| 53 | |
| 54 | `audit/status.json` is refreshed daily. `CURRENT` means the default-branch HEAD still equals the |
| 55 | stamped commit; `STALE` means HEAD has moved and the stamp describes an older tree; `UNKNOWN` means |
| 56 | HEAD could not be read; `NOT_CHECKABLE` marks private repositories; `SUPERSEDED` means a newer stamp |
| 57 | exists. You can check one yourself: `git ls-remote https://github.com/aien-dev/<repo> HEAD`. |
| 58 | |
| 59 | ## Private repositories |
| 60 | |
| 61 | They appear only as `private-01` .. `private-11` with a salted SHA-256 commitment |
| 62 | (`sha256("<salt>:<name>")`). Their stamps carry `self_reported: true`: nobody outside can re-run |
| 63 | them, so step 3 does not apply, and the signature attests only that the stamp was well formed. |