Skip to content

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

Open
w3irdrobot wants to merge 9 commits into
masterfrom
codex-sigts-maple
Open

w3irdrobot wants to merge 9 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; the repository, commit and build run must be present and well formed;
  • logs release evidence: pass with the signed repository, commit, build run and Rekor log index, or release evidence: fail with a failure category.

How to read it

Five commits. The first two are the feature; the last three are small changes from review:

  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.
  3. Artifact-signing verification moved into the corpus test. Release approvals are always DSSE, so the verifier module no longer carries a path no session runs.
  4. The build run is required and logged with the repository and commit.
  5. A log entry whose two index fields differ is rejected.

To see the behavior without the test data, read transportV2/client.ts (the hook), then releaseEvidence/observe.ts, verification.ts and fetchBundle.ts. Hiding sdk/test/fixtures in the file filter takes the list from about 125 files to 25.

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, commit and build run are audit data: logged when an approval verifies, never compared with pinned values.
  • A log entry names its index twice, on the entry and in its inclusion proof, and verifiers differ in which they prove inclusion at. The two must be equal or the bundle is rejected as tlog-index-mismatch, so this SDK and the Rust SDK answer the same way. The Rust SDK change (SDK: verify enclave release statements in Rust sessions, report-only #1672) uses the same failure category names.
  • 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

  • The SDK pre-commit checks on the branch head: 443 tests pass, 0 fail, including the corpus. just lane sdk-ts and just lane repo passed on the first two commits; CI runs them on the head.
  • 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

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Maple development preview: https://0f28f2af.maple-ca8.pages.dev

Commit: 9212ec9eaa560d813626bf9bc179350c34453586

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

w3irdrobot and others added 3 commits November 23, 2026 14:43
Release approvals are always DSSE envelopes, so no session ever verifies a
bundle that signs an artifact directly. The verifier module carried that
path, and the digest-verification helper it pulled in, only so the shared
corpus could run its artifact-signing vectors.

Move that path into the corpus test, where it calls the pinned verifier
with the same strict profile. The module now holds only what a session
runs, and the helper import goes away.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A release statement also signs the workflow run that built the release.
Require its shape alongside the repository and commit, and add it to the
line logged when an approval verifies, so the log points at the exact
build. Like the repository and commit it is audit data: it is never
compared with a pinned value.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A transparency log entry names its index on the entry and again in its
inclusion proof, and verifiers differ in which one they prove inclusion
at. A bundle whose two values differ was therefore accepted by one
client and rejected by another. Reject it before verification as
tlog-index-mismatch, so every client answers the same way and the index
that is logged is the one that was proven.

Also report text that is not JSON as json-syntax-error for both the
bundle and the signed statement, the name the Rust SDK uses.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The TypeScript and Rust SDKs must give the same answer for the same
statement, including one that is wrong in several ways at once. Add 48
vectors, edits of the published Development statement with the expected
outcome and failure category, and document the order of the checks beside
them. The Rust SDK runs a byte-identical copy; both pin its SHA-256.

A build attempt is now judged by its value and must be a whole number
that every JSON reader holds exactly, so 1, 1.0 and 1e0 are treated alike
in both SDKs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
w3irdrobot and others added 3 commits November 23, 2026 16:41
The statement decoder dropped a leading byte order mark, so a payload
that starts with one was read as JSON here and refused by the Rust SDK.
Keep the mark so JSON parsing refuses it in both.

Add that case and a repeated member in text that is cut short to the
shared vectors, 50 in all, and spell out in their README that the whole
text is checked as JSON before repeated members are looked for. List the
three forms the Rust SDK refuses and this SDK reads, none of which the
release pipeline writes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A bundle whose payload is not JSON and whose signature does not verify
is rejected by both SDKs, with different categories, because the Rust
verifier reads the payload before it can check the signature. Record it
beside the shared vectors.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The TypeScript and Rust SDKs must accept the same release evidence. For
input both reject, the failure category may differ, because the two
verifier libraries read a bundle in a different order. Rewrite the known
differences beside the shared vectors to say so, and keep apart the three
forms only one SDK accepts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
pages-pr-1668 — 9212ec9e Deployed Nov 23, 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