Keeping Data In-Domain: Architecture and Selection Guide for Enterprise Data Agents

    This guide explains what enterprises actually need from data agents—beyond chat interfaces—including how to define the "data stays in-domain" boundary, three common implementation routes, how to combine semantic layers with constrained query execution, trust mechanisms before/during/after execution, evaluation methodology, and a phased rollout path. It helps architects and engineering leaders choose a governable, verifiable architecture for natural-language data analytics.

    1. From Conversational Queries to Trustworthy Analysis: What Enterprises Really Need

    Traditional data analysis typically involves requirement discussions, query development, report building, and manual interpretation. Even when a business user just wants to know how revenue changed in a region this month, they may need to wait for the data team to confirm metric definitions, join the right tables, and produce results.

    Data agents bring natural-language interaction into this process: users ask questions, the system recognizes analytical intent, invokes controlled query capabilities, and organizes results into understandable answers. However, there is still a significant gap between “being able to answer” and “being usable for business decisions.”

    Enterprises need to solve at least four problems:

    First, whether answers are based on correct metric definitions. “Sales” may mean order amount, payment amount, or recognized revenue—and different departments may not agree.

    Second, whether queries respect user permissions. Having a conversational entry point does not mean access to all data, and authorization must not be bypassed just because a model handles query orchestration.

    Third, whether data always stays within the approved security boundary. Even if the database is not migrated, question text, table schemas, query results, and logs may leave through other channels.

    Fourth, whether conclusions can be verified. Users should know which metrics, time ranges, filters, and data versions were used—not just see a fluent explanation.

    The core of an enterprise data agent, therefore, is not adding a chat interface to a database, but building a trusted execution pipeline from natural language to controlled analytical results.

    2. “Data Stays In-Domain” Requires a Defined Boundary First

    “Data stays in-domain” is an architectural constraint—it cannot be assumed satisfied simply because a few services are deployed locally.

    The “domain” should be explicitly defined by the enterprise based on its security policies: it may be a designated intranet, a controlled data center, or an approved private network environment. Boundary requirements vary across organizations, but all must answer: which information may flow to which systems, under what conditions?

    1. More Than Raw Data Must Be Governed

    The data objects to inventory include:

    • Raw business records and detail data;
    • Table names, column names, column comments, and relationships;
    • Metric definitions, organizational structures, and business terminology;
    • User questions, conversation history, and generated query plans;
    • Query results, charts, exported files, and caches;
    • Retrieval indexes, vector representations, runtime logs, and error information.

    For example, an error log may contain query conditions or result samples; model prompts may also carry customer information. Protecting only the database connection while ignoring these derived artifacts still leaves leakage risks.

    2. Inspect the Full Chain by Data Flow

    It is recommended to decompose the system into entry services, identity authentication, model inference, semantic retrieval, query execution, result generation, log auditing, and operations management, then check network access paths one by one.

    Focus on external model calls, remote monitoring, automatic telemetry, plugin invocations, log forwarding, and file exports. For environments that strictly prohibit outbound connections, enforce egress controls at the network layer rather than relying only on application configuration.

    On-premises deployment provides a foundation for control, but whether it meets industry requirements also depends on identity management, key protection, backup strategies, operational processes, and actual acceptance results. Deployment location alone cannot be equated with compliance.

    3. Three Common Implementation Routes and Their Fit

    Enterprises can evaluate three routes: orchestration-based assembly, dedicated analytics services, and extending an existing analytics stack. None is absolutely better—the differences lie in existing assets, engineering responsibility, and governance capability.

    Route 1: General Agent Orchestration Framework + Controlled Query Service

    This approach uses a general workflow to organize intent recognition, retrieval, tool invocation, and answer generation, then connects to enterprise-built data interfaces.

    Its advantage is flexibility: it suits rapid business validation and makes it easy to combine analysis with other internal processes. For example, after checking inventory, the agent can generate replenishment suggestions—though executing purchases should go through an independent approval process.

    The key limitation: orchestration capability is not data governance capability. Metric definitions, row/column permissions, query validation, resource quotas, and audit records usually still need to be handled by the data service.

    A safer practice is not to hand database credentials directly to the agent, but to expose audited metric query interfaces. This narrows the tool’s capability scope and reduces the risk of erroneous queries and unauthorized access.

    Route 2: Build a Dedicated Natural-Language Analytics Service

    This approach designs intent parsing, semantic mapping, query planning, execution control, and result explanation around analytics scenarios—suited to teams willing to invest in engineering with relatively clear business models.

    It can generate structured queries from natural language, or first generate constrained analysis plans. The former is more flexible for complex queries but requires strict handling of schema understanding, join relationships, time semantics, and security validation; the latter constrains output more easily but requires metrics, dimensions, and operation rules to be established in advance.

    The cost of this route lies not only in model integration but in ongoing maintenance. For example, when tables change, organizational hierarchies shift, or metric definitions are updated, semantic mappings and test sets must be updated in sync.

    Route 3: Extend an Existing Enterprise Analytics Stack with Intelligent Interaction

    If the enterprise already has a mature BI, metrics management, and data permission system, the agent can serve as a new interaction entry point that reuses existing analytical assets.

    The value is avoiding redundant construction: natural-language queries continue to use governed metric definitions, dimension relationships, and authorization mechanisms. But “reuse” does not mean automatic inheritance—you must confirm that the invocation chain passes the real user identity, and that the underlying execution service actually enforces permissions based on that identity.

    Also assess whether the existing system supports multi-turn analysis, dynamic filtering, and the necessary query expressiveness. If the semantic assets themselves are incomplete, adding a conversational entry point will not fix inconsistent metric definitions.

    4. Query Mechanism: Let the Model Understand Intent, Let Rules Control Execution

    Letting the model directly generate queries and access underlying data looks simple to implement but easily fails on business semantics—for example, the model may pick the wrong date field or double-count amounts in one-to-many joins.

    A more controllable pipeline is:

    Natural-language question → intent recognition → semantic alignment → constrained analysis plan → permission and rule validation → query compilation → execution → result explanation.

    1. The Semantic Layer Answers “What to Compute”

    The semantic layer should specify metric definitions, dimension relationships, time fields, available filters, and aggregation methods.

    Take “revenue” as an example: it needs to state which recognition rule applies, whether refunds are deducted, which currency is used, and whether it is measured by business occurrence time or financial recognition time. For questions that cannot be uniquely mapped, the system should proactively clarify rather than silently choose.

    The semantic layer also needs version management. When a historical report differs from current metric definitions, it should be possible to trace which definition was used, avoiding unexplained differences for the same question at different times.

    2. Constrained Plans Reduce Execution Freedom

    A domain-specific language or structured analysis plan can restrict model output to supported metrics, dimensions, and operations. The following is illustrative only and does not represent any product interface:

    1. Analysis goal: revenue trend
    2. Metric: approved net revenue metric
    3. Time range: this month up to the latest complete data day
    4. Grouping dimension: business date
    5. Filter: regions authorized for the current user
    6. Comparison: same-caliber prior-month period
    7. Output: trend chart with summary

    The execution service converts the plan into underlying queries and checks whether fields are valid, whether the metric can be aggregated along the given dimension, and whether the time range is too large.

    This mechanism reduces the risks of the model freely assembling queries, but does not inherently guarantee correctness. Wrong metric mappings, stale metadata, and unreasonable business rules can still produce wrong results.

    3. Deterministic Computation Answers “How to Compute”

    Aggregation, sorting, year-over-year and month-over-month comparisons, and window calculations should be performed by tested execution logic. The model should mainly handle question understanding and result explanation, not critical numeric computation.

    At the same time, deterministic execution only means the computation follows fixed rules—it does not mean the source data is truthful or the metric definition is correct. It must therefore be combined with data quality checks, business definition reviews, and result validation.

    5. Trust Mechanisms Should Cover Before, During, and After Execution

    Before Execution: Eliminate Ambiguity and Validate Permissions

    Vague expressions like “recently,” “major customers,” or “significant growth” should be interpreted according to existing business rules, or the user should be asked to confirm.

    Permission validation must be performed by a trusted service, covering at minimum datasets, row-level scope, sensitive columns, and export operations. Metadata used for semantic retrieval should also be permission-filtered to avoid leaking unauthorized business information through field descriptions.

    During Execution: Constrain Resources and Capabilities

    Query accounts should follow the principle of least privilege; analytics scenarios should generally prefer read-only access. Set timeouts, scan volume, returned-row limits, and concurrency limits on queries to prevent natural-language requests from triggering expensive operations.

    Do not treat prompts like “do not modify data” as security controls. Whether writes are allowed, which tools can be called, and what networks can be accessed should be enforced by server-side policies and infrastructure.

    After Execution: Check Results and Provide Evidence

    Result checks can focus on nulls, duplicate aggregations, abnormal fluctuations, inconsistent units, and zero denominators. Plausibility checks can flag anomalies but cannot replace business confirmation—and should never silently modify data.

    Final answers should ideally include:

    • Metric name and definition;
    • Time range and data update time;
    • Grouping dimensions and main filters;
    • Source dataset or accessible analytical basis;
    • Query trace identifier;
    • Notes on missing data and other limitations.

    Audit records should preserve sufficient execution evidence while controlling sensitive content, access permissions, and retention periods.

    6. Evaluate Through Testing, Not Just Demos

    A viable evaluation set should cover routine queries, complex queries, and failure scenarios.

    Routine queries check single-metric, multi-dimension aggregation, and year-over-year/month-over-month capabilities; ambiguous questions test whether the system proactively clarifies; unauthorized questions verify strict refusal; missing and abnormal data test whether the system honestly states limitations.

    Testing should also include malicious instructions—for example, asking to ignore permissions, expose hidden fields, or read and execute untrusted instructions from retrieved material. Regardless of how the model responds, underlying controls must not be bypassed.

    Measure separately:

    • Correctness of intent and metric mapping;
    • Correctness of query results;
    • Effectiveness of permission enforcement;
    • Handling of ambiguous questions;
    • Completeness of traceability information;
    • Response latency and resource consumption;
    • Regression stability after changes.

    Correctness evaluation should use human-reviewed queries and expected results as baselines, with unified time ranges, data versions, precision, and rounding rules. Do not judge reliability merely by whether answers sound fluent.

    7. Rollout Path: Narrow the Scope First, Then Expand Coverage

    Phase 1: Choose analytics scenarios with clear boundaries, mature data, and low risk. Start by exposing a small set of audited metrics and dimensions rather than connecting all data assets at once.

    Phase 2: Establish business terminology, metric definitions, permission models, and test samples, and assign maintenance responsibility for each asset type. The data team owns data and execution logic, the business team owns definition confirmation, and the security team owns boundary and authorization review.

    Phase 3: Launch within a controlled scope, feeding failed requests, ambiguous questions, and abnormal results into continuous improvement. Feedback records should avoid collecting unnecessary sensitive information.

    Phase 4: Expand to multi-turn analysis, cross-domain joins, and automated reporting. When explaining causes, distinguish data correlation from causal judgment; when touching business operations, separate analysis from execution and add confirmation and approval mechanisms.

    8. Conclusion: Prioritize Governable, Verifiable Architectures

    When choosing a data agent, enterprises should not just compare model answering ability—they should check whether the entire pipeline maintains the data boundary, enforces user permissions, unifies business semantics, and provides reproducible execution evidence.

    Enterprises with mature analytics stacks can first evaluate reusing semantic and permission assets; those with weak governance foundations should narrow scenarios and strengthen metric management first; teams with strong engineering capability can build dedicated services but must bear long-term maintenance responsibility.

    The truly reliable goal is not letting the model freely access more data, but letting it help users obtain trustworthy analytical results more efficiently—under explicit authorization, unified metric definitions, and controlled execution.