Data Non-Exfiltration: Architecture and Selection Guide for Enterprise Data Agents
This guide explores the architecture and selection criteria for enterprise data agents, focusing on how to ensure secure, accurate, and controllable data usage. It covers defining data boundaries, comparing implementation paths, designing trusted architectures, enforcing execution-side security, and implementing phased deployment strategies to transform natural language analytics into reliable enterprise services.
I. From “Conversational Data Querying” to “Secure and Accurate Data Usage”
A Data Agent is a system that assists users in completing data queries, metric explanations, and analysis through natural language understanding, task planning, and controlled tool invocation. Its value lies not in simply replacing query interfaces, but in lowering the barrier for business personnel to use data while incorporating the analysis process into the enterprise’s existing governance framework.
Traditional analysis typically requires business personnel to submit requirements, followed by technical personnel confirming specifications, writing queries, and generating reports. Natural language interaction can shorten this chain, but it also introduces new uncertainties: the same business term may correspond to different metrics, model-generated queries may associate incorrect data tables, and analytical conclusions may confuse facts with speculations.
Therefore, when evaluating a data agent, enterprises should first answer three questions:
- Where is data processed? Will user questions, metadata, query results, and runtime logs leave the defined boundaries?
- Who has the authority to execute queries? Does the agent always use the current user’s permissions rather than a shared high-privilege account?
- How are results verified? Can the answers be mapped to explicit metric definitions, execution records, and data versions?
For organizations with high security requirements, these questions determine whether the system is ready for deployment, rather than being optimizations to be added post-launch.
II. Defining “Data Non-Exfiltration”: Define Boundaries Before Discussing Deployment
“Data non-exfiltration” is not a single technical feature, but a set of constraints that require continuous verification. Enterprises should clarify whether the “domain” refers to the enterprise intranet, a dedicated network, a specific geographic region, or an approved controlled computing environment.
1. Data Boundaries Include More Than Raw Business Tables
Objects that need to be included in boundary management encompass at least:
- Raw details, aggregated metrics, and query results;
- Metadata such as table structures, field descriptions, and metric formulas;
- User questions, session history, and model prompt context;
- Retrieval indices, caches, temporary files, and intermediate task results;
- Runtime logs, exception stacks, audit records, and backups.
For example, even if raw data is not uploaded, sending customer field names, business metrics, and query samples to an external inference service may still violate enterprise data management requirements. Desensitization and encryption can mitigate some risks, but they cannot automatically prove that data has not left the domain.
2. Private Deployment Does Not Automatically Meet Boundary Requirements
Deploying an application on the intranet only indicates the application’s location. Model inference, document parsing, identity verification, runtime monitoring, software updates, or fault diagnostics may still rely on external services.
Therefore, a complete data flow diagram must be drawn to inspect the inputs, outputs, and network access paths of each component. For scenarios strictly prohibiting external connections, related pipelines such as model inference, retrieval, execution, logging, and backup should reside within the approved environment, and non-essential outbound traffic should be restricted via network policies.
3. Non-Exfiltration and Access Security Must Be Built Separately
Keeping data within the enterprise does not mean all employees have the right to view it. Cross-departmental unauthorized access, sensitive field leakage, bulk export, and privilege bypassing can still occur on the intranet.
The complete objective should be: data does not cross defined boundaries, operations do not exceed authorized scopes, and execution processes can be audited.
III. Three Implementation Paths: Comparing Engineering Capabilities, Not Product Labels
Enterprises implementing data agents can generally summarize three paths. They are not mutually exclusive, and actual systems may combine them.
| Path | Core Approach | Suitable Scenarios | Main Challenges |
|---|---|---|---|
| General Agent Orchestration | Combining models, knowledge retrieval, workflows, and data tools | Quick requirement validation, relatively simple processes | Needs to supplement permissions, semantic governance, and execution control |
| Custom Data Agent Service | Independently implementing intent parsing, query planning, execution, and auditing | Complex scenarios, mature engineering teams | High construction and long-term maintenance costs |
| Extension of Existing Analytics System | Reusing metrics, dimensions, permissions, and analytical assets | Already possessing relatively mature data governance foundations | Affected by existing semantic asset quality and interface capabilities |
1. General Orchestration Path: Suitable for Validation, Not Direct Connection to Core Data by Default
This path can quickly set up a “user question - tool query - model explanation” pipeline, suitable for validating business requirements and interaction methods.
However, general orchestration capability does not equate to enterprise data governance capability. Technical teams still need to implement identity propagation, query restrictions, metric mapping, sensitive data handling, and auditing. If the model directly uses a high-privilege database connection, the pilot may succeed quickly, but official deployment will easily encounter permission and security issues.
A more prudent approach is to have the orchestration layer call controlled data services, rather than directly exposing the entire underlying data structure.
2. Custom Path: High Controllability, But Concentrated Responsibility
Custom solutions can be designed for complex business relationships, multiple data sources, and specific security requirements. However, costs stem not only from model integration but also from continuous data governance efforts.
Enterprises need to maintain metric definitions, permission rules, query security checks, evaluation samples, and exception handling mechanisms over the long term. When business specifications change, semantic configurations and test cases must be updated synchronously. Otherwise, even if the system runs stably, it may continuously output results with incorrect specifications.
This path is more suitable for organizations with stable data engineering, security, and application development teams.
3. Existing Analytics Extension Path: Reuse Assets, But Verify Actual Inheritance
If an enterprise has built a relatively mature business intelligence system, it can add a natural language entry point on top of existing metrics, dimensions, and data permissions, reducing duplicate governance.
However, “reuse” should not only rely on architectural descriptions; it requires verification: whether user identity runs through the execution chain, whether row/column-level permissions are actually effective, whether historical metric definitions are complete, and whether caches are isolated by permissions. When existing asset quality is insufficient, a natural language entry point will not automatically fix underlying issues but may instead amplify specification ambiguities.
IV. Trusted Architecture: Let Models Understand, Let Controlled Systems Execute
A relatively robust architecture is to separate model understanding from data execution:
User Question↓Identity Authentication and Session Binding↓Business Term Recognition, Ambiguity Clarification↓Generate Restricted Query Plan↓Semantic Validation, Permission Check, Cost Control↓Controlled Execution Service↓Result Validation and Evidence Consolidation↓Natural Language Answer
The model can propose a query plan, but should not have the final authorization decision. Access scope, metric legality, and resource limits should be controlled by auditable rules and execution components.
1. Difference Between NL to SQL and NL to Domain Expression
Natural Language to SQL (NL2SQL) typically generates database queries directly, offering high flexibility, but requires the model to understand table structures, join relationships, and business specifications. The risk of errors increases when table names are similar, join relationships are complex, or metric definitions are implicit.
Natural Language to Domain-Specific Language (NL2DSL) first represents the question as metrics, dimensions, filter conditions, and time ranges, and then converts it into actual queries via a semantic layer. It reduces the model’s ability to arbitrarily manipulate underlying structures, but its effectiveness relies on the quality of the semantic layer and does not inherently guarantee correct answers.
Below is a query plan illustrating the structure:
Analysis Target: Regional Sales TrendMetric: Net SalesDimension: Region, MonthTime Range: Last three complete calendar monthsFilter Condition: Order status is completedPermission Context: Bound to current user by server-side
Here, “Net Sales” should be linked to an approved formula, not temporarily inferred by the model. The permission context should also come from a trusted identity system, not determined by user input or model output.
2. Semantic Layer Should Clarify Business Definitions
An executable metric definition needs to include the calculation formula, statistical granularity, time field, filter conditions, and applicable scope.
For example, “Customer Count” might refer to registered customers, paying customers, or active customers; “Revenue This Month” might be calculated by order date, confirmation date, or payment date. For questions that cannot be uniquely interpreted, the system should proactively ask for clarification rather than defaulting to one specification.
The semantic layer should also manage metric versions and effective dates so that historical analysis can reproduce the definitions used at that time.
3. Deterministic Execution Does Not Mean Business Conclusions Are Inevitably Correct
The significance of deterministic computation is that under the same data, rules, and execution conditions, the calculation results can be reproduced. However, if there are issues with metric definitions, data quality, or join relationships, the system will still stably produce incorrect results.
Therefore, trustworthiness must simultaneously rely on data quality, business semantics, execution correctness, and conclusion constraints, rather than being attributed to a single technical path.
V. Permissions and Security: Constraints Must Fall on the Execution Side
1. User Permissions Should Run Through the Entire Chain
Every time the agent invokes a data tool, it should bind to the current user or an authorized service identity. It cannot query the full result set first and then require the model to “only display the allowed parts.”
Row-level, column-level, and metric-level restrictions should take effect at the data service or execution layer. For sensitive scenarios, the inference risk of aggregated results should also be checked, such as indirectly identifying personal information through extremely small groups.
2. Query Capabilities Follow Least Privilege
Data querying scenarios are typically dominated by read-only access. The execution layer should restrict accessible objects, returned rows, query time, concurrency limits, and export scope to prevent a single natural language request from triggering high-cost scans.
If business operations genuinely require writes, an independent operational pipeline should be established, incorporating manual confirmation, approval, idempotency control, and rollback mechanisms. It should not share permissions with standard analytical queries.
3. Treat Retrieved Content as Data, Not Instructions
Field comments, knowledge documents, and database texts may contain malicious or misleading content. The model should not change tool invocation rules just because phrases like “ignore permissions” appear in the retrieved results.
The system should separate control instructions from retrieved content and re-check authorization at the execution end. Prompt constraints can only serve as auxiliary restrictions, not as a replacement for the permission system.
4. Cache, Logs, and Sessions Also Need Isolation
Cache keys should consider user identity, permission scope, query conditions, and data versions to prevent low-privilege users from reusing high-privilege results. Logs should be recorded as needed, undergo sensitive information processing, and have access permissions and retention periods set.
In multi-turn sessions, when user permissions change, accounts switch, or sessions time out, the access scope should be re-verified.
VI. Trusted Answers Require Evidence, Not Just Fluent Text
Enterprise data answers should at least explain:
- The metrics used and their specifications;
- Time range, filter conditions, and statistical granularity;
- Data update time and source;
- Query tracking ID or traceable records;
- Limitations such as missing data or specification ambiguities.
Simultaneously, it is necessary to distinguish three types of content:
Calculated facts come from controlled queries, e.g., a certain metric decreased compared to the previous period. Correlation observations come from data comparisons, e.g., the decline is mainly concentrated in certain regions. Causal inferences require additional evidence; one cannot conclude that a specific business measure caused the result solely based on trend changes.
A defensive line can be formed through pre-execution semantic validation, in-execution permission and resource checks, and post-execution reasonableness validation. Reasonableness checks can detect some anomalies, but cannot be described as a guarantee for the correctness of all answers.
VII. Selection and Acceptance: Validate System Boundaries with Real Tasks
Selection should not merely compare natural language demonstration effects. Enterprises should prepare test sets from real business operations and focus on evaluating the following aspects.
1. Security and Deployment
Verify component lists, external dependencies, data flows, log locations, and backup paths. For strict non-exfiltration scenarios, verify whether the core business pipeline can still run after disconnecting from external networks.
2. Business Semantics and Permissions
Test synonyms, ambiguous time expressions, and combinations of multiple metrics, as well as the result differences when different roles ask the same question. Permission testing should cover both normal denials and paths like multi-turn follow-ups, cache hits, and exports.
3. Accuracy and Traceability
Establish reference queries and expected results for typical questions, and separately measure intent parsing, query execution, result consistency, and evidence integrity. For questions with ambiguities or insufficient evidence, correct clarifications and reasonable refusals should be included in acceptance criteria, rather than solely pursuing a high answer rate.
4. Cost and Operations
Evaluate the overall costs of model inference, data querying, semantic governance, and daily operations. Concurrently, verify handling strategies for timeouts, unavailable data sources, and model service exceptions, as well as regression testing capabilities after metric updates.
VIII. Phased Implementation, Avoid Opening All Data at Once
Phase 1: Choose a pilot with clear boundaries: stable metric specifications, limited data sources, primarily read-only analysis, and business personnel who can confirm results.
Phase 2: Complete production governance: unify identity authentication, permission propagation, auditing, semantic version management, exception handling, and evaluation processes.
Phase 3: Extend to cross-theme analysis, scheduled reports, and assisted anomaly analysis. When business actions are involved, establish independent authorization and approval mechanisms; do not grant operational permissions simply because data querying is accurate.
Overall, selecting a data agent is not about choosing an entry point that is better at conversation, but about choosing an engineering system that can continuously prove data boundaries, execution permissions, and result evidence. Only by defining “non-exfiltration” first, and then verifying semantics, permissions, and execution chains, can natural language analytics be transformed from a demonstration capability into a reliable enterprise service.
