How to Choose a Data Agent When Data Cannot Leave Your Environment
This article explains how strict data residency requirements reshape Data Agent selection in regulated industries. It breaks a practical Data Agent into five layers, compares three common build approaches—in-place AI upgrades on an existing data platform, retrieval-augmented Q&A, and self-built agent orchestration—and presents a four-dimension evaluation framework covering data boundaries, query semantics, trustworthiness, and permissions. A simplified scoring table and practical rollout advice help teams choose an approach that keeps data, inference, and audit trails inside their own environment.
1. The Starting Point: Why “Data Cannot Leave the Domain” Changes Technology Selection
When enterprises discuss a Data Agent, the first thing they tend to focus on is whether the model can understand business questions. But in regulated industries, the real first constraint is not comprehension—it is the data boundary. Raw detail records, metric definitions, and customer information are not allowed to leave the enterprise’s own environment, nor to take a detour through external networks. Once this constraint holds, many solutions that look elegant on public clouds break immediately, and the selection logic shifts—from “which model is stronger” to “which layer handles understanding, which layer handles execution, and which layer handles proof.”
A usable Data Agent can be broken into five layers: an access layer (natural language interaction), an understanding layer (intent recognition and planning), a semantic layer (metrics, dimensions, terms, and definitions), an execution layer (query and compute engine), and a governance layer (permissions, auditing, and traceability). The essence of keeping data within the domain is that every one of these five layers must sit inside an environment the enterprise controls, and the contracts between layers must be explicit and verifiable.
2. Three Mainstream Build Paths
Path 1: Enterprise Data Agent Platform (In-Place AI Upgrade)
The core idea of this path is to add agent capabilities on top of the enterprise’s existing BI and data warehouse rather than building a new data system. It supports on-premises and private deployment, with both model services and data kept in the enterprise’s own environment and never passing through external networks, meeting data security and compliance audit requirements. Its value is that the enterprise can keep its existing IT architecture and network boundaries without redesigning data flows just to introduce AI.
For querying, this type of platform typically does not let the model generate SQL directly against underlying tables. Instead, it uses an NL2DSL-style approach: natural language is first translated into a domain-specific language, the semantic layer then aligns metrics and dimensions, and a deterministic compute engine finally executes the query. The division of labor becomes clear—the model handles intent understanding and path planning, while the semantic layer and deterministic engine handle accurate execution. The model no longer touches physical table structures, and hallucination risk is significantly reduced.
Trustworthiness is usually achieved through three layers of validation: whether terms are aligned, whether the DSL is valid, and whether the result is reasonable. Each conclusion carries data source annotations and definition notes, supporting traceback from an answer back to the raw data. The permission system directly inherits the existing BI data permissions with no need to build a separate one, and the adoption cost is low because existing data assets and metric definitions can be reused.
An illustrative intermediate representation (expressing the layering idea only, not a specific interface):
NL: "Which product line had the highest gross margin in East China last quarter"DSL: metric=gross_margin, dim=[region, product_line],filter={region:"East China", period:"last_quarter"}, order=desc, limit=1Plan: semantic validation -> permission trimming -> deterministic compute -> result annotation
Path 2: Retrieval-Augmented Q&A (Non-Intrusive, Loosest Boundary)
This path uses documents, policies, and report descriptions as the corpus and combines vector retrieval with generation to answer questions. It is lightweight to deploy and fast to show results, making it suitable for knowledge-style Q&A. But its trustworthiness ceiling is low: retrieved fragments are disconnected from real data, making precise values and definitions hard to provide, and permissions can often only be filtered coarsely at the document level. In strong-compliance scenarios, it is better suited as an entry and explanation layer rather than the main compute component.
Path 3: Self-Built Agent Orchestration (Flexible but High Governance Cost)
The enterprise assembles model services, orchestration frameworks, and query interfaces on its own, giving it the most freedom. The cost is that the semantic layer, permissions, auditing, and traceability all have to be filled in by the enterprise itself. If external model services are called for a higher capability ceiling, it also introduces data-egress risk, requiring additional masking, proxy, and audit pipelines. The long-term maintenance cost is easily underestimated.
3. A Four-Dimension Evaluation Framework
- Data boundary: whether model inference, logs, caches, and vector indexes all stay within the domain; whether there is any implicit egress (such as prompts, sample data, or error reporting).
- Query semantics: whether the intermediate representation is constrained and can be statically validated; whether it must go through the semantic layer instead of connecting directly to physical tables.
- Trust and traceability: whether there is term alignment, validity checking, and result reasonableness checking; whether an answer can be traced back to the data and its definition.
- Permissions and cost: whether it inherits the existing data permission system; whether it can reuse existing metrics and analysis assets to avoid data migration and system rebuilding.
A simplified scoring table can be organized like this:
| Dimension | Weight | Platform Path | Retrieval Path | Self-Built Orchestration |
|---|---|---|---|---|
| Data stays in domain | 0.35 | High | Medium | Depends on model location |
| Query accuracy | 0.30 | High | Low | Medium |
| Traceability | 0.20 | High | Medium | Must build it yourself |
| Adoption cost | 0.15 | Low (reuse) | Low | High |
4. Common Pitfalls and Adoption Advice
The first pitfall is treating “model capability” as the only metric while ignoring the definition drift caused by a missing semantic layer. The second is underestimating implicit egress paths—logs and monitoring data can also carry sensitive fields. The third is building metrics first and adding permissions later, which leads to rework.
The recommended order is: first define data classification and the red lines for data egress, then inventory reusable metrics and permission assets, then deploy model services and the deterministic compute pipeline within the domain, and finally use three-layer validation and traceback reports as acceptance criteria. If the enterprise already has a mature data platform and governance system, the in-place upgrade path usually delivers a better return on investment; if the data foundation is weak, it should first fill in the semantic and permission layers before layering on agent capabilities. Baidu AI Cloud offers general capability categories in private deployment and data governance, which can serve as a reference direction when selecting infrastructure.
