aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / release / CEREMONY-RUNBOOK-DRAKE.md
| 1 | # Key ceremony runbook for Drake (step by step) |
| 2 | |
| 3 | This is the hands-on version of `KEY_CEREMONY.md`. It covers one evening of work, done once. It uses only what |
| 4 | `scripts/key-ceremony.sh` already does; nothing here is a new tool. Related: sc#118 (your checklist), sc#385 (the design), |
| 5 | arch#190 comment 6109731585 (your approval of the offline signing design). |
| 6 | |
| 7 | **The idea in one paragraph.** You make a secret key on a computer that is not connected to anything. The key is like a |
| 8 | rubber stamp that only you own. Every public release gets stamped with it. The matching "public half" (which cannot stamp, |
| 9 | only check a stamp) is published so anyone can check a release is genuine. The secret half never goes near the internet, |
| 10 | GitHub, the Spark or any AI. |
| 11 | |
| 12 | ## Two kinds of files. Learn this first. |
| 13 | |
| 14 | | Kind | Files | May leave the offline computer? | |
| 15 | |---|---|---| |
| 16 | | **SECRET** | `aien_release_ed25519` (the key file, no extension) in `~/aien-key/` and the same file on each backup stick | **Never.** It stays on the offline computer and the two backup sticks. | |
| 17 | | **Public** | `~/aien-key/public/allowed_signers` and `~/aien-key/public/ceremony-record.txt`, and the key's `.pub` file | **Yes.** These are safe to publish and are what gets committed to the repository. | |
| 18 | |
| 19 | The `public` folder is the only thing you carry out. If you ever see a file called `aien_release_ed25519` (without |
| 20 | `.pub`) in the folder you are about to carry out, stop. |
| 21 | |
| 22 | The ceremony record contains your name, the witness's name, the date, the fingerprint (the key's short ID), and the test |
| 23 | results. It does not contain the key. Because it will be committed to a public repository, check you are happy for both |
| 24 | names to be public. If not, tell the engineering side before step 5; the record format is fixed by the script, so this |
| 25 | would need a change. |
| 26 | |
| 27 | ## What you need |
| 28 | |
| 29 | - One spare laptop (the **offline computer**) with `ssh-keygen`. Mac and Linux already have it. Check in step 2. |
| 30 | - Three USB sticks: "AIEN KEY BACKUP 1", "AIEN KEY BACKUP 2", and "PUBLIC CARRY" (a plain one for carrying the public files out). |
| 31 | - A **witness**: someone present who can watch the screen. They also write the fingerprint on paper. |
| 32 | - Pen, paper, an envelope or two. |
| 33 | - A passphrase you will remember: long (a sentence of 5 or more random words is good). Do not store it on any computer. |
| 34 | |
| 35 | ## Part A: Before the evening (on the Spark, or any normal connected computer) |
| 36 | |
| 37 | **Step 1. Get the script onto the PUBLIC CARRY stick.** |
| 38 | - Where: the Spark (connected). Changes: only the stick (adds one file). |
| 39 | - Type (replace the path with where the stick is mounted): |
| 40 | `cp ~/workspace/aien-sovereign-core/scripts/key-ceremony.sh /media/$USER/PUBLICCARRY/` |
| 41 | then `sha256sum /media/$USER/PUBLICCARRY/key-ceremony.sh` |
| 42 | - Write the first 16 characters of the long number on paper. You will compare it in step 3, to know the script on the |
| 43 | offline computer is the one from the repository. |
| 44 | - You should see: one line with a 64-character number and the file name. |
| 45 | |
| 46 | **Step 2 (optional but recommended). Practise on the Spark.** This is safe: it makes a throwaway key labelled REHEARSAL. |
| 47 | - Where: the Spark. Changes: creates folders under `/tmp` only. |
| 48 | - Type: `cd ~/workspace/aien-sovereign-core && bash scripts/key-ceremony.sh ceremony --rehearsal --out /tmp/practice --backup /tmp/practice-b1 --backup /tmp/practice-b2` |
| 49 | - You should see six "Step N of 6" headings with the word REHEARSAL, lines saying `good signature verifies: yes` and |
| 50 | `altered file is refused: yes`, then a record starting "REHEARSAL: throwaway key". Clean up: `rm -rf /tmp/practice*` |
| 51 | - Note: a rehearsal key can never become the release key; the checks refuse it by name. |
| 52 | |
| 53 | ## Part B: The ceremony (on the OFFLINE computer, with the witness) |
| 54 | |
| 55 | **Step 3. Go offline and bring the script.** |
| 56 | - Where: offline computer. Changes: nothing is deleted. |
| 57 | - Do: unplug the network cable, turn Wi-Fi and Bluetooth off. Plug in the PUBLIC CARRY stick, copy `key-ceremony.sh` |
| 58 | to your home folder, and run `sha256sum ~/key-ceremony.sh`. The first 16 characters must match your paper. |
| 59 | Then unplug the PUBLIC CARRY stick. |
| 60 | - Check ssh-keygen exists: `ssh-keygen -V 2>&1 | head -1` or `ssh -V`. You should see a version line (OpenSSH_...). |
| 61 | |
| 62 | **Step 4. Plug in the two backup sticks and start the script.** Nothing is created before you confirm. |
| 63 | - Where: offline computer, in a terminal in the folder with the script. Changes: creates `~/aien-key` and writes to |
| 64 | the two sticks only after you confirm each. |
| 65 | - Type (on a Mac, replace `/media/` with `/Volumes/`; use the real stick names): |
| 66 | `bash key-ceremony.sh ceremony --out ~/aien-key --backup /media/BACKUP1/aien-key --backup /media/BACKUP2/aien-key` |
| 67 | - The script refuses (and says why) if: the computer still has a network route, it sees CI variables, a folder is inside |
| 68 | a git checkout, or `~/aien-key` is not empty. Fix what it names and run it again. Nothing was made yet. |
| 69 | |
| 70 | **Step 5. Confirm and give names.** The script asks "Is this machine offline ... and is the witness watching?" Type `yes`. |
| 71 | Then it asks for your full name and the witness's full name; type them. |
| 72 | |
| 73 | **Step 6. Make the key.** The script shows "Step 2 of 6: make the key" and `ssh-keygen` asks for a passphrase twice. |
| 74 | - The witness looks away from the keyboard. Type the passphrase twice. |
| 75 | - You should see a "Your identification has been saved" style message and the key files appear in `~/aien-key`. |
| 76 | |
| 77 | **Step 7. Fingerprint check by the witness.** The screen shows `Fingerprint: SHA256:...`. |
| 78 | - The witness copies the whole fingerprint onto paper by hand. The script asks the witness to type the LAST 8 |
| 79 | characters from the paper. If they do not match the screen the script stops (nothing to clean up; start again). |
| 80 | - Keep the paper. It is your independent copy of the fingerprint. |
| 81 | |
| 82 | **Step 8. The public-key test (automatic).** Type the passphrase when asked. |
| 83 | - You should see exactly: `good signature verifies: yes` and `altered file is refused: yes`. |
| 84 | - This proves the key can stamp, the public half can check the stamp, and a changed file is rejected. |
| 85 | |
| 86 | **Step 9. Backups, one stick at a time.** For each stick the script says "Backup N goes to ... Is that medium plugged |
| 87 | in?" Type `yes`. It copies the key, compares the copy to the original byte for byte, then makes the copy stamp a |
| 88 | test file (passphrase again) and verifies it. |
| 89 | - You should see for each: `backup N is an exact copy: yes`, then the two test lines again. |
| 90 | - If any line says STOPPED, do not use that stick. Re-run the ceremony from step 4 with a different stick. |
| 91 | |
| 92 | **Step 10. The public record.** The script prints the record and saves it in `~/aien-key/public/`. |
| 93 | - You should see lines starting `date-utc:`, `mode: ceremony`, `operator:`, `witness:`, `fingerprint:`, |
| 94 | `allowed_signers: aien-release ssh-ed25519 ...`, two `backup-N: exact copy yes; signs and verifies yes; ...` lines, and |
| 95 | the last line `private key: stays on the offline machine and the backups; it is not in this record`. |
| 96 | - The line `mode: ceremony` (not `rehearsal`) matters: the checks reject anything else. |
| 97 | - On paper, below the fingerprint, write the date and both names. The witness signs it. (The script does not capture |
| 98 | signatures; the paper is the witness's signature. Photograph it if you like; the photo is optional and is not required |
| 99 | by any test.) |
| 100 | |
| 101 | **Step 11. Custody (who holds what).** |
| 102 | - Put each backup stick in its own sealed envelope, write the date and "AIEN release key backup N", and store them in two |
| 103 | different physical places (for example a home safe and a bank box). They must not be kept together. |
| 104 | - The offline computer keeps the working copy in `~/aien-key`. Keep this computer powered off and offline when not signing. |
| 105 | - The passphrase lives in your head (and, if you choose, on paper in a third place). Never in a file, email or chat. |
| 106 | - The paper with the fingerprint goes with your records. |
| 107 | |
| 108 | **Step 12. Prove a backup works later (any time, offline computer, backup plugged in).** Safe, changes nothing: |
| 109 | - Type: `bash key-ceremony.sh verify-backup /media/BACKUP1/aien-key/aien_release_ed25519 ~/aien-key/public/allowed_signers` |
| 110 | - You should see the two test lines then `backup OK`. Do this for stick 2 too. Do it once now, then about once a year. |
| 111 | |
| 112 | **Step 13. Carry the PUBLIC half out.** |
| 113 | - Plug in the PUBLIC CARRY stick. Type: `cp -r ~/aien-key/public /media/PUBLICCARRY/ceremony-public` |
| 114 | then `ls /media/PUBLICCARRY/ceremony-public` |
| 115 | - You should see exactly two files: `allowed_signers` and `ceremony-record.txt`. Nothing else. Eject the stick. |
| 116 | - Do NOT copy `aien_release_ed25519`. Do NOT copy the backup sticks. |
| 117 | |
| 118 | ## Part C: Handing the public record to the Spark (connected computer) |
| 119 | |
| 120 | **Step 14. Give the two public files to the engineering side.** |
| 121 | - Where: the Spark. Plug in PUBLIC CARRY and copy the folder `ceremony-public` somewhere, for example |
| 122 | `cp -r /media/$USER/PUBLICCARRY/ceremony-public ~/ceremony-public`. |
| 123 | - Compare the fingerprint in the record to your paper: `grep '^fingerprint:' ~/ceremony-public/ceremony-record.txt`. |
| 124 | Read it aloud against the paper with the witness. They must be identical. |
| 125 | - Tell the orchestrator chat: "ceremony done, public folder is at ~/ceremony-public". That is the whole handoff. No |
| 126 | one needs the secret key, the passphrase or the backup sticks. |
| 127 | |
| 128 | Everything the engineering side does next is in the next section. |
| 129 | |
| 130 | ## Post-ceremony integration (what the engineering side does after step 14) |
| 131 | |
| 132 | One pull request, title "release: pin the public release key from the key ceremony (sc#118, sc#385)". It is made with |
| 133 | `scripts/apply-ceremony-public-record.sh ~/ceremony-public`, which refuses a rehearsal record, extra files, private key |
| 134 | material, or an inconsistent record, and ends by running `scripts/check-release-trust-config.sh`. |
| 135 | |
| 136 | | File | Change | |
| 137 | |---|---| |
| 138 | | `docs/release/allowed_signers` | the placeholder text is replaced by a short header plus **one key line** (`aien-release ssh-ed25519 ...`) | |
| 139 | | `install.sh` | **one line**: `AIEN_RELEASE_SIGNER='<the same key line>'` (was empty) | |
| 140 | | `docs/release/ceremony-record.txt` | **new**, the public record copied unchanged | |
| 141 | |
| 142 | Nothing else. You review the diff: the fingerprint in the record is checked against your paper, and CI runs |
| 143 | `scripts/check-release-trust-config.sh` (the key line, the installer value and the record must all agree; a fingerprint |
| 144 | that is not the key's, a rehearsal marker, a second key, the old internal test key, or private key material all fail). |
| 145 | |
| 146 | What proves this will work, before and after: `scripts/test-public-key-integration.sh` (runs in CI with throwaway keys) |
| 147 | performs this exact change from a rehearsal public folder and shows: the diff is only those three files; a release |
| 148 | signed by the matching key installs as `signature_check: release` and the receipt's signer fingerprint equals the |
| 149 | record's; a different key, a tampered archive and a tampered checksum list are refused; and nine kinds of wrong record |
| 150 | are refused. After the real pull request merges, the only things the real key does are sign `SHA256SUMS.txt` at each |
| 151 | release, offline (`KEY_CEREMONY.md`, "Signing a release"). |
| 152 | |
| 153 | **Still required before any public release** (this runbook does not change them): the physical rollback gate and the |
| 154 | signing and model gates. Pinning the key alone does not make a public release; no tag is created by this work. |