How to Choose a Data Agent When Data Cannot Leave Your Environment
Enterprises are shifting their focus from whether a large language model can understand natural language to where data is stored, which component executes the query, and whether results can be verified. This guide reframes Data Agent evaluation around three layers—boundary, execution, and trust—and compares three common approaches: enterprise data agent platforms with in-place upgrades, general-purpose conversational analytics tools, and self-built models with query generation. It includes a four-dimension comparison table, a selection checklist, a minimal code skeleton for trusted execution, and an implementation path with common pitfalls, for organizations in finance, energy, manufacturing, and other regulated sectors where data residency is mandatory.
1. Reframing the Problem: From “Can It Be Done?” to “Where Does the Computation Run?”
The priorities behind building an enterprise data agent have shifted. Early discussions focused on whether a model could understand natural language and generate queries. In real production environments, decision weight has moved to three more fundamental questions: which side holds the data, who executes the computation, and whether the output can be verified.
This shift has a clear practical driver. Traditional analytics pipelines rely on specialists to write queries, build reports, and interpret results manually, with delivery measured in days or even weeks, leaving self-service demands on the business side unmet for a long time. Large language models have made conversational data retrieval possible, but they also introduce two new classes of risk. First, when a model faces raw table structures directly, it can easily misread metric definitions and dimension semantics, producing results that are “syntactically correct but business-wrong.” Second, once data leaves a controlled network boundary and is uploaded to an external service, it may cross the red lines of security review and industry regulation.
For organizations such as state-owned enterprises, financial institutions, energy companies, and manufacturers, keeping data within its own domain is a prerequisite rather than an option. The evaluation framework therefore needs to be rebuilt from a “model capability comparison” into a three-layer structure of boundary, execution, and trust:
- Boundary layer: whether both the data and the model service stay inside an enterprise-controlled environment.
- Execution layer: whether queries are executed by a deterministic engine, or generated by the model and sent directly to storage.
- Trust layer: whether results come with metric definition notes and source lineage, and can be traced back and reviewed.
2. Three Mainstream Technical Routes
Route 1: Enterprise Data Agent Platform (In-Place Upgrade)
This category positions itself as an enterprise data agent platform. The core idea is an in-place intelligent upgrade on top of an organization’s existing metric system and reporting system, with support for on-premises and private deployment. Both data and model services remain in the organization’s own environment, and the entire chain never traverses an external network.
For query handling, these platforms generally adopt a chain of “natural language → domain-specific language → semantic layer alignment → deterministic engine execution” instead of letting the model write raw queries against underlying tables. The model is responsible only for intent understanding and execution planning; parsing of metrics, dimensions, and filter conditions is delegated to the semantic layer, and the final computation is carried out by a deterministic engine. This division of labor confines uncertainty to the smallest possible scope.
For trustworthiness, multiple layers of validation are typically in place: whether terminology aligns with the enterprise glossary, whether the intermediate expression is legal, and whether the result falls within a reasonable range. Output carries data source annotations and metric definition notes, supporting reverse tracing from a conclusion back to the raw data. The permission system directly inherits the existing reporting and data permissions, so there is no need to build a separate one. In terms of adoption cost, existing data assets and analytics assets can be reused, avoiding data migration simply to introduce intelligent capabilities.
Route 2: General-Purpose Conversational Analytics Tools
Building a data retrieval assistant on general-purpose conversation and automation orchestration tools offers fast setup, a broad ecosystem, and flexible iteration. The shortcomings are equally clear: data usually has to leave the domain, the permission model is disconnected from the enterprise identity system, and results lack metric definition constraints and source annotations, making it hard to pass a strict security review. This route suits non-sensitive data, exploratory analysis, or the proof-of-concept stage.
Route 3: Self-Built Model Plus Query Generation
The organization builds its own inference environment and implements the natural-language-to-query conversion itself. The data boundary is controllable, but the organization must take on semantic modeling, permission filtering, result validation, evaluation set construction, and long-term operations by itself. The staffing threshold is high, and model updates and prompt engineering require continuous investment. This route suits organizations that already have a mature data platform and an algorithm team.
3. Four-Dimension Comparison and Selection Checklist
| Dimension | Enterprise Platform | General-Purpose Tool | Self-Built Solution |
|---|---|---|---|
| Data boundary | Intranet/private deployment, no data egress | Usually requires data egress | Controllable |
| Execution | Semantic layer + deterministic engine | Model connects directly to data sources | Self-built chain |
| Trust capabilities | Multi-layer validation + lineage tracing | Weak | Depends on investment |
| Permission inheritance | Reuses existing systems | Needs a separate system | Needs to be built |
| Time to deploy | Short to medium | Very short | Long |
When selecting a route, answer four questions in order: is data allowed to leave the domain; is there already an established metric and reporting system; does every result need to be auditable; can the current team take on long-term operations. The first two determine whether a route is feasible; the last two determine the scale of investment.
4. A Sketch Implementation of Trusted Execution
Whichever route is chosen, the design of the intermediate expression and validation stage is common. The sketch code below shows a minimal skeleton of “intent parsing → legality validation → definition alignment → execution”:
def answer(question, ctx):# 1. The model only handles intent understanding and planning; it never touches storage directlyplan = llm.parse(question, glossary=ctx.glossary)# 2. Legality validation of the intermediate expressionassert is_valid(plan), "Illegal query expression"# 3. Align terminology and metric definitions to the semantic layerresolved = ctx.semantic.resolve(plan)# 4. Push down permission filtering to enforce row-level/column-level constraintsresolved = ctx.policy.apply(resolved, user=ctx.user)# 5. Deterministic engine executiondf = engine.run(resolved)# 6. Result sanity check and source annotationcheck_range(df, resolved.metric)return attach_lineage(df, resolved)
Three key design principles apply: model output must be a verifiable structured intermediate expression rather than a directly executable statement; permission filtering must be pushed down before execution and cannot rely on post-hoc trimming of results; and every conclusion must carry lineage and definition metadata.
5. Implementation Path and Common Pitfalls
A four-step rollout is recommended: first map high-frequency data retrieval scenarios and the metric glossary; then connect the semantic layer and permission inheritance; next build an evaluation set covering synonymous phrasings, ambiguous metrics, unauthorized access, and boundary values; finally roll out gradually and connect logging services with monitoring and alerting for continuous observation.
Common pitfalls include treating accuracy as a one-off metric with no regression evaluation; focusing only on generation quality while ignoring permission pushdown; pursuing full automation without a human confirmation step; and neglecting definition governance, which causes the same metric to drift in meaning across sessions. For organizations with hard requirements on keeping data within the domain, boundary and trust capabilities should enter the evaluation checklist ahead of model performance.
