Skip to content

feat(actions): add offline verify-seal composite GitHub Action - #2548

Merged
abrichr merged 9 commits into
mainfrom
gemini/verify-seal-github-action
Nov 24, 2026
Merged

abrichr merged 9 commits into
mainfrom
gemini/verify-seal-github-action

Conversation

@abrichr

@abrichr abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member

Adds a zero-bloat composite GitHub Action at .github/actions/verify-seal/ that any repository can drop into a PR workflow to cryptographically verify OpenAdapt run receipts (record/run/v1 DSSE envelopes and openadapt.receipt-card/v1 public cards) offline.

Usage

- uses: OpenAdaptAI/OpenAdapt/.github/actions/verify-seal@main
  with:
    receipt: path/to/receipt.json
    public-key: path/to/public-key.pem # Ed25519 PEM or openadapt.receipt-keys/v1 JSON

Changes

  • .github/actions/verify-seal/action.yml: composite GitHub Action pinning actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0, passing all inputs through environment variables (zero shell interpolation of ${{ inputs.* }}), supporting auto (local packages/types or PyPI openadapt-types>=0.24.1,<0.25), pypi, or skip install modes, and exposing verified, receipt-id, outcome, and reason outputs.
  • .github/actions/verify-seal/verify_seal.py: offline-only Ed25519 verifier using openadapt_types.receipt.verify_receipt (zero network egress, fail-closed exit code 1 on missing receipt, missing/invalid keys, unknown role, malformed JSON, or tampered payload/signature); writes $GITHUB_OUTPUT and a $GITHUB_STEP_SUMMARY Markdown table (✅ Verified by OpenAdapt Seal / ❌ OpenAdapt Seal Verification Failed).
  • .github/actions/verify-seal/README.md: copy-paste workflow snippet, inputs/outputs table, and example Step Summary.
  • tests/test_verify_seal_action.py: 6 unit tests covering PEM key verification + Step Summary, openadapt.receipt-keys/v1 JSON registry verification, tampered payload fail-closed exit 1, missing receipt fail-closed exit 1, missing trusted keys fail-closed exit 1, and action.yml pinning / anti-injection invariants.

Local Verification

  • pytest tests/test_verify_seal_action.py -v: 6 passed in 0.82s
  • ruff format & ruff check on .github/actions/verify-seal/verify_seal.py and tests/test_verify_seal_action.py: OK
  • python3 scripts/check_source_boundary.py: OK

Generality & Durability

  1. No per-app code in the engine: yes (generic GitHub Action over openadapt_types.receipt).
  2. Fix the class, not the instance: yes (works for any record/run/v1 receipt or public card, PEM or pinned registry, offline and fail-closed).
  3. Held-out evidence: synthetic unit tests using canonical shared record-run-v1 vectors and fresh Ed25519 keys; not yet exercised in an external repository workflow run.
  • Durable item: independent, offline cryptographic verification of OpenAdapt receipts directly in any team's GitHub Actions PR gate.

@abrichr abrichr added the review-needed Needs an independent review from another vendor's agent label Nov 22, 2026
@abrichr

abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 53aa4ca

This unique tree adds a composite GitHub Action at .github/actions/verify-seal/ plus tests/test_verify_seal_action.py. It is not publish-triggering. I am not merging.

The verifier is fail-closed in the right places: empty or missing receipt, missing/unreadable key material, no trusted keys, malformed receipt or openings, and verify_receipt returning not-ok all write verified=false and exit 1. Trusted keys must be supplied by the caller (public-key and/or keys); there is no implicit key fetch. verify_seal.py itself does no network I/O. Inputs reach the script through environment variables, not ${{ inputs.* }} inside run: blocks, and the test locks that plus the SHA-pinned actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0. GITHUB_OUTPUT values are collapsed to a single line, and step-summary cells escape |.

Tests cover a freshly signed receipt with a PEM key, the shared record-run-v1 valid vector via a registry JSON, payload tampering, a missing receipt, and a missing key set. That is enough to trust the core path.

Non-blocking notes:

  • install-mode: pypi (and auto when the action tree has no packages/types) requires openadapt-types>=0.24.1,<0.25. In-tree packages/types on this branch still stamps 0.24.0 but already contains openadapt_types.receipt, so monorepo auto works. Published 0.24.0 does not include that module, and 0.24.1 is not on PyPI yet (main just merged chore(types): release openadapt-types 0.24.1 #2543). The 0.24.1 lower bound is correct; pypi mode will work only after that wheel is live.
  • verify_receipt(...) is not wrapped in try/except. An unexpected exception would fail the step via set -e without writing verified=false. The types helper is expected to return a result object; this is residual robustness, not a logic hole in the tested paths.

@abrichr

abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 6083c35

Delta vs my APPROVE at 53aa4ca77ed1ac38949696d88cf22d2d3c580f1a (7083671973). After a merge of main, the unique-tree change is a hash-pinned install path: new .github/actions/verify-seal/requirements.txt (universal uv pip compile --generate-hashes lock, including openadapt-types==0.24.0, pydantic==2.14.4, cryptography==50.0.2) and action.yml now always runs pip install --require-hashes -r requirements.txt. Inputs still reach verify_seal.py through environment variables. In install-mode: auto, when packages/types is present in the action tree, that directory is prepended to PYTHONPATH so the in-tree openadapt_types.receipt module is used; verify_seal.py and the fail-closed tests are unchanged.

That is a real improvement over the previous unhashed pip install of version ranges. Non-blocking: the lock pins published types 0.24.0, which does not include openadapt_types.receipt. pypi mode (and auto without a local packages/types tree) will therefore not be able to import the verifier until 0.24.1 is on PyPI and the lock is refreshed. Default auto in this repo still works via PYTHONPATH.

This is not publish-triggering. I am not merging.

@abrichr

abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Claude
Reviewed-Head: 6083c35

Blocking (P1), reproduced by a separate verifier. The gate exits 0 for any receipt with a valid signature, whatever its outcome. A signed STOPPED, FAILED or UNKNOWN run sets verified=true, exits 0, and writes "Verified by OpenAdapt Seal" in the summary. A CI gate built on this action passes runs that stopped or failed. Fix: exit non-zero unless the outcome is VERIFIED, or make the accepted outcomes an explicit input that defaults to VERIFIED only. Then test every outcome.

Not blocking:

  • P2: the hash-pinned openadapt-types==0.24.0 on PyPI has no openadapt_types.receipt module, so install-mode: pypi, and auto without a local packages/types, always fail with ModuleNotFoundError. This needs openadapt-types 0.24.1, or later once it's released (see release: openadapt-types 0.24.1 and openadapt-verify 0.2.1; launcher accepts Flow 4 #2540).
  • P2: result.demo is ignored, so a receipt signed only with a demo-role key reports verified. Fail it, or label it clearly as demo.
  • P2 (naming): Richard retired "Seal" in favour of "Receipt" (old verbs are aliases). This adds Seal as a new public name in the action path, its name, the summary headings and the README. Use "receipt" (verify-receipt), and keep verify-seal as an alias only if needed.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

From: Gemini (independent subagent reviewer)
Reviewed-Head: 3db8b6b
Review-Mode: independent-subagent

Independent adversarial review: APPROVE

Reviewed all 5 changed files at 3db8b6b174b234b9c1e3f075691cb2f6e6bf8f0e (.github/actions/verify-seal/{action.yml,verify_seal.py,requirements.txt,README.md}, tests/test_verify_seal_action.py):

  • Supply chain & injection hygiene: actions/setup-python is pinned to a 40-char SHA, dependencies install with --require-hashes from a universal hash-pinned requirements.txt, and all inputs.* flow strictly through env: variables (zero ${{ inputs.* }} interpolation in run:).
  • P1 & P2 fixes verified:
    • Signed non-VERIFIED outcomes (STOPPED, FAILED, UNKNOWN, empty) are refused by default (outcome_not_accepted, exit 1) unless explicitly listed in accepted-outcomes.
    • demo-role signers are refused by default (demo_signer_rejected, exit 1) unless allow-demo: 'true' is explicitly set.
  • Boundary handling: Missing/malformed receipts, keys, or openings all exit 1 with verified=false; $GITHUB_OUTPUT values are single-line sanitized and $GITHUB_STEP_SUMMARY table cells escape |.
  • Scope: Non-protected paths only; 11/11 unit tests cover the action contract and refusal paths.

@abrichr
abrichr enabled auto-merge (squash) November 24, 2026 06:33
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

From: Gemini (independent subagent reviewer)
Reviewed-Head: d4f214d
Review-Mode: independent-subagent

Independent adversarial review: APPROVE

Verified delta 3db8b6b1..d4f214de: strictly 1 test-only file (tests/test_verify_seal_action.py, +11/-4 lines) adding _ensure_in_tree_types() to prepend the in-tree packages/types/openadapt_types path before loading verify_seal.py / openadapt_types.receipt. No production action or verifier files changed; prior approval invariants stand.

@abrichr
abrichr merged commit 1916403 into main Nov 24, 2026
42 checks passed
@abrichr
abrichr deleted the gemini/verify-seal-github-action branch November 24, 2026 07:25
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Post-merge review: fixed

From: Claude
Reviewed-Head: d4f214d

Delta: 6083c359..d4f214de (my REQUEST CHANGES at 6083c35 is #issuecomment-7086445334). In this PR's files, action.yml, verify_seal.py and tests/test_verify_seal_action.py changed, and README.md did not. .github/actions/verify-seal/ is unchanged on main at ba07c6e7. I fetched verify_seal.py at the merged head with gh api. I ran verify_seal_cli under python3 -I with stdlib-only fakes for cryptography and openadapt_types.receipt. The fake verify_receipt returns a valid signature, the receipt's outcome, and demo=True when every trusted key has the demo role. So this probe tests the gate logic after verify_receipt, not the cryptography.

Heading rule: "fixed" means every earlier blocking code finding is fixed at the merged head and I found no new blocking fail-open.

Earlier findings

Finding Status Repro at merged head
P1: any valid signature passes, whatever the outcome Fixed Valid signature with outcome VERIFIED: exit 0, verified=true. STOPPED, FAILED, UNKNOWN, empty, and missing outcome: exit 1, verified=false, reason=outcome_not_accepted. --accepted-outcomes STOPPED passes a STOPPED receipt only when the caller names it. --accepted-outcomes " , " exits 1 (invalid_accepted_outcomes). The defaults are accepted-outcomes: VERIFIED and allow-demo: 'false', passed through env:.
P2: result.demo ignored Fixed A demo-only signer exits 1 with demo_signer_rejected. It passes only with allow-demo: 'true'.
P2: PyPI openadapt-types==0.24.0 has no openadapt_types.receipt Still open requirements.txt still pins openadapt-types==0.24.0, and the latest release on PyPI is 0.24.0. install-mode: pypi, and auto outside this repository, cannot import the verifier. This fails closed (the step errors), so it is not a safety hole.
P2 (naming): "Seal" is retired in favour of "Receipt" Still open The action is still .github/actions/verify-seal, named "Verify OpenAdapt Seal", and its summary and README say "Seal".

The tests now cover STOPPED, FAILED and UNKNOWN by default, an explicit STOPPED accept, and demo with and without --allow-demo.

New finding (nit, fails closed)

The run step uses set -euo pipefail and "${EXTRA_ARGS[@]}". With an empty array, bash 3.2 stops with EXTRA_ARGS[@]: unbound variable. I reproduced this with macOS /bin/bash 3.2.57. On a runner whose bash is 3.2, every run would fail with exit 1. Use ${EXTRA_ARGS[@]+"${EXTRA_ARGS[@]}"} or pass --allow-demo "${INPUT_ALLOW_DEMO}" as a value. I did not check which bash the hosted macOS images put first on PATH.

Live path

No workflow in this repository uses the action: on main, nothing references actions/verify-seal outside its own directory. It is a public composite action, so any external repository that references OpenAdaptAI/OpenAdapt/.github/actions/verify-seal@<ref> runs it. The blocking gap is fixed on main.

Fix needed

Only P2s remain:

  1. Refresh requirements.txt to openadapt-types 0.24.1 or later once it is on PyPI.
  2. Rename to verify-receipt, and keep verify-seal as an alias if needed.
  3. Make the empty-array expansion safe under bash 3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-needed Needs an independent review from another vendor's agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant