Core Principles
- Consent-Gated: Uploads only occur with explicit user consent
- Derived Data Only: Only state representations (HSI 1.0 format), never raw signals
- Secure Transport: HTTPS + HMAC-SHA256 authentication with time-windowed nonces
- Privacy-Preserving: No raw content, direct identifiers, or raw biosignals (only pseudonymous IDs for routing)
- Tenant-Isolated: Data routed to correct tenant namespace
- Offline-Resilient: Persistent queue with FIFO eviction (max 100 snapshots)
- Rate-Limited: Client-side rate limiting per window type
Architecture
Upload Flow
1. Prerequisites
Before any upload:- User grants
cloudUploadconsent - SDK obtains tenant credentials from Synheart Platform
- SDK generates or retrieves HMAC secret key
2. HSV → HSI 1.0 Conversion
The SDK converts HSV (internal representation) to HSI 1.0 (external format) for upload: Upload Request:3. HMAC Signing
The SDK signs the request with HMAC-SHA256:- Payload: JSON-encoded HSI snapshot
- Secret: Tenant-specific HMAC key (obtained during SDK initialization)
- Nonce: Time-windowed random nonce (prevents replay attacks)
4. HTTP Request
Endpoint:5. Server Validation
The Synheart Platform validates:- HMAC signature: Recomputes HMAC and compares
- Nonce freshness: Checks nonce is within 5-minute window
- Tenant authorization: Verifies tenant has ingestion capability
- Schema validation: Ensures HSI snapshot matches expected format
6. Response
Success (200 OK):Security
HMAC Authentication
Why HMAC?- Prevents tampering with requests
- Prevents replay attacks (via nonce)
- Lightweight (no public key infrastructure)
- Tenant-scoped (each tenant has unique secret)
- Secrets issued by Synheart Platform during app registration
- Secrets stored securely on-device (Keychain on iOS, KeyStore on Android)
- Secrets rotated periodically (90-day cycle)
Nonce System
Nonce Requirements:- Time-windowed: valid for 5 minutes
- Unique: generated via secure random
- Checked server-side: prevents replay attacks
Transport Security
- TLS 1.3: All requests use HTTPS
- Certificate Pinning: SDK pins Synheart Platform certificates
- No Sensitive Data: HSI snapshots contain no PII or raw signals
Rate Limiting
Client-Side Rate Limiting
SDK implements local rate limiting:| Window Type | Max Upload Frequency |
|---|---|
| Micro (30s) | Every 30 seconds |
| Short (5m) | Every 2 minutes |
| Medium (1h) | Every 10 minutes |
| Long (24h) | Every 1 hour |
- SDK may batch multiple snapshots into a single request
- Max batch size (by capability tier): 10 (Core), 50 (Extended), 200 (Research)
- Max request size: 1 MB
Server-Side Rate Limiting
Synheart Platform enforces rate limits per tenant:| Tier | Requests/Minute | Requests/Hour |
|---|---|---|
| Free | 10 | 200 |
| Developer | 60 | 2,000 |
| Production | 600 | 20,000 |
| Enterprise | Custom | Custom |
Data Retention
Cloud Storage
HSI snapshots uploaded to the cloud are retained:- Default: 90 days
- Extended: 1 year (with user consent)
- Research: 5 years (research-tier apps only)
User Deletion
Users can delete cloud data:- SDK sends deletion request to Synheart Platform
- Platform marks data for deletion
- Data purged within 7 days
- Confirmation sent to user
Tenant Routing
Tenant Identification
Each app is assigned a uniquetenantId:
Routing Logic
Synheart Platform routes HSI snapshots to tenant-specific storage:- Each tenant has isolated storage namespace
- Cross-tenant access is forbidden
- Data queries are tenant-scoped
Capability-Based Upload
Upload endpoints respect capability levels:| Capability | Endpoint | Access |
|---|---|---|
| Core | /v1/ingest/hsi | Basic HSI axes |
| Extended | /v1/ingest/hsi | Full 64D embeddings |
| Research | /v1/ingest/hsi-research | Full fusion vectors |
Error Handling
Client-Side Retry Logic
SDK implements exponential backoff for failed uploads:Error Codes
| Code | Description | Client Action |
|---|---|---|
invalid_signature | HMAC validation failed | Regenerate signature |
invalid_nonce | Nonce expired or reused | Generate new nonce |
rate_limit_exceeded | Too many requests | Backoff and retry |
invalid_tenant | Tenant not found | Check tenant credentials |
schema_validation_failed | Invalid HSI format | Check SDK version |
Offline Support
Local Queueing
When network is unavailable, SDK queues HSI snapshots locally:Network State Monitoring
SDK monitors network state and automatically flushes queue when online:Performance Targets
| Metric | Target | Measurement |
|---|---|---|
| Upload latency | ≤ 80ms | 95th percentile |
| Request size | < 10 KB | Per snapshot |
| Batch size | ≤ 1 MB | Per request |
| Queue size | ≤ 100 snapshots | Local storage |
| Retry attempts | ≤ 3 | Per snapshot |
API Reference
Enable Cloud Upload
Manual Upload
Upload Callbacks
Testing
Mock Server
For testing, use the Synheart Platform sandbox:Unit Tests
Related Documentation
- Architecture - Module system and HSI Runtime
- HSV Specification - State representation format
- Consent System - Permission management
- Capability System - Access level enforcement
Last Updated: 2025-12-25 Version: 1.0.0 Author: Israel Goytom