Skip to content

feat(attest): add extraData parameter for runtime attestation#129

Open
mpjunior92 wants to merge 3 commits intomasterfrom
feat/runtime-attestation-extra-data
Open

feat(attest): add extraData parameter for runtime attestation#129
mpjunior92 wants to merge 3 commits intomasterfrom
feat/runtime-attestation-extra-data

Conversation

@mpjunior92
Copy link
Copy Markdown

@mpjunior92 mpjunior92 commented Apr 20, 2026

Summary

Adds optional extraData parameter to AttestClient.attest() and JwtProvider.getToken() for binding arbitrary application data (e.g., hash of a blog post, agent configuration) into TEE attestation evidence.

When extraData is provided, the SDK sends it as extra_data (base64) to the TEE server's /v1/bound_evidence endpoint and to the KMS /auth/attest endpoint. go-tpm-tools cryptographically binds extra_data into the attestation nonce via SHA-256/SHA-512 hashing, so arbitrary data up to 1MB is supported. When omitted, behavior is unchanged — fully backwards compatible.

JwtProvider.getToken(extraData) bypasses the long-lived token cache (each runtime attestation is per-action) but deduplicates concurrent requests for the same extraData via an in-flight promise map, preventing thundering herd on TEE hardware calls.

Companion PR: Layr-Labs/eigenx-kms#17 — KMS server-side changes to accept extra_data, verify it in the nonce, and embed it in the issued JWT.

Changes

  • attest-client.tsattest(extraData?: Buffer) with 1MB size limit
  • jwt-provider.tsgetToken(extraData?: Buffer) with per-key dedup map
  • New attest-client.test.ts — 4 tests (TEE forwarding, KMS forwarding, omission, size limit)
  • Updated jwt-provider.test.ts — 3 new tests (cache bypass, dedup, different keys)

Test plan

  • npx vitest run packages/sdk/src/client/modules/attest/ — 13 tests passing
  • E2E on AMD SEV-SNP (GCP Confidential Space, n2d) — JWT contains extra_data claim
  • E2E on Intel TDX (GCP Confidential Space, c3) — JWT contains extra_data claim
  • E2E on GCP Shielded VM / vTPM (e2) — JWT contains extra_data claim

🤖 Generated with Claude Code

Passes extraData as extra_data to TEE server /v1/bound_evidence and
as extra_data to KMS /auth/attest. Enforces 64-byte hardware limit
(Intel TDX REPORTDATA / AMD SEV-SNP ReportData). Omitting extraData
preserves existing behavior.
…plication

When extraData is provided, JwtProvider bypasses the long-lived cache
and requests a fresh attestation JWT. Concurrent requests for the same
extraData are deduplicated via pendingExtraData map to avoid thundering
herd on TEE hardware calls.
go-tpm-tools hashes extraData with SHA-256/SHA-512 before binding it
into the hardware nonce (nonce.go:33,53), so the 64-byte hardware
field limit does not apply to the caller's input. Arbitrary data up
to 1MB is supported.
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