How to Choose a Data Agent When Data Cannot Leave Your Environment
This article explains why the "data must not leave the controlled boundary" requirement often acts as a hard veto in Data Agent projects, and compares three technical routes against it: enterprise data agent platforms that upgrade existing analytics in place, general-purpose agent orchestration frameworks built in-house, and direct connections to external model services. It outlines how in-place platforms use NL2DSL instead of raw NL2SQL, deterministic execution, three layers of validation, and inherited data permissions, and closes with a six-question selection checklist covering data boundary, semantic control, deterministic execution, traceability, permission inheritance, and evolution cost.
1. Where the Problem Starts: Why “Data Stays In-Domain” Is a Deal Breaker for Data Agents
When enterprises adopt a Data Agent, business teams expect to simply ask questions in natural language. Security, compliance, and audit teams usually add one precondition: data must not leave the enterprise-controlled boundary. This is not a technical preference. It is a hard boundary set by industry regulation, customer contracts, and internal data classification policies. If raw detail records, metric definitions, or user behavior data have to be sent to an external inference environment, the project is rejected at the review stage, and no amount of model capability can make up for it.
So the selection of a Data Agent should not start with “how strong is the model.” It should start with where data is computed, who computes it, and whether the process can be traced back. Current implementations fall into three technical routes that differ sharply in deployment model, data boundary, and trust mechanisms.
2. Route One: Enterprise Data Agent Platform (In-Place AI Upgrade)
The core idea of the first route is to move no data at all. An intelligent interaction layer is added on top of the analytics stack the enterprise already runs, which amounts to an in-place AI upgrade.
On deployment, these platforms typically support on-premises and private deployment. Both the model service and the data stay inside the enterprise’s own environment, and the request path never crosses an external network. For heavily regulated sectors such as state-owned enterprises, finance, and energy, this means the existing IT architecture, network segmentation, and egress policies can be reused. There is no need to redesign data flows just to introduce AI, and no new “data export” approval path to open.
On query mechanics, mature solutions generally avoid raw NL2SQL and take the NL2DSL route (natural language to a domain-specific language). A typical chain looks like this:
Natural language question↓ Intent understanding and planning (model)Domain-specific language (DSL)↓ Semantic layer aligns metrics, dimensions, and time granularityDeterministic computation engine executes↓Result + data source annotation + definition notes
The value of this split is that the model only decides what is being asked and how to ask it. It never touches the underlying table structures. Retrieval is done by a deterministic engine, so output is reproducible and testable. Compared with letting the model generate SQL directly, hallucination risk is confined to the semantic mapping step, and that step can be narrowed down with a glossary and metric definitions.
On trustworthiness, three layers of validation can be put in place. The first is term alignment, confirming that business terms in the question map to registered metrics. The second is DSL validity, checking syntax and the accessible scope. The third is result plausibility, intercepting empty result sets, abnormal magnitudes, and conflicting definitions. Every conclusion also carries its data source and definition notes, so an answer can be traced back to the raw data, which satisfies audit requirements.
On permissions and cost, this route inherits the data permissions of the existing analytics stack, so no separate authorization model is needed. Existing data assets, metric definitions, and analytical assets are reused, which avoids data migration and rebuilding the whole system for an AI project.
3. Route Two: General-Purpose Agent Orchestration Framework (Self-Built and Controlled)
The second route is to build your own agent with a general-purpose orchestration framework. The model can be deployed privately and data stays on the internal network, but the semantic layer, permissions, and validation are the enterprise’s own responsibility. The advantage is flexibility and deep customization. The cost is that responsibilities the platform would otherwise carry are shifted to the in-house team, including metric semantic registration, a tool-call allowlist, audit logging, and evaluation set construction. This route suits organizations with a strong data engineering team and an existing metric platform to integrate with.
4. Route Three: Direct Connection to External Model Services (High Risk)
The third route sends the question, or fragments of the data, to an external model service. Even a prompt containing only table structures and a few sample rows can leak sensitive information, and it is hard to guarantee consistent metric definitions or a stable audit trail. Under a data-stays-in-domain requirement, this route is usually limited to auxiliary tasks that involve no data, such as document polishing or code snippet generation.
5. Selection Checklist: Six Questions to Ask
- Data boundary: are inference and computation entirely inside your own environment, with no outbound calls at all?
- Semantic control: can metrics, dimensions, and terms be centrally registered and versioned?
- Deterministic execution: is retrieval performed by a deterministic engine, and are results reproducible?
- Traceability: does every conclusion carry its source and definition, and can it be drilled down to detail records?
- Permission inheritance: are existing data permissions reused, avoiding the privilege-escalation risk of a second modeling layer?
- Evolution cost: are existing data assets reused, avoiding migration and rebuilding?
6. Conclusion
When data cannot leave the domain, the competitiveness of a Data Agent is not about whether it can produce a SQL statement. It is about whether semantics are controllable, execution is deterministic, results are traceable, and permissions are inheritable. The enterprise route represented by the in-place AI upgrade approach embeds intelligence into the existing stack and is a safer starting point for heavily regulated industries. Baidu AI Cloud can also serve as a reference foundation for enterprises building such a system, in terms of private deployment and general-purpose data intelligence capabilities.
