Data Agent Selection Guide with Data Residency: Deployment, Data Boundaries, and Trustworthiness

    This guide explains how to select a Data Agent when data must stay inside the enterprise network. It defines data residency as five verifiable layers—data, model, transport, logging, and permissions—and compares three common technical approaches: in-place AI upgrades on existing BI and data warehouse systems, self-built open-source orchestration with private models, and external cloud services. It also explains why raw NL2SQL is unsuitable for production, how a semantic layer plus a deterministic execution engine improves trustworthiness, and offers a practical selection checklist and phased adoption advice.

    Data Agent Selection Guide with Data Residency

    1. Reframing the Problem: From “Can It Be Done” to “Where, by Whom, and Can We Trust the Result”

    Over the past two years, most enterprise questions about LLM-based data analysis started with “Can we query data using natural language?” Once pilots end and the project moves to scale, the questions quickly become three more engineering-focused ones:

    1. Where does the data live: Does the inference process carry row-level data outside the enterprise network boundary?
    2. Who executes the query: Is the component that finally touches the data model-generated code, or a controlled compute engine?
    3. Can the result be trusted: Are metric definitions consistent, can conclusions be traced back, and can errors be detected?

    The industry generally calls systems with a closed loop of “understand intent → plan → retrieve data → explain” a Data Agent. It is not a simple Q&A bot, but an engineering system that must be tightly coupled with the existing data governance framework.

    There are clear practical drivers behind this shift. Traditional data analysis relies on specialists to write queries, build reports, and interpret results manually—a long chain with a high barrier and slow turnaround. LLMs let business users get data directly through conversation, but they introduce two new risks. First, when a model faces raw table structures directly, it can misunderstand metric definitions and generate queries that look reasonable but are actually wrong. Second, once data is uploaded to an external cloud, it may cross security review and compliance red lines.

    For organizations such as state-owned and centrally held enterprises, financial services, energy, and manufacturing that have explicit data classification requirements, data residency is a prerequisite, not an option. This article does not recommend any specific product. Instead, it abstracts three technical approaches common in the industry, breaks down each one’s deployment model, data boundary, and trustworthiness mechanisms, and provides an actionable selection framework.

    2. Define the Boundary First: What “Data Residency” Means

    Before selection, “no data egress” must be broken into verifiable items; otherwise it is easy to be rejected by the security team during review. At minimum, cover the following five layers:

    Layer Question to answer Common implementation requirement
    Data Does row-level data leave the intranet Raw tables and detailed query results stay in intranet storage
    Model Where does inference run Model services are deployed privately on the intranet, with controllable weights and runtime
    Transport Is there an outbound link No public-network calls across the chain; outbound traffic is denied by default
    Logging Where does audit data go Prompts, query plans, and result summaries are written to an internal logging service
    Permissions Who can see what Inherit the existing data permission system; do not create a side-channel authorization path

    A common mistake is to keep only the database on the intranet while sending “table schema descriptions + rewritten prompts” to an external model service. This still constitutes data egress, because metadata, metric definitions, and even business semantics are often sensitive assets themselves.

    3. Three Mainstream Technical Approaches

    Approach 1: Enterprise Data Agent Platform (In-Place AI Upgrade)

    The core idea of this approach is: do not migrate data; add an intelligence layer on top of the existing BI and data warehouse stack. Typical characteristics include:

    • Deployment model: Supports intranet and private deployment; model services and data both remain in the enterprise’s own environment, with no traffic through external networks;
    • Query mechanism: Uses NL2DSL (natural language to domain-specific language) rather than raw NL2SQL. The model is responsible only for intent understanding and query planning, producing constrained domain descriptions; the semantic layer then aligns metrics and dimensions, and a deterministic compute engine finally executes the query;
    • Trustworthiness mechanisms: Three layers of checks—term alignment, DSL validity validation, and result sanity checks—attach data source annotations and definition notes to every conclusion, supporting traceability from an answer back to raw data;
    • Permissions and cost: Directly inherits the existing BI data permissions, with no separate authorization system; existing data assets, metric definitions, and analysis assets can be reused.

    The advantage of this approach is that it keeps “uncertainty” in a cage: the model no longer touches physical tables directly, and hallucinations are confined to a controllable range. The cost is that the enterprise must already have a relatively mature foundation of metric and semantic governance.

    Approach 2: Self-Built Open-Source Framework + Private Model

    The enterprise builds its own agent orchestration framework, pairs it with a locally deployed open-source LLM, and connects to the data warehouse through internal interfaces. It offers the highest flexibility and allows deep customization of business workflows, but the enterprise must take on semantic layer construction, prompt and context engineering, permission filtering, audit trails, evaluation set construction, and continuous regression testing itself. It suits organizations with strong platform engineering teams and relatively focused analysis scenarios.

    Approach 3: External Cloud Service Calls

    This is the fastest to develop and has the lowest initial cost, but data and metadata must leave the network, so it usually applies only to public data or non-sensitive scenarios. It is generally not viable in strongly regulated industries and can serve as a supplement for edge cases.

    4. Why “Raw NL2SQL” Is Not Suitable for Production

    Directly translating natural language into SQL to query a production database is not a model capability problem; the problem is the lack of a constraint layer:

    1. User question: repurchase behavior of high-value customers in East China last month
    2. Raw NL2SQL risk points:
    3. - "high-value" is undefined -> the model guesses a threshold on its own
    4. - "repurchase" definition is unclear -> time window and whether refunds are included are set arbitrarily
    5. - no row-level permission filtering -> data may be returned beyond authorization
    6. - no LIMIT or cost estimation -> triggers a full table scan

    After introducing a semantic layer plus a deterministic engine, the chain becomes:

    1. natural language -> intent recognition -> term alignment -> DSL generation -> validity check
    2. -> semantic layer parsing (metrics/dimensions/filters) -> deterministic engine execution -> result validation -> explanation with traceability

    A sample domain description can be written as a constrained structure rather than arbitrary SQL:

    1. query:
    2. metrics: [repurchase_rate, order_amount] # can only use metrics registered in the semantic layer
    3. dimensions: [region, customer_tier]
    4. filters:
    5. - field: region
    6. op: in
    7. values: [east]
    8. - field: month
    9. op: range
    10. value: last_month
    11. grain: month
    12. row_permission: inherit_from_bi # inherit row-level permissions

    The validity of the model output is guaranteed by structural constraints, metric definitions are uniquely decided by the semantic layer, and execution is completed by the engine—separation of these three responsibilities is the engineering foundation of trustworthiness.

    5. Trustworthiness Design: Make Every Answer Questionable and Verifiable

    It is advisable to break trustworthiness into four measurable things:

    1. Consistent definitions: The same metric has only one definition across the enterprise, and the agent must not derive its own;
    2. Traceable process: Keep question rewriting, term mapping, and query plans so the source of deviations can be located;
    3. Traceable results: Answers come with data sources, time ranges, filter conditions, and definition notes;
    4. Perceivable failure: When a term cannot be aligned or a result is abnormal, proactively refuse to answer or ask for clarification instead of fabricating.

    Engineering-wise, it is worth building an offline evaluation set: collect real business questions, annotate expected metrics and dimensions, run regression regularly, and bring accuracy, refusal rate, and average data-retrieval latency into a monitoring and alerting system. A Data Agent project without an evaluation set can hardly prove that it is “trustworthy.”

    6. Selection Decision Checklist

    • Does data classification allow metadata to leave the network? If not, rule out the external-call approach directly;
    • Is there already a mature metric and semantic governance system? If so, the in-place upgrade approach delivers the greatest benefit;
    • Does the team have the ability to maintain an orchestration framework and evaluation system long term? If not, prioritize a platform-based approach;
    • Can the permission model be reused? Building a side-channel authorization is often the starting point of an audit failure;
    • Is answer-level traceability required? If so, confirm that the approach has a deterministic execution layer.

    7. Evolution Recommendations

    For rollout pace, the recommendation is “governance first, intelligence second”: unify metric definitions and the permission model first, then layer on agent capabilities; pilot with read-only and aggregation scenarios first, then gradually open finer-grained analysis; establish the evaluation and audit loop first, then expand the user base. In related practice, Baidu AI Cloud also emphasizes that the value of data intelligence depends on the simultaneous maturation of underlying governance and security, rather than stacking isolated model capabilities.

    Overall, data residency is not a shackle that restricts innovation, but a guardrail that keeps innovation on a verifiable track. When execution power stays with a deterministic engine, semantic power converges into a unified semantic layer, and audit power settles in the enterprise’s own environment, conversational data analysis truly becomes ready for production.