P03 · AI Application Infrastructure
AI Web Chat SDK
A secure embedded AI conversation layer: browser runtime, Web Component, device identity, request signing, anti-replay, short-lived sessions, quotas and service-side controls.
Security-sensitive work stays behind explicit boundaries.
Server-issued identity, then short-lived session authority.
-
CLIENT · WASMBrowser
Build a versioned fingerprint digest
WASM calculates a versioned device fingerprint digest. The browser supplies identity input; it does not mint the server-owned
device_id. -
SERVER · DEVICE
POST /api/v1/device/initResolve a stable device identity
The server applies HMAC to derive a stable fingerprint key, resolves
device_idand returnsdevice_tokenalongside that identity.Response:device_id+device_token -
SERVER · AUTH
POST /api/v1/auth/initVerify identity and issue a session
The service validates
device_tokenand grants short-lived session authority.Response:session_key+JWT -
CLIENT → SERVERSigned chat request
Sign, verify, then account for usage
WASM signs chat requests with
session_key. The server checks request integrity and replay protections before counting accepted usage; quota and rate limits remain separate controls.
Server-issued device_id
The browser does not mint its own device identity. The mapping is derived and owned by the service boundary.
Signed + replay-aware requests
Request signatures are validated before accepted usage is counted, preventing duplicate signatures from consuming quota twice.
Quota and rate layers
Daily device quota, short-lived sessions and IP minute-level limits represent distinct operational concerns.
Implementation snapshot.
The same SDK powers Ask Portfolio AI.
Browser-side SDK, service security controls and MCP-backed portfolio knowledge form one end-to-end AI interaction path.