When teams first adopt large language models, the data residency question rarely comes up. A prototype calls a hosted model API, the demo works, and everyone moves on. But as AI moves from experiment to production, a harder reality sets in: every prompt and every response is data, and much of that data is regulated. A customer support assistant sees names, account numbers, and health details. An internal copilot sees source code, contracts, and financial projections. A document-processing agent sees whatever happens to be in the document. The moment these flows touch a model, the organization has to answer a question that compliance, legal, and security teams already ask of every other system: where does this data live, and who can reach it?

This article explains why data residency matters specifically for AI workloads, walks through the deployment spectrum from fully managed SaaS to fully air-gapped, and shows how a split-plane gateway architecture lets you keep data local while still managing configuration centrally. We will use TrueFoundry as the running example, not because it is the only way to solve the problem, but because its deployment model makes the underlying concepts concrete.

Why Data Residency is different for AI

Data residency is the principle that data is stored and processed within a defined geographic or legal boundary. Data sovereignty goes a step further: the data is subject to the laws of the jurisdiction it sits in, and the organization retains control over who can access it. These ideas are not new. What is new is how much sensitive data flows through an AI system, and how unpredictable that flow is.

Three properties of AI traffic make residency harder than it is for a typical database:

  • Prompts are unstructured and unpredictable. A user can paste anything into a chat box. You cannot reliably know in advance whether a given request contains personal data, so you have to treat the whole channel as if it might.
  • Inference often happens somewhere else. The most capable models are hosted by third parties in specific regions. Sending a prompt to a model endpoint can mean sending regulated data across a border without anyone intending to.
  • Logs and caches multiply the data. Observability traces, prompt caches, and audit records all capture copies of the same sensitive content. Each copy is another place residency rules apply.

Regulations such as the EU's GDPR impose real constraints on transferring personal data outside a region. Sector rules like HIPAA for health data and ITAR for defense-related technical data add further limits. For many organizations the practical answer is a layer that sits between their applications and every model, enforcing where data may travel. That layer is an AI gateway, and its deployment model determines what residency guarantees you can actually make.

The Deployment Spectrum

There is no single right way to deploy an AI gateway. The right choice depends on how strict your data boundary needs to be, balanced against how much infrastructure you want to operate yourself. It helps to think of four points along a spectrum.

SaaS (fully managed)

In the SaaS model, the gateway is operated for you and reached through a managed base URL. Applications point at a single endpoint and the provider handles scaling, upgrades, and availability. This is the fastest way to get a governed, observable path to models, and it suits teams whose data boundary requirements are satisfied by a provider's regional hosting and compliance posture. The trade-off is that request and response traffic flows through infrastructure you do not run.

Hybrid

The hybrid model is a middle path that is often overlooked. Here the provider still operates the gateway, but the request and response data is written to <i>your own object storage</i> rather than theirs. You get the operational simplicity of a managed service while keeping the actual payloads, the prompts and completions, inside a storage account you control. For organizations that are comfortable with a managed control surface but need the sensitive content to stay in their own tenancy, this resolves much of the residency tension.

Self-hosted / on-premises

In the self-hosted model you run the gateway inside your own environment, whether that is your cloud account, your Kubernetes cluster, or your data center. Nothing in the request path leaves infrastructure you operate. This is the common choice for enterprises with strict data-sovereignty requirements, because the boundary is unambiguous: the gateway, its cache, and its logs all live where you put them. The cost is that you own the deployment and its lifecycle.

Air-gapped

At the strictest end, an air-gapped deployment runs with no connection to the public internet at all. This is typical in defense, critical infrastructure, and some regulated financial settings. The gateway and the models it routes to must all live inside the isolated network. Everything the gateway needs, including its configuration, has to be delivered through controlled channels rather than fetched live.

The important point is that these are not four separate products. A well-designed gateway can run in any of these modes because the component in the request path is the same; what changes is where you place it and how its configuration reaches it. The TrueFoundry gateway, for instance, can run on any cloud or on-premises, deployed close to your applications, across this whole range.

The split-plane Architecture

The design that makes this flexibility possible is the separation of the control plane from the data plane. Understanding this split is the key to understanding how configuration can be central while data stays local.

The control plane is centralized. It holds routing rules, access controls, and the configuration and routing management for the whole system. This is where an administrator defines which teams may call which models, what the budgets and rate limits are, and how traffic should be routed. Critically, the control plane is <i>not</i> in the request path. No prompt or response flows through it.

The gateway plane, also called the data plane, is regional and is the only component that sits in the request path. It handles the actual prompt and response traffic, and it reads its configuration and cache from memory. Because it is the sole component touching live traffic, placing it inside a given region, or inside your own environment, is what keeps data in-region or in your own storage.

This separation is what lets you run the gateway plane in your own environment while configuration is managed centrally. An administrator updates a routing rule in the control plane; that configuration propagates to the gateway planes, which continue to serve traffic locally. The sensitive payloads never traverse the central tier. You get one place to manage policy and many places to serve traffic, each honoring its own residency boundary.

There is a performance dimension too. Because the gateway plane reads configuration and cache from memory and is the only hop added to the request, the overhead is small. TrueFoundry reports an added latency overhead typically under 5 milliseconds and throughput of roughly 200 to 250 requests per second on a single CPU core. A governance layer that adds meaningful latency tends to get bypassed; one this light can sit in front of every call.

Regional data planes and residency in practice

Putting the pieces together, residency is achieved by regional routing, regional storage, and regional planes. Data in transit and at rest stays within a region, or within your own blob storage, depending on the deployment model you chose. When you need to serve a new jurisdiction, you add a region: a new gateway plane is deployed there and the central control plane begins managing it alongside the others. The configuration is shared; the data is not.

This is exactly the shape that data-sovereignty requirements such as GDPR call for. You can state, and demonstrate, that European user traffic is handled by a European gateway plane writing to European storage, while a separate region serves another market under its own rules, all governed by the same policies.

Compliance and fitting into your existing stack

Residency is one pillar of a broader compliance posture. A gateway intended for regulated environments is typically validated against frameworks including SOC 2, HIPAA, GDPR, and ITAR. Equally important is how the gateway fits the controls you already run rather than asking you to adopt new ones:

  • Bring-your-own identity. The gateway federates with your existing identity provider over OIDC or SAML 2.0, so access decisions use the accounts and groups you already manage.
  • SCIM provisioning. Users and groups are provisioned and de-provisioned automatically, so access reflects your directory without manual steps.
  • Tenant isolation. Each business unit can be isolated, keeping one team's usage, configuration, and data separate from another's.
  • Secrets from your own vault. Model provider credentials are referenced from your own secrets manager rather than stored in the gateway, so the keys never leave your control.

Together these mean the gateway becomes part of your existing security fabric. Identity flows from your IdP, secrets stay in your vault, and the data path stays within the boundary you chose.

An illustrative self-hosting configuration

To make the self-hosted case concrete, here is an <i>illustrative</i> values snippet of the kind you might use when deploying a gateway plane into your own Kubernetes cluster. The exact field names depend on your distribution; the point is the shape, where you declare the region, the local storage target, and the reference to the central control plane. Treat the values below as illustrative rather than a literal schema.

# illustrative Helm-style values for a self-hosted gateway plane
gatewayPlane:
  region: eu-west-1
  controlPlane:
    # configuration is pulled from the central control plane
    endpoint: https://control.internal.example.com
  storage:
    # request/response data is written to your own bucket
    provider: s3
    bucket: my-org-eu-ai-logs
    region: eu-west-1
  secrets:
    # provider keys are referenced from your vault, not stored here
    source: vault
    path: secret/ai-gateway/providers
  resources:
    requests:
      cpu: "1"
      memory: 512Mi

Once a gateway plane is running, applications call it using the standard pattern: a base URL and an OpenAI-compatible request. In the managed SaaS case that base URL is the provider's endpoint; in a self-hosted case it is your own. The calling code does not change as you move along the deployment spectrum, which is what makes migrating between residency models low-friction.

# illustrative calling pattern against the gateway base URL
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.truefoundry.ai",  # or your self-hosted URL
    api_key="YOUR_GATEWAY_TOKEN",
)

response = client.chat.completions.create(
    model="your-configured-model",
    messages=[{"role": "user", "content": "Summarize this quarter's report."}],
)

Key takeaways

  • Every prompt and response is potentially regulated data, so AI workloads need the same residency discipline as any other system handling sensitive information.
  • Deployment exists on a spectrum: SaaS (fully managed), hybrid (managed gateway, data in your own storage), self-hosted/on-prem, and air-gapped. The stricter the boundary, the more infrastructure you operate.
  • A split-plane architecture separates a centralized control plane (routing rules, access controls, config) from a regional gateway plane that is the only component in the request path, so configuration can be managed centrally while data stays local.
  • Regional routing, storage, and planes keep data in-region or in your own blob storage, and new regions can be added quickly to meet requirements like GDPR data sovereignty.
  • A residency-ready gateway plugs into your existing stack: BYO identity over OIDC/SAML, SCIM provisioning, tenant isolation, and secrets referenced from your own vault, validated against frameworks such as SOC 2, HIPAA, GDPR, and ITAR.