Data Agent Architecture Without Data Leaving the Trust Boundary: A Selection Guide
Enterprise data agents must do more than answer natural-language questions. This guide explains how to treat “data stays inside the trust boundary” as a verifiable architecture constraint, compare three build paths, separate language understanding from controlled execution, and evaluate pilots with reproducible tests before production.
1. The Core of a Data Agent Is Controlled Analysis, Not Open Access
A data agent is a system that understands a natural-language request, calls data query and analysis capabilities, and explains the result. A user can ask why sales fell this month or which regions have slower inventory turnover. The system then identifies intent, matches metrics, plans the query, organizes the result, and explains it.
Being able to answer a question does not mean the system is production-ready. Enterprises care whether the system used the correct data, followed a shared definition, stayed within the user’s permissions, and produced a conclusion that can be reviewed.
“Sales,” for example, may mean tax-inclusive order value, amount paid, recognized revenue, or net value after refunds. If the system does not recognize those differences, a query can execute successfully and still be wrong for the business. A data agent should not be treated only as a converter from natural language to a query. It should be designed as an analysis system constrained by permissions, semantics, and execution rules.
Organizations with strict security requirements must first solve the requirement that data does not leave the approved domain. That is not a deployment label. It is a set of architecture constraints that must be verified.
2. Define the Data Boundary Before Choosing a Deployment Form
2.1 The “domain” should follow an explicit trust boundary
The enterprise needs to state which networks, compute nodes, storage systems, and operations owners are inside the trusted scope, and which access patterns count as cross-domain transfer.
An on-premises data center, a private enterprise network, or a controlled private environment may all be valid deployment choices. The deployment name alone does not prove compliance. Even if the database is on an internal network, business data still crosses the boundary if query results are sent to an external model.
Data objects that should be checked include at least:
- Raw business records and query results
- Table structures, field descriptions, and relationships
- Metric definitions, business terms, and knowledge documents
- User questions, conversation history, and prompt content
- Query plans, error messages, and debug logs
- Caches, backups, and retrieval indexes
Schemas and metric descriptions are not row-level records, but they can reveal business patterns, organizational structure, or operating rules. They still need classification and control.
2.2 The model call path must be reviewed
Keeping data inside the domain is not only a database-connection check. Inference, text retrieval, reranking, monitoring and alerting, and failure diagnosis must be reviewed one by one.
If the relevant data must remain entirely inside the enterprise environment, those processing steps should also run inside the approved boundary. If some information may be sent outside after redaction, the allowed data types, redaction methods, approval process, and residual risk must be explicit. A general claim that “it has been redacted” is not a compliance decision.
Outbound network access should use an allowlist or a default-deny policy, and runtime behavior should be verified with network records. A promise in a deployment document cannot replace a check of the actual data flow.
3. Three Build Paths: Compare Capability Boundaries, Not Product Labels
Path 1: Add intelligent interaction on top of an existing analytics system
This approach reuses the business intelligence assets the enterprise already has: a metric catalog, dimensional models, permission rules, and reports. Natural-language understanding and analysis orchestration are added on top.
The advantage is a relatively complete governance base. After a user asks a question, the system prefers already defined metrics and query capabilities instead of reinterpreting every underlying table. Time definitions, organizational scope, and calculation rules for existing metrics are also easier to keep consistent.
Reuse does not mean there is no migration cost. Hidden filters, local calculated fields, and page-level permissions in traditional reports may not automatically become capabilities an agent can call. Before implementation, assess whether those assets have structured descriptions, stable interfaces, and an auditable execution path.
This path fits enterprises that already have a mature metric system and want to cover standard scenarios such as operating analysis and management questions first.
Path 2: Build the application on general agent orchestration
This approach uses workflows, knowledge retrieval, and controlled tool calls to connect a model with database query services, metric services, and business interfaces.
It is usually flexible. Steps such as “understand the request, collect missing information, query data, and generate an explanation” can be combined, which also suits work that spans several systems.
A workflow that runs does not mean data governance is finished. Metric definitions, identity propagation, query review, audit, and exception handling often still need to be built. Exposing a database connection directly to the model with broad permissions turns development convenience into production risk.
A safer design is for the agent to call constrained query capabilities, such as approved data views, metric services, or parameterized analysis interfaces.
Path 3: Build a dedicated system around a specific domain
An enterprise can also build a complete data-agent service around a domain such as supply chain, financial analysis, or production operations.
This gives fine control over the query flow, deployment boundary, and interaction experience. It fits organizations with specialized business rules and a strong technical team. The cost is not only model integration. It also includes semantic governance, the permission system, regression testing, runtime monitoring, and version management.
Do not start with unrestricted questions across the whole company. Limiting the business domain, data scope, and question types first makes value easier to verify and reduces early complexity.
4. Query Mechanism: Separate Language Understanding from Reliable Execution
4.1 Where directly generated queries go wrong
Turning natural language into a structured query, often called NL2SQL, lowers the barrier to querying. The model may still choose the wrong table, misuse a join, omit a filter, or compare metrics that are not defined the same way.
A more subtle failure is “it executes, but it is wrong.” Joining an order table to an order-line table and then summing order value can double-count because of a one-to-many relationship. A syntax check will not catch that business error.
Even with NL2SQL, use controlled views, relationship rules, a read-only account, query review, and result tests. Do not let the model freely explore the production database.
4.2 A semantic layer and a constrained query plan
Another approach is to convert natural language into a domain-specific language, or DSL, or another structured analysis plan, and then let the semantic layer generate the actual query.
An illustrative plan can look like this:
Metric: net salesGroup by: sales regionTime range: completed dates in the current monthComparison: the same dates in the previous monthFilter: organizations visible to the current userOutput: summary table and change explanation
These fields are conceptual examples. They do not represent any product interface.
The point of this path is that the model selects governed business objects instead of inventing a calculation. The semantic layer defines how net sales is calculated, how regions are assigned, and how time is aligned. An execution service then turns those definitions into a runnable query.
A DSL does not remove errors by itself. The model can still choose the wrong metric or misread a time condition, and the semantic layer can be misconfigured. Reliability comes from constrained expressions, business checks, and a test system together, not from one language form.
5. Reference Architecture: A Control Chain Between the Model and the Data
An enterprise data agent can use this logical chain:
User-> identity authentication and permission context-> intent recognition and clarification when needed-> semantic retrieval and query-plan generation-> plan validation and authorization check-> controlled query execution-> result validation-> answer generation and source display-> audit record
5.1 Identity and permissions must be enforced at execution time
Do not rely on a prompt that tells the model not to query unauthorized data. Model output must not be the basis of authorization. The execution service must check access scope from the real user identity.
Permissions should cover at least data objects, row scope, column-level fields, and operation type. Sensitive fields can be masked or redacted by policy. Detail downloads and bulk exports should require separate authorization.
If the agent reuses permissions from an existing analytics system, verify that service accounts do not bypass those rules, and that organization changes, employee departures, and permission updates take effect in time. Caches must also be isolated by permission context so one user cannot reuse another user’s sensitive result.
5.2 Query execution needs resource and behavior limits
Production queries should prefer a read-only identity, with execution timeouts, row limits, concurrency limits, and cancellation. Requests that may scan a very large range can require extra filters or an approval step.
Writes, such as changing data or business configuration, should be designed separately from analytical queries, with stricter authorization and human confirmation. The fact that an agent can call a tool is not a reason to enable that tool by default.
5.3 Source display should include business context
A trustworthy answer is more than a number. It should at least state the metric name, statistical definition, time range, filters, data refresh time, and an execution-record identifier.
For a model-generated causal explanation, distinguish:
- Facts directly supported by the query result
- Explanations inferred from a change pattern
- Hypotheses that need more data
“This region had the largest decline” can be supported by a summary. “The decline was caused by stronger competition” needs other evidence. The system should make that difference in evidence explicit.
6. Result Checks: Technical Correctness and Business Reasonableness
Use several layers of checks, not only whether the query succeeded.
The first layer is semantic validation: the metric, dimensions, time range, and filters must have one clear interpretation. If “this quarter” could mean a calendar quarter or a fiscal quarter, ask the user first.
The second layer is plan validation: fields and objects exist, the combination is allowed, permissions are satisfied, and the calculation matches the business definition.
The third layer checks execution results: empty results, abnormal duplicates, missing groups, and clearly unreasonable values. If a ratio has a zero denominator, return an explicit status instead of a misleading percentage.
The fourth layer checks answer consistency: the text, charts, and result table must agree. Do not describe the largest decline as the lowest sales.
Reasonableness checks can only raise risk. They do not prove correctness. An unusual number may be a real business event. Users should be able to see the basis and continue the review.
7. Selection and Pilots: Judge Options with Reproducible Evidence
7.1 Set hard entry conditions first
Data boundaries, deployment constraints, permission coverage, audit capability, and how models are called should be entry conditions. If a hard requirement fails, interaction quality alone should not keep the option moving forward.
After entry, evaluate semantic governance, data-connection fit, operational complexity, ability to expand, and total cost.
7.2 Build a test set from business questions
The test set should cover common aggregations, cross-dimension comparisons, time comparisons, ambiguous questions, and unauthorized requests. Each question needs a reference definition, expected behavior, and an allowed margin of error.
Do not check numbers only. For an unauthorized request, the correct result is refusal. For an unclear definition, the correct result may be a request for clarification rather than an immediate answer.
Record separately:
- Whether intent and metric selection are correct
- Whether query results match the reference results
- Whether permission control works
- Whether ambiguous questions are clarified appropriately
- Whether sources are sufficient for review
- Whether query latency, failure rate, and resource use are acceptable
Besides end-to-end accuracy, keep stage-level results so errors can be located in understanding, semantic mapping, execution, or answer generation.
7.3 Expand scope according to risk
A pilot can start in one business domain with stable metrics, clear permissions, and clear value, using limited data views and question types, and running read-only.
After that validation, add data domains, users, and analytical depth. Any change to the model, semantic layer, permission rules, or data structure should trigger the relevant regression tests. Acceptance only at first launch is not enough.
8. Final Checks Before Go-Live
Before production, confirm the following:
- The data-flow diagram matches actual network behavior, and no unapproved external transfer was found.
- The mapping among user identity, service identity, and database identity is clear.
- Metric definitions, relationship rules, and time definitions have owners.
- Unauthorized access, prompt injection, abnormal queries, and cache isolation have been tested.
- Logs support audit without storing sensitive content without control.
- Changes to the model, semantic layer, and data sources have version records and a rollback path.
- The system can refuse requests it cannot execute and can say clearly when it is uncertain.
- When data, the model, or a query is unavailable or times out, the fallback message is clear.
Keeping data inside the domain means the enterprise can control where data is processed, who can access it, which rules calculate it, and how results are demonstrated. When choosing a solution, the useful question is not whether it carries an “agent” label. It is whether it connects the security boundary, business semantics, execution constraints, and the chain of evidence. Only when those foundations hold can conversational analysis move from a demonstration to a reliable enterprise service.
