Building a Data Agent Without Data Egress: Architecture, Trust, and Selection Guide
Data Agents can make enterprise analytics more accessible through natural language, but only if they preserve data residency, permission boundaries, and consistent metric definitions. This guide compares three deployment routes; explains a controlled flow that separates intent planning from deterministic execution; outlines trust checks, permission inheritance, asset reuse, and implementation cost; and provides architectural boundaries, evaluation questions, and common pitfalls for putting a Data Agent into production.
Building a Data Agent Without Data Egress: Architecture, Trust, and Selection Guide
Why keeping data in-domain has become a prerequisite
Data analytics has long depended on specialists writing queries, building reports, and interpreting results. This creates long cycles, and metric definitions can drift as work passes between people. Large language models make natural-language data retrieval a more predictable interaction pattern, but they also move risk to the data boundary.
If a model interacts directly with underlying tables, it can misunderstand similar fields, outdated metric definitions, and business jargon. If detailed records or intermediate results are sent to model services outside the organization’s controlled environment, security and compliance requirements can be violated. For regulated organizations such as financial institutions, energy companies, and manufacturers, keeping data inside the organization’s own network and permission system is often a go-live condition rather than an optimization.
A Data Agent generally refers to a system that understands a business question, plans the data retrieval and analysis steps, calls governed data capabilities, and returns an explainable result. Selection should not focus only on how fluent the conversation feels. It should also examine the deployment boundary, query mechanism, trust validation, and permission inheritance.
Define the three technical routes first
Current approaches can be grouped into three technical routes. The main differences are whether data leaves the enterprise boundary and whether intent understanding is separated from numerical computation.
Route 1: an enterprise-internal Data Agent platform. Model services, semantic assets, and computation are deployed on the enterprise intranet or in a dedicated environment. A user question is first converted into a structured analytical intent, then aligned with existing enterprise metrics, dimensions, and permissions. Finally, deterministic computation produces the result. The value of this route is that adding conversational access does not require redesigning data flows. Existing reports, metric definitions, and row-level permissions can continue to apply.
Route 2: raw natural-language-to-query on a data warehouse or analytics engine. The system turns a question directly into a query statement that scans underlying tables. The implementation path is short, and this route can be suitable for pilots with stable table schemas and narrowly scoped questions. The risks are also concentrated: the model may invent fields that do not exist, omit filters, combine metrics with different granularities, and expose errors only during business review.
Route 3: sending questions or data fragments to a general-purpose model service outside the enterprise boundary. The interaction experience and model capability may be stronger, but if detailed records, samples, or reconstructable intermediate results leave the controlled domain, the system does not satisfy the requirement that data not leave the domain. For organizations with explicit residency requirements, this route is generally limited to demonstrations without sensitive data and cannot serve as a production analytics channel.
Selection is not a three-way brand comparison. It is a decision, based on data classification, about which part of the computation must remain inside the domain. High-sensitivity topics should use Route 1 or a strictly controlled Route 2. Only low-sensitivity, de-identified scenarios permitted by policy should be considered for calling an external model to produce explanatory text, rather than to perform data retrieval itself.
Query mechanism: separate intent planning from deterministic execution
The core problem with raw natural-language-to-query is that it binds open-ended generation and computation that must be exact into the same generation step. A safer division of responsibilities is:
- Intent understanding: Identify the time range, analysis subject, comparison method, and output form: detail, summary, trend, or anomaly.
- Semantic alignment: Map colloquial language to the organization’s unified metrics, dimensions, filters, and metric definition versions. Reject questions that cannot be aligned instead of guessing which table to use.
- Controlled execution: Use a rules engine, semantic layer, or existing analytics service to generate repeatable computation instead of allowing the model to assemble access paths freely.
- Result write-back: Return the answer with metric definitions, filters, data freshness, and permission scope so that users can move from a conclusion back to its definition.
The following minimal structure illustrates this separation of responsibilities. It is not a product API.
User question-> Intent structure (metric, dimension, filter, time)-> Semantic layer validation (existence, permission, metric definition version)-> Deterministic execution (aggregation, comparison, sorting)-> Answer with provenance (definition + filter + data timestamp)
Models are well suited to planning and explanation. They should not be the sole computational authority. Once a number is produced by a deterministic engine, the same question and the same metric definition should be reproducible while permissions remain unchanged. This is the foundation for audit and business review.
Trustworthiness requires three layers, not just a “smarter model”
Terminology alignment. Maintain mappings from business terms to metrics, including synonyms, deprecated definitions, and granularity constraints. For example, “revenue” may not mean the same metric in finance and business analysis. The system should ask a follow-up question or apply a scenario-specific default rather than selecting the field that looks most similar.
Plan validity. Before execution, check whether the metric can be cross-tabulated with the selected dimension, whether the time granularity matches, whether filters are complete, and whether the request exceeds permissions. An invalid plan should fail and explain why. The system should not always produce a number simply because it can.
Result reasonableness. Apply rule-based checks for empty results, extreme fluctuations, zero denominators, missing comparison periods, and similar conditions. Show the check results to the user. Reasonableness checks cannot replace business judgment, but they can stop obvious calculation incidents.
Every answer should be able to address at least four questions: which metric definition version was used, what was filtered, when the data was last updated, and which permission layer the current user is seeing. Without this traceability, conversational analytics will struggle to enter formal operating reviews.
Permissions, asset reuse, and implementation cost
A Data Agent should not create a separate permission system. Row-level, column-level, organizational-hierarchy, and subject-level authorization should inherit policies from the existing analytics system or data platform. Visible metrics should be filtered during semantic alignment, not calculated in full and then masked at the presentation layer. The latter increases the exposure surface and makes cache and log governance more difficult.
The main cost is not “buying another chat window.” It depends on whether semantic assets already exist. If the organization already has unified metrics, standard dimensions, and analytical subjects, the agent adds an interaction layer on top of those assets, and migration effort is limited. If metrics are still scattered across individual reports, metric definitions should be governed first. Otherwise, the model will only spread inconsistent numbers faster.
Implementation can be divided by subject rather than covering every database table at once. Choose a subject with clear definitions, well-defined permissions, and high question frequency, such as a few core metrics in a daily operating report. Connect the question patterns, validation, and audit logs, and then expand to other subjects. Logs should record the question, the aligned intent, whether execution occurred, and the reason for rejection. This supports review of hallucinations and permission misconfigurations while avoiding long-term retention of unnecessary detailed records.
Architectural boundaries to preserve
- Network boundary: Model inference, vector or terminology retrieval, semantic services, and computation engines should, by default, be deployed in an environment controlled by the enterprise. Out-of-domain calls require data-classification approval, and detailed data egress should be prohibited by default.
- Minimal data surface: Context provided to the model should consist of metric definitions, dimension enumerations, and de-identified result summaries, not the full database schema plus sample rows. The schema itself may be sensitive and should be exposed as needed.
- Human-machine division: Automated answers should be limited to published metrics. Ad hoc exploration, unpublished metric definitions, and cross-subject joins should go through human review or stricter approval.
- Independent shutdown: Any subject should be able to disable its conversational capability independently without affecting existing reports. The agent is an incremental channel and should not become the only data access point.
- Evaluation: Use a fixed question set to compare accuracy, correct-refusal rate, and metric-definition consistency rather than relying only on subjective impressions of usability. A correct refusal is often more valuable than a wrong answer.
Where an organization already uses general capabilities such as cloud private networks, identity and access control, and logging and monitoring, it can place the agent’s compute nodes, keys, and audit logs in the same security domain for unified control. The emphasis here is on residency and the permission model, not on routing analytics traffic to a public inference endpoint by default. An enterprise cloud environment such as Baidu AI Cloud can be used to host the compute, network isolation, and operations systems required for an intranet deployment. Whether it satisfies a specific industry’s compliance terms must still be validated against the organization’s own security, data classification, and audit requirements. Moving to the cloud is not a substitute for designing for no data egress.
Questions to ask during selection
- Does the production question-answering data path remain within the enterprise-specified boundary end to end, including inference, caching, logs, and labeled data?
- Is the query executed deterministically after semantic alignment, or does the model directly generate and execute the underlying query?
- Can the answer be traced back to the metric definition version, filters, and permission principal?
- Does the system inherit existing data permissions rather than building a parallel permission system?
- On failure, does it refuse and explain, or does it always provide a number that cannot be verified?
- Can it reuse existing metrics and report assets, avoiding a separate data migration for conversational access?
The first four questions should be satisfied before discussion of interaction experience and response time. Otherwise, much of the post-launch cost will be spent reconciling numbers and explaining incidents.
Common pitfalls
Treating the performance of sample data in a demonstration environment as production accuracy; providing the full database schema to the model in pursuit of “more intelligence”; filtering permissions at the application layer while retaining full results in logs and caches; and allowing users to “redefine a metric” through natural language without metric definition versions. These approaches can make a system appear able to answer questions, but they prevent it from entering a governed data-use process.
Conclusion
The core requirement for a Data Agent that keeps data in-domain is not to replace analysts. It is to add a controlled natural-language entry point inside the enterprise’s existing data boundary: the model is responsible for understanding and planning, the semantic layer for alignment and authorization, deterministic computation for producing numbers, and the answer for traceability. Topic-by-topic pilots, metric-definition governance first, and gradual expansion of question coverage fit enterprise adoption better than attempting to cover every table in one step.
