Hybrid Edge-Cloud Inference › Privacy boundaries
Language AI HandbookAll chapters Review which data crosses the network boundary, who can read it, and how long the device and the server retain it. Model weights alone tell you little about those controls. A hybrid system has several places to enforce its policy.
- Retention: never store cloud prompts and completions, or store them for a bounded window. This is a server-side control, and it must be contractual as well as technical: a retention policy that is not enforced by the serving infrastructure is a promise, not a guarantee.
- Redaction before send: run a local PII/NER model and strip or mask sensitive spans before anything leaves the device. We covered detection strategies in PII Removal. Redaction is only as good as the detector, so its reliability must be measured and its failure modes understood.
- Hard routing exclusions: certain documents, apps, or user categories are never eligible for cloud routing, regardless of the difficulty score. These are categorical, not probabilistic, and they must be enforced in code rather than in documentation.
- On-device aggregation: send only derived features (e.g., "document is 800 tokens, legal-domain") for routing statistics, never raw text. Even derived features can expose information about a request. Minimize them and apply the same authorization and retention policy to telemetry.
- Intermediate state. Treat split activations as sensitive data. A split-inference study recovered information from hidden states under its tested model, split and attacker assumptions. Scope the transfer review to the states your protocol sends and who can access them.
The design pattern is a privacy gate that runs first, before the router. The gate classifies each request into one of: local_only, redact_then_cloud_ok, or cloud_ok. The router then operates only within what the gate permits.
Implementing the gate as an explicit, testable component (not a comment in a routing rule) is what lets you audit it. We include a minimal gate in the code below.
Run the gate before any transfer or logging that depends on its decision. For each transmitted payload, verify that the gate granted unconditional approval or that the required redaction completed. Include retries, fallback paths and telemetry in this check.
The three gate outputs are not equal in risk: a cloud_ok request is cleared exactly as written, whereas a redact_then_cloud_ok request is cleared only conditional on redaction succeeding, so the gate's output is a precondition that another component must fulfill, and the pipeline must treat a redaction failure as a fallback to local_only rather than a silent breach. A local_only request must be served on the edge or refused, and must never fall back to the cloud even under error conditions, because the most dangerous bug is a fallback path that ignores the gate.
A deterministic pre-routing component that assigns each request a transfer policy (local_only, redact_then_cloud_ok, cloud_ok) based on content type, user/app policy, and jurisdiction. It runs on-device and its output is a necessary precondition for any cloud routing.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!