# Verify the enclave (https://orgasm.dev/docs/guides/verify)

Every live session is analysed on a confidential virtual machine whose image was built in public. You can check three things, each with tools that do not depend on orgasm.dev:

1. **The release.** Its SLSA provenance and its keyless signature tie the image's digest to a tagged commit of the [public source](https://github.com/Masseuse-ai/masseuse-video-tee).
2. **The machine.** Its attestation token, signed by Google's attestation service, names the hardware, the machine image and the digest and release the enclave runs.
3. **The session.** The device checked that token before it sent a frame; you can make the same checks yourself, from outside, against a session's enclave while it is live, and read the token Google signed for the session in its receipt afterwards.

Sample attestation receipt, release v0.19.0:

| Checked | |
| --- | --- |
| Image | `sha256:5871c1c0eb516ec9f565f631e925762d0a4b738bed3a8cf0c6e915eaadfae6a1` |
| Release | [v0.19.0](https://github.com/Masseuse-ai/masseuse-video-tee/releases/tag/v0.19.0) from [`b494418`](https://github.com/Masseuse-ai/masseuse-video-tee/commit/b494418fa760bb47d36190ef6c380d1a6a381eab) |
| Hardware | Intel TDX, NVIDIA H100 with confidential computing on |
| Debugging | Off since boot |
| Provenance | SLSA Build Level 3, by the release workflow (published with the release) |
| Signature | Keyless, in Sigstore’s public log (published with the release) |

## Three layers, three proofs [#three-layers-three-proofs]

| Layer | What proves it | Who checks it |
| --- | --- | --- |
| The hardware: Intel TDX memory encryption, an NVIDIA H100 in confidential-computing mode, Secure Boot | The attestation token's `hwmodel`, `secboot` and `submods.nvidia_gpu` | The device, and `tee-verify` |
| The machine image: Google's Confidential Space, on its STABLE track, debugging disabled since boot | The token's `swname`, `dbgstat` and `submods.confidential_space.support_attributes` | The device, and `tee-verify` |
| The workload: the enclave image and what it loads | The token's `image_digest`, its release stamp (`TEE_IMAGE_VERSION`, `TEE_IMAGE_COMMIT`) and its signature; the digest's SLSA provenance and keyless signature in Sigstore's public log | `slsa-verifier`, `cosign`, and `tee-verify` |

The token is signed by `https://confidentialcomputing.googleapis.com`, and only the launcher inside a real Confidential Space machine can obtain one. Debugging disabled since boot (`dbgstat: disabled-since-boot`) means nobody could log in, redirect the output or read memory at any point since the machine started.

## Check a release [#check-a-release]

Each release's page on GitHub names its image digest and gives the two commands that check it. For the example release, v0.19.0 (October 16, 2026):

```sh title="Terminal"
slsa-verifier verify-image ghcr.io/masseuse-ai/masseuse-video-tee@sha256:5871c1c0eb516ec9f565f631e925762d0a4b738bed3a8cf0c6e915eaadfae6a1 \
  --source-uri github.com/Masseuse-ai/masseuse-video-tee --source-tag v0.19.0

cosign verify ghcr.io/masseuse-ai/masseuse-video-tee@sha256:5871c1c0eb516ec9f565f631e925762d0a4b738bed3a8cf0c6e915eaadfae6a1 \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --certificate-identity https://github.com/Masseuse-ai/masseuse-video-tee/.github/workflows/release.yml@refs/tags/v0.19.0
```

You need [`slsa-verifier`](https://github.com/slsa-framework/slsa-verifier) and [`cosign`](https://github.com/sigstore/cosign) 3 or later (the signature is stored as a Sigstore bundle). When both pass, the image with that digest was built on GitHub's runners by the repository's release workflow, from the commit the tag names. Change one line of code and the digest changes, and neither record exists for it. Then [read the code at that tag](https://github.com/Masseuse-ai/masseuse-video-tee/tree/v0.19.0).

Every release is listed on [the releases page](https://github.com/Masseuse-ai/masseuse-video-tee/releases). Tags there are immutable: once created, nobody can move or delete one.

## Check a live session's enclave [#check-a-live-sessions-enclave]

Your server's `POST /v1/live-sessions` response carries `ingest.attestationUrl`, the enclave's own attestation endpoint. While the session is live, from any machine with Go 1.22 or later and `slsa-verifier`:

```sh title="Terminal"
git clone https://github.com/Masseuse-ai/masseuse-video-tee enclave
cd enclave/verifier && go build -o tee-verify .

ORIGIN=$(node -p 'new URL(process.argv[1]).origin' "$ATTESTATION_URL")
./tee-verify -policy-url 'https://orgasm.dev/v1/attestation-policy?mode=live' -origin "$ORIGIN"
```

`-policy-url` reads the values orgasm.dev holds its enclaves to from the policy's `verify` block: the release signing key, the minimum release, where the enclave posts its readings, which identity may control it, the record bucket and the project. A flag you pass yourself wins over the policy, and the report names the policy it read.

`tee-verify` asks the enclave for a token minted for a random nonce of its own, over a TLS connection it opens itself, and checks:

- the token's signature against Google's published keys, its issuer, and that it was minted for this enclave, just now;
- the hardware, the machine image and the posture in the table above;
- that the image carries the release signing key's signature, and which release and commit it is stamped with;
- that the running digest has SLSA provenance from the public repository at that release and commit, with `slsa-verifier`;
- that the TLS connection it negotiated, and the key that signs every WebRTC answer, both belong to this enclave;
- where the enclave sends its readings, which identity may control it, and that requests are sealed.

An exit code of 0 and `"passed": true` mean every check held. Add `-expect-release v0.19.0` to insist on a release, or `-v` to print every attested value. With [your own GPUs](/docs/guides/own-gpus), your console prints the command with your project's values.

An enclave runs only while a session needs it and stops a minute or two after it ends, so run the check while your session is live. A refused connection afterwards means the machine is gone, not that a check failed.

## Read a session's receipt [#read-a-sessions-receipt]

Once a live session's enclave is attested, `GET /v1/live-sessions/{id}` carries `enclave`: the image digest, the release and commit it was built from, the hardware and its posture, and `attestationToken`, the token Google's attestation service signed for that enclave with the session's id among its nonces. orgasm.dev checked it against the [attestation policy](/docs/api/trust/getAttestationPolicy) over a TLS connection the token names, and the receipt stays with the session's events. Your console's live mode lists each session with its receipt.

You can check the token yourself, after the machine is gone:

```ts title="receipt.ts"
import { createRemoteJWKSet, decodeJwt, jwtVerify } from 'jose';

const keys = createRemoteJWKSet(
  new URL('https://www.googleapis.com/service_accounts/v1/metadata/jwk/signer@confidentialspace-sign.iam.gserviceaccount.com'),
);
const token = session.enclave.attestationToken;
// The token lives an hour; check it as of the moment it was signed.
const signedAt = new Date((decodeJwt(token).iat ?? 0) * 1000 + 1000);
const { payload } = await jwtVerify(token, keys, { issuer: 'https://confidentialcomputing.googleapis.com', currentDate: signedAt });
const claims = payload as unknown as { eat_nonce: string[]; submods: { container: { image_digest: string } } };

console.log(claims.eat_nonce.at(-1) === session.id); // minted for this session
console.log(claims.submods.container.image_digest === session.enclave.imageDigest);
```

Then check that digest's release with the two commands above. Google rotates its signing keys, so a token can only be checked while its key is still published: keep the keys with the receipt if you need to prove it later.

## What this does not prove [#what-this-does-not-prove]

- **That your app runs the SDK as published.** The device's checks happen in your app; a modified SDK could skip them. [Read its source](https://github.com/Orgasm-dev/device-sdk), pin the version you ship, and run `npm audit signatures`: each release on npm carries provenance tying it to a tag of that repository.
- **What the detectors compute.** Their code is not published. What is proved is which bytes ran, that they never received a frame or a sound, and that they had no network of their own ([Trust](/docs/concepts/trust#what-is-not-public)).
- **The policy orgasm.dev serves.** The device checks the enclave against `GET /v1/attestation-policy`, which orgasm.dev serves. `tee-verify` and the release checks above do not rely on it.
- **Anything outside the token.** That the image writes nothing of a session to disk, for one, is in its code, which you can read, not in the token. The repository's [`VERIFY.md`](https://github.com/Masseuse-ai/masseuse-video-tee/blob/master/VERIFY.md) lists the rest.
