Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

ci(release): gate signing keys and PyPI behind tag-only approved environments (#432)

Ruben Lütke73a3cd0f9da7
diff --git a/.github/workflows/sign-installer.yml b/.github/workflows/sign-installer.yml
index 91b615a84c..09cce7f13a 100644
--- a/.github/workflows/sign-installer.yml
+++ b/.github/workflows/sign-installer.yml
@@ -55,7 +55,9 @@ on:
# Wave 1 (keyless) needs no secrets — it uses OIDC. Wave 2 (Ed25519) and
# Wave 4 (ML-DSA-65) read their PRIVATE KEYS from the WAVE2_OFFLINE_KEY_B64
# and WAVE4_MLDSA65_KEY_B64 secrets (base64 of the PEM); the keys never live
-# in the repo, not even encrypted.
+# in the repo, not even encrypted. Those secrets belong to the
+# `release-signing` environment, which only `v*` tags may deploy to and which
+# waits for the maintainer's approval, so no branch workflow can read them.
# id-token=write is required by both Sigstore Fulcio (Wave 1) and by the
# slsa-github-generator reusable workflow (Wave 3 — it mints its OWN OIDC
# token inside the isolated `provenance` job, but the caller workflow must
@@ -179,6 +181,9 @@ jobs:
sign:
needs: cross-runner-hash
+ # The only job that reads the offline signing keys. The environment admits
+ # `v*` tags only and pauses the release for the maintainer's approval.
+ environment: release-signing
permissions:
contents: read
id-token: write
diff --git a/AGENTS.md b/AGENTS.md
index ad39cb5f0e..96433c6126 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -205,6 +205,8 @@ tag + CHANGELOG + published GitHub Release) happens ONLY when explicitly
asked — an ordinary push is not a release. A release is ONE command:
`gh workflow run release-cut.yml -f bump=patch|minor|major` (pick the bump from
the commits since the last tag), then watch the run and report the Release URL.
+The PyPI and signing jobs then wait for the maintainer's approval in the
+Actions tab (environments `pypi`, `release-signing`); tell them, never bypass.
That workflow bumps, writes the CHANGELOG, tags, waits for CI and publishes;
never bump, tag or `gh release create` by hand.
diff --git a/docs/ci-pipeline.md b/docs/ci-pipeline.md
index 7f8e94b960..63db2aa100 100644
--- a/docs/ci-pipeline.md
+++ b/docs/ci-pipeline.md
@@ -268,6 +268,28 @@ Steps:
signed manifests and the attestations all point at them. Add a short note
to the release body instead.
+**Release approval.** Two GitHub environments guard the irreversible steps:
+`pypi` (the PyPI upload in `release.yml`) and `release-signing` (the `sign`
+job of `sign-installer.yml`, the only job that reads the offline Ed25519 and
+ML-DSA-65 private keys, `WAVE2_OFFLINE_KEY_B64` and `WAVE4_MLDSA65_KEY_B64`).
+Both admit deployments from `v*` tags only, never from a branch, and both
+require the maintainer's approval; administrators cannot bypass it. A
+release therefore pauses twice after tag admission: open the two waiting runs
+("Release to PyPI" and "Sign installer (Sigstore keyless)") in the Actions
+tab, choose **Review deployments**, tick the environment and approve. The
+desktop installers do not wait. Approve within the release-cut publisher's
+150-minute window; a later approval still finishes the release, because
+`release-finalize.yml` runs when the last publisher completes. Rejecting a
+deployment leaves the release a draft.
+
+**Release tags.** The `release tags` repository ruleset protects
+`refs/tags/v*` against update and deletion; only the repository admin role
+may bypass it. Creation stays open because `release-cut.yml` pushes the tag
+with `GITHUB_TOKEN`, and GitHub does not accept the GitHub Actions
+integration as a bypass actor on this repository's rulesets. A stray `v*` tag
+still publishes nothing on its own: release admission and both environment
+approvals stand between it and a published release.
+
PyPI publishing retains a separate OIDC-only job and can run only after tag
admission. Manual branch runs build packages without publishing or signing.
Native macOS signing imports the publisher certificate into a temporary
diff --git a/docs/supply-chain/threat-model.md b/docs/supply-chain/threat-model.md
index c873430f97..f49cb5fa51 100644
--- a/docs/supply-chain/threat-model.md
+++ b/docs/supply-chain/threat-model.md
@@ -385,7 +385,7 @@ This preserves the Wave 2 architecture unchanged:
follow-up.
Rotating the key is: generate a fresh keypair, `gh secret set
-WAVE2_OFFLINE_KEY_B64`, swap the public key + its inlined verifier block
+WAVE2_OFFLINE_KEY_B64 --env release-signing`, swap the public key + its inlined verifier block
+ the pinned fingerprint, and append a row to the rotation-history table
in `install/TRUST_ROOT.md`.
diff --git a/docs/supply-chain/wave2-key-ceremony.md b/docs/supply-chain/wave2-key-ceremony.md
index dce19ff8f4..8853e04193 100644
--- a/docs/supply-chain/wave2-key-ceremony.md
+++ b/docs/supply-chain/wave2-key-ceremony.md
@@ -112,14 +112,14 @@ ceremony was performed.
# base64 the PKCS#8 PEM and store it as an encrypted GitHub secret.
# The key never touches the repository.
base64 -w0 /tmp/wave2_offline.key | \
- gh secret set WAVE2_OFFLINE_KEY_B64 --repo PersonalJarvis/PersonalJarvis
+ gh secret set WAVE2_OFFLINE_KEY_B64 --env release-signing --repo PersonalJarvis/PersonalJarvis
```
Custody model:
| Property | Value | Why |
|---|---|---|
-| At-rest location | GitHub Actions secret `WAVE2_OFFLINE_KEY_B64` | GitHub encrypts secrets at rest and injects them only into workflow runs; the private key never appears in the repo tree, not even encrypted. |
+| At-rest location | GitHub Actions secret `WAVE2_OFFLINE_KEY_B64` of the `release-signing` environment | GitHub encrypts secrets at rest and injects them only into the tag-only, maintainer-approved signing job; the private key never appears in the repo tree, not even encrypted. |
| Encoding | base64 of the PKCS#8 PEM | Lets a multi-line PEM travel as a single secret value; the workflow base64-decodes it into a runner tempfile at sign time. |
| Passphrase | none | There is no encrypted key file to unlock, so there is no passphrase to store, disclose, or rotate. |
| Backup | maintainer's password manager | A single offline copy so the key can be re-set if the GitHub secret is ever lost. |
@@ -128,7 +128,7 @@ Custody model:
```bash
# Decode the secret value back to a PEM and confirm it is a valid key.
-gh secret list --repo PersonalJarvis/PersonalJarvis # WAVE2_OFFLINE_KEY_B64 present
+gh secret list --env release-signing --repo PersonalJarvis/PersonalJarvis # WAVE2_OFFLINE_KEY_B64 present
base64 -d /tmp/wave2_offline_b64.txt > /tmp/wave2_decoded.key
openssl pkey -in /tmp/wave2_decoded.key -noout
# (no output = valid PEM Ed25519 private key)
@@ -243,9 +243,9 @@ Ideally:
```bash
base64 -w0 offline-ceremony.key | \
- gh secret set WAVE2_OFFLINE_KEY_B64 --repo PersonalJarvis/PersonalJarvis
+ gh secret set WAVE2_OFFLINE_KEY_B64 --env release-signing --repo PersonalJarvis/PersonalJarvis
# Verify:
-gh secret list --repo PersonalJarvis/PersonalJarvis
+gh secret list --env release-signing --repo PersonalJarvis/PersonalJarvis
# WAVE2_OFFLINE_KEY_B64 Updated 2026-MM-DD HH:MM:SS
```
@@ -442,7 +442,7 @@ git ls-tree HEAD install/keys/ | grep -F 'PRIVATE KEY' && echo "FAIL: private ke
git ls-tree HEAD install/tuf/1.root.json
# 4. Private-key secret is set (proves custody)
-gh secret list --repo PersonalJarvis/PersonalJarvis | grep -F 'WAVE2_OFFLINE_KEY_B64'
+gh secret list --env release-signing --repo PersonalJarvis/PersonalJarvis | grep -F 'WAVE2_OFFLINE_KEY_B64'
# 5. TUF root metadata loads + threshold=2
python -c "from tuf.api.metadata import Metadata; m = Metadata.from_file('install/tuf/1.root.json'); assert m.signed.roles['root'].threshold == 2; print('PASS')"