Skip to content

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

Open
abrichr wants to merge 5 commits into
mainfrom
gemini/verify-seal-github-action
Open

abrichr wants to merge 5 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.

This branch has not been deployed

No deployments
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