Security model
Trust boundaries
Section titled “Trust boundaries”| Party | Trusted with | Not trusted with |
|---|---|---|
| Hub | keys (as hashes), routing, audit | nothing beyond request metadata; it stores no bodies |
| Node | the jobs routed to it | other nodes’ jobs; it accepts jobs only from its hub |
| Client | its own key’s scope | other models, admin endpoints, node endpoints |
| Network between them | nothing | everything is TLS (or a LAN-only plain WebSocket you opt into) |
- Keys: virtual keys
sk-aigw-+ 43 base62 characters (≈ 256 bits). Stored asHMAC-SHA256(pepper, secret); compared in constant time. The admin key is never stored. - Least privilege: client keys are scoped to model globs (others answer 404), rate limited and quota’d. Node keys can only connect, register and submit registry results. Key checks happen before role checks.
- Client addresses:
X-Forwarded-For/X-Forwarded-Protoare believed only fromtrustedProxies;CF-Connecting-IPonly when the hop before them is inside Cloudflare’s published ranges. - Input: bodies are limited (10 MB default; 64 KB for registrations, 8 KB for the waitlist) and content-sniffed. Data-URL images are decoded and checked; remote URLs are never fetched (no SSRF).
- Audit: time, key name, IP, method, path (no query), model, node, status, ms, bytes, request id. Never keys or bodies. Retention 30 days by default; usage aggregates are kept.
- Dashboard: random session (memory only) in a
Secure; HttpOnly; SameSite=Strict; Path=/admincookie, CSRF token on every form,Origin/Refererchecks, lock-out after 10 failed logins in 15 minutes, strict CSP,no-store. Put Cloudflare Access in front of/adminas a second factor. - Image: distroless/static, uid 65532, no shell; Compose adds
read_only,cap_drop: ALL,no-new-privileges. Metrics live on a separate listener that is never published.
- Outbound only: TLS with the system trust store and host-name verification, or a
certSha256pin for a self-hosted hub; redirects are not followed. With"listen": falsethe node has no network attack surface. - Secrets: the node key lives only in
gateway.confand is never logged or shown. - Bounded work: the hub can only run installed models, through the same body limits, queues and timeouts as any client. Nodes never forward.
- LAN-only mode (phone as hub): the server binds to the private address of Wi-Fi or Ethernet only, rejects non-private client addresses, and pins self-signed certificates between hub and nodes. mDNS-discovered gateways are shown but never trusted automatically.
Model packages
Section titled “Model packages”SHA-256 of the model file is checked before it is served; unknown manifest fields are rejected. Ed25519 signatures
are not implemented yet: with "requireSignature": true every package is rejected until they are.
Client library (Android)
Section titled “Client library (Android)”Same-device IPC is protected by a signature-level permission. Before binding, the library verifies the installed
gateway app’s signing certificate (pinned, or the same signer as the app), the permission’s declaring package and
protection level, and the exact service component, which defeats package-name squatting.
Reporting
Section titled “Reporting”Write to the address on the security page. Please include steps to reproduce and no third-party data.