Skip to content

SDK: verify enclave release statements in TypeScript sessions, report-only - #1668

Draft
w3irdrobot wants to merge 2 commits into
masterfrom
codex-sigts-maple
Draft

w3irdrobot wants to merge 2 commits into
masterfrom
codex-sigts-maple

Conversation

@w3irdrobot

@w3irdrobot w3irdrobot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

The TypeScript SDK now checks an enclave's signed release statement during Transport V2 session setup and logs the result. It is report-only: it never changes, delays or fails a session, and there is no UI.

After the existing Nitro and PCR checks accept a remote enclave, the SDK starts a background check that:

  • finds the release bundle for the authenticated PCRs: a verified in-memory cache, then the bundles shipped with the SDK, then a bounded fetch from the environment's fixed host (attestations-dev.maple.ai or attestations.maple.ai);
  • verifies it with that environment's approval key and Sigstore's trusted root, using the pinned sigstore-browser fork's strict managed-key profile: DSSE signature, one Rekor v2 entry with its inclusion proof and checkpoint, one RFC 3161 timestamp;
  • checks the statement: predicate type, signed environment, and PCR0, PCR1 and PCR2 equal to the ones the Nitro document just authenticated;
  • logs release evidence: pass or a failure category, with public release identity only.

How to read it

Two commits, in order:

  1. Verifier and policy, not wired into anything. sdk/src/lib/releaseEvidence/verification.ts, the repeated-JSON-member check, the embedded trusted root and the tests. 100 of its 114 files are a copied test corpus under sdk/test/fixtures/managed-key/.
  2. Lookup and the session hook. Fetch, cache, embedded bundle, approval keys, the hook in sdk/src/lib/transportV2/client.ts, the packed-package check, the Research desktop CSP and CI lane routing. About 1,100 lines, and all of the session risk.

Things worth knowing

  • Only the Dev approval key ships. A Production session logs approval-key-not-configured, makes no request and never falls back to the Dev key.
  • Loopback development servers are not checked. Their documents are not authenticated, so they get neither the PCR gate nor this check, and local stacks do not call a hosted service.
  • The key and the host come from the SDK's own environment setting. Nothing in a bundle or a response can add a key or change the environment.
  • The subject digest is a signed claim only. The client never has the EIF, so it is not logged or exposed as a verified digest. Repository and commit are audit data, not policy inputs.
  • Repeated JSON member names are rejected before anything is trusted, in the bundle and in the signed statement.
  • The one published Dev bundle is embedded exactly as served, with its SHA-256 beside it, so that enclave verifies offline.
  • No trust-root refresh at runtime yet, and no Wasm.
  • CSP: only the Research desktop app sets one, and it now allows the two bundle hosts. The hosted web app sets no CSP, so it needs no change.
  • Dependencies: @freedomofpress/sigstore-browser from the MaplePrivacyLabs/sigstore-browser fork, pinned by commit to a branch with committed build output and no install scripts.

Checked

  • just lane sdk-ts: 471 pass, 0 fail, 0 skipped on the branch head; 446 pass on the first commit alone. just lane repo passes.
  • The 56-vector corpus gives the expected outcome and reason for every vector.
  • The published Dev bundle passes, and fails for the wrong environment, each changed PCR, another key, and Production.
  • A failing, hanging or throwing check leaves session setup untouched (tests inject each case).
  • The embedded Dev key and trusted root are compared with the reviewed copies under scripts/ci/opensecret-release/ in the SDK lane, and a change to either selects that lane.

Not checked

  • A live hosted Dev connection, real devices and webviews, and the Research app at runtime.
  • The verifier running from inside the packed npm package. The packed check confirms the bundle bytes ship in the ESM and UMD builds and that no Wasm does.

🤖 Generated with Claude Code

w3irdrobot and others added 2 commits November 20, 2026 19:56
Add the verifier side of release-approval checking, not yet used by any
session. A release bundle is accepted only when it fits under a byte cap,
names no JSON member twice, passes the pinned Sigstore browser verifier's
strict managed-key profile with a given approval key and trusted root (DSSE
signature, one Rekor v2 entry with its inclusion proof and checkpoint, one
RFC 3161 timestamp), and carries an in-toto release statement for the
expected environment and all three PCRs. Repository and commit are returned
as audit data only. The reported log index is the one the inclusion proof
covers.

The repeated-member check lets JSON.parse validate the text, then walks
string and bracket tokens with one stack instead of parsing JSON by hand.

Sigstore's production trusted root is embedded and loaded apart from the
policy code. Tests run the shared managed-key corpus byte for byte and the
published Dev release bundle, kept as served with its SHA-256 beside it and
out of the formatter. The SDK lane stages the reviewed Dev signing key and
trusted root next to the SDK so the tests compare against them, and changes
to either now select that lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After the existing Nitro and PCR checks accept a remote enclave, start a
release-approval observation without waiting for it. It finds the bundle for
the authenticated PCRs in a verified in-memory cache, in the bundles shipped
with the SDK, or by a bounded fetch from the environment's fixed host,
verifies it with that environment's approval key, and logs a pass or a
failure category with public release identity only. It never changes,
delays or fails a session, and its errors are dropped. Loopback development
servers, whose documents are not authenticated, are not observed.

Only the Dev approval key ships; Production reports
approval-key-not-configured and never falls back to it. The published Dev
release bundle is embedded as served and verified as text. Failures, 404s
and timeouts are never cached.

The packed-package check confirms that the ESM and UMD builds carry each
published bundle with its pinned SHA-256 and that no WebAssembly ships. The
Research desktop app may connect to the two bundle hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Maple development preview: https://53c85879.maple-ca8.pages.dev

Commit: 1b327110f44759e33a3777ae9348f1bd5136bcf4

Uses development API, billing, flags and PCR configuration. Cloudflare Access applies.

This branch was successfully deployed

1 active deployment
pages-pr-1668 — 1b327110 Deployed Nov 20, 2026 by github-actions[bot]
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