Skip to content

feat(seal): pin Cloud Seal keys (person-confirmed TOFU), verify Seals, seal Cloud-connected runs - #70

Merged
abrichr merged 2 commits into
mainfrom
feat/seal-keys-and-cloud-receipt
Oct 15, 2026
Merged

abrichr merged 2 commits into
mainfrom
feat/seal-keys-and-cloud-receipt

Conversation

@abrichr

@abrichr abrichr commented Oct 15, 2026

Copy link
Copy Markdown
Member

Makes sealed:true reachable and checkable.

  • openadapt-agent seal keys pin: fetches /api/public/seal-keys; a key is trusted only after a person types its key id back at a terminal (or --confirm KEY_ID after an out-of-band fingerprint check). Rotation: new keys need the same confirmation; Cloud revocations are applied; un-revocation is refused; keys Cloud stops listing stay pinned. Verification never fetches keys. Default file ~/.openadapt/seal-keys.json (OPENADAPT_SEAL_KEYS_PATH still wins).
  • openadapt-agent seal verify <file|url|->: offline verdict (receipt, run report, or webhook body) with closed reasons; exit 0 only for a genuine Seal over a verified outcome.
  • FlowRunner.run(cloud_execution_id=...) passes --cloud-execution-id (needs openadapt-flow with attach support, OpenAdaptAI/openadapt-flow feat/cloud-seal-attach). A receipt bound to the report's cloud_execution_id seals the run; any other execution does not.
  • Tests: TOFU/rotation/verify unit tests, a fixture signed by Cloud's TypeScript signSeal, and tests/test_seal_e2e.py (VERIFIED run -> local fake Cloud signs with a throwaway key -> Flow's real attach code writes the receipt -> sealed:true; tampered receipt or no pinned keys -> sealed:false). The e2e test skips until the installed Flow ships cloud_seal.

…als, seal Cloud-connected runs

- openadapt-agent seal keys pin: fetches /api/public/seal-keys and pins a
  key only after a person types its id back (or --confirm KEY_ID after an
  out-of-band check). Rotation adds new keys only with confirmation, applies
  revocations, refuses un-revocation, keeps keys Cloud stops listing.
  Verification never fetches keys.
- openadapt-agent seal verify <file|url|->: offline verdict with closed
  reasons for a receipt, run report, or webhook body.
- Pinned keys default to ~/.openadapt/seal-keys.json
  (OPENADAPT_SEAL_KEYS_PATH still wins).
- FlowRunner.run(cloud_execution_id=...) passes --cloud-execution-id so Flow
  attaches Cloud's signed receipt after a VERIFIED outcome; a receipt bound
  to the report's cloud_execution_id seals the run.
- End-to-end test: VERIFIED run, fake Cloud signs with a throwaway key, Flow
  writes the receipt, agent reports sealed:true; tampered receipt or no
  pinned keys reads sealed:false.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
@abrichr
abrichr merged commit cc59af9 into main Oct 15, 2026
8 checks passed
@abrichr
abrichr deleted the feat/seal-keys-and-cloud-receipt branch October 15, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant