Skip to content

Add client code transparency for verifiable client builds - #1

Open
jameslbarnes wants to merge 4 commits into
masterfrom
claude/client-code-transparency-0T85T
Open

jameslbarnes wants to merge 4 commits into
masterfrom
claude/client-code-transparency-0T85T

Conversation

@jameslbarnes

Copy link
Copy Markdown
Owner

This feature enables developers to be transparent about their client-side
code, providing end-to-end verification from client to server.

Key components:

  • Manifest generator: Hash all files in a build directory
  • Code signing: RSA-2048 signatures compatible with D-Shield TEE keys
  • Registry API: /api/manifests endpoints for publishing and discovery
  • Client SDK: Browser-compatible verification for self-verification
  • CLI tool: dshield-sign command for CI/CD integration

The client transparency system complements D-Shield's server-side egress
attestation by proving WHAT code is running on clients, enabling users
to verify the complete data flow from client to attested backend.

claude added 4 commits January 5, 2026 23:10
This feature enables developers to be transparent about their client-side
code, providing end-to-end verification from client to server.

Key components:
- Manifest generator: Hash all files in a build directory
- Code signing: RSA-2048 signatures compatible with D-Shield TEE keys
- Registry API: /api/manifests endpoints for publishing and discovery
- Client SDK: Browser-compatible verification for self-verification
- CLI tool: dshield-sign command for CI/CD integration

The client transparency system complements D-Shield's server-side egress
attestation by proving WHAT code is running on clients, enabling users
to verify the complete data flow from client to attested backend.
Extends client transparency to fully document ALL APIs the client talks to:

New features:
- ApiSurface type: Documents endpoints, methods, data categories, third-party
  services, WebSockets, localStorage, and cookies
- Static analyzer: Scans JS/TS code to auto-discover fetch/axios/XHR/WebSocket
  calls with file locations and confidence levels
- CLI analyze command: `dshield-sign analyze --dir ./src` generates API surface
  template and markdown report
- Data flow categories: Standardized types (user-input, credentials, analytics,
  PII flags) for documenting what data goes where

This enables users to see exactly:
- Which domains the client contacts
- What HTTP methods are used
- What data is sent/received
- Which services are third-party vs first-party
- What local storage and cookies are used

Example workflow:
  dshield-sign analyze --dir ./src --report
  # Edit api-surface.json to add descriptions
  dshield-sign generate --api-surface api-surface.json ...
- Add transparent-sdk.ts that wraps global fetch to route all requests
  through D-Shield proxy for complete network visibility
- Add /proxy endpoint in server.ts to handle client SDK requests
- Add SDK hash verification to manifest generator
- Auto-detect D-Shield SDK in builds and include in manifest
- Update documentation to highlight SDK approach as recommended method
- Add request logging with source IP, client ID, size, and body hash
- Add response logging with status, size, body hash, and duration
- Link request/response with sequence numbers for correlation
- Add 'type' field to log entries (egress, request, response)
- Update tests to include new type field

Now logs the complete chain:
- Request: who called, from where, with what (hash)
- Egress: what external APIs were called
- Response: what was returned (hash), how long it took
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.

2 participants