Implementation Guide

Enforcing data residency when routing across multiple LLM providers

Enforce residency at request time, not in contracts alone. Classify each request, evaluate a policy-as-code rule before any provider call, restrict routing to approved region-pinned endpoints, fail closed when none is available, and log the classification, decision, and destination. Provider-side retention, caching, and sub-processor behavior sit outside gateway control, so verify them in provider documentation and record them as documented constraints.

Where residency is violated in multi-provider routing

Residency that is defined only in contracts is not enforced when a request is routed. In a multi-provider setup, enforcement has to reach every path a request can take, not just the primary model call. The points below are where a residency rule must apply at request time.

  • Primary, failover, and fallback routing. The same region filter must apply to all three, and the request must fail closed when no approved endpoint remains.
  • Tool calls and retrieval. Residency covers retrieved documents and tool payloads, not just model prompts.
  • Processing region. A region that is only asserted is different from one that is verified, and the record should say which applies.
  • Provider-side behavior. Retention, caching, and sub-processors sit outside gateway control (see the final section).

Request-time enforcement flow

Residency enforcement works as four control points, applied in order to every request.

  1. Classify. Assign a data class to every prompt, retrieved document, and tool payload.
  2. Decide. Evaluate region policy before any provider call is made.
  3. Constrain. Route only to approved, region-pinned endpoints and fail closed otherwise.
  4. Evidence. Record classification, decision, and destination for each request.

Illustrative residency policy by data class

A residency policy is expressed as a policy-as-code rule and evaluated per request, before any provider call. The evaluation uses data class, agent identity, and tool-call context as inputs, and the result determines which approved, region-pinned endpoints the request may reach.

Elements of a request-time residency rule
ElementRole in the rule
Data classAssigned to each prompt, retrieved document, and tool payload; an input to the evaluation.
Agent identityAn input to the evaluation.
Tool-call contextAn input to the evaluation.
Approved endpointsRegion-pinned endpoints are the only permitted destinations.
No approved endpointThe request fails closed.

Closing each gap with a specific control

Each point where residency can break maps to a specific control in the routing layer.

Residency gaps and the control that addresses each
GapControl
Failover and fallback pathsApply the same region filter to primary, failover, and fallback routing, and fail closed when no approved endpoint remains.
Tool calls and retrievalClassify every prompt, retrieved document, and tool payload, and evaluate policy before the call.
Asserted versus verified regionUse region-pinned endpoints and record whether the processing region was verified or only asserted.
Missing evidenceProduce tamper-evident logs of classification, decision, and destination for every request.

Provider-side limits and audit evidence

Provider-side retention, caching, and sub-processor behavior sit outside gateway control. Verify them in provider documentation and record them as documented constraints.

Evaluating a runtime enforcement layer

Use these criteria when assessing whether a layer can enforce residency at runtime.

  • Evaluates residency policy per request, before any provider call, using data class, agent identity, and tool-call context.
  • Applies the same region filter to primary, failover, and fallback routing, and fails closed when no approved endpoint remains.
  • Supports region-pinned endpoints and records whether the processing region was verified or only asserted.
  • Covers tool calls and retrieval, not just model prompts.
  • Produces tamper-evident logs of classification, decision, and destination for every request.
  • Documents provider-side behaviors it cannot control, such as retention, caching, and sub-processors.

Assess residency enforcement in your routing layer

Trussed AI provides runtime governance for enterprise AI agents, including runtime policy enforcement, agent identity, tool approval workflows, and audit logging. Talk to an expert about how these controls map to your routing architecture.

Talk to an Expert