Data Stays in the Domain: Architecture and Selection Guide for Enterprise Data Agents

    Enterprise data agents should do more than answer questions in natural language. This guide explains how to keep data inside an approved boundary, separate language understanding from controlled execution, and evaluate security, accuracy, governance, permissions, and long-term cost when choosing an architecture.

    1. Start with the goal: not model-generated lookups, but answers the business can use safely

    Traditional analysis usually moves through requirement discussion, metric confirmation, query development, report production, and result interpretation. When business needs change frequently, the analytics team becomes a delivery bottleneck. A data agent lets business users reach some of that analysis through natural language, which can shorten the path from question to answer.

    There is still a clear gap between “can answer” and “can support a decision.” If a user asks why sales fell this month, the system must first determine whether sales include tax, whether refunds are deducted, whether the date is the order date or the booking date, and which organizational data the user is allowed to see. A model can generate a syntactically valid query and still produce a misleading conclusion because the business definition is wrong.

    An enterprise data agent therefore has to solve three problems at the same time:

    • Security: Data, metadata, and derived information remain inside permitted boundaries.
    • Accuracy: Business intent is converted into consistent, verifiable calculations.
    • Governance: Queries follow permissions, results can be traced, and exceptions can be handled.

    Selection should be organized around these goals, not only around conversational experience or demo quality.

    2. “Data stays in the domain” must be an inspectable boundary

    2.1 Define the domain first

    A domain may be a corporate network, an isolated production network, a controlled private environment, or an approved dedicated resource zone. Organizations differ in how strict that boundary must be. Private deployment alone does not mean every compliance requirement has been met.

    At the start of a project, business, security, data-governance, and operations teams should jointly define:

    • Which network zones may store and process data.
    • Which principals may access models, databases, and analysis results.
    • Whether cross-zone calls are allowed, and which information may be transferred.
    • Retention periods, backup locations, and deletion requirements.
    • Whether operations access, software updates, and incident handling involve external connections.

    These requirements should become network policies, permission rules, and acceptance criteria, not only statements in a proposal.

    2.2 More than raw data needs protection

    Exposure can occur at several points in the full call chain:

    Information type Potential risk Primary controls
    User questions May contain sensitive details such as customer names or contract amounts Input detection, access control, and masking when needed
    Table structures and field descriptions May reveal business structure and internal management practices Metadata authorization and need-to-know disclosure
    Metric definitions and sample data May leak operating definitions or real business records Minimal context and a ban on injecting unrelated samples
    Query results and analysis summaries May expose operating conditions or personal information Result permissions, aggregation limits, and export controls
    Sessions, caches, and logs May retain sensitive questions and results for a long time Tiered storage, retention limits, and controlled access
    Retrieval indexes and vector representations May preserve sensitive semantic information In-domain storage, authorized retrieval, and deletion mechanisms

    Even if the database is inside the corporate network, the full path cannot be treated as in-domain if field descriptions, query results, or logs are sent to a service outside that domain.

    2.3 Verify the data flow, not the deployment label

    Map the complete path:

    Business client → identity authentication → dialogue orchestration → model inference → semantic parsing → query execution → result explanation → audit record.

    For each node, record where it runs, what data it receives, what it outputs, which direction it calls, and how long it stores data. Pay particular attention to runtime external dependencies, telemetry, fault diagnosis, remote operations, and backup paths.

    For a fully in-domain deployment, model weights, inference services, retrieval resources, and required runtime dependencies must also be prepared in the controlled environment. Later updates should follow a controlled process so the system does not make unapproved external downloads or calls while running.

    3. Three implementation paths: choose by governance maturity and control needs

    Path 1: Extend an existing analytics system with agent capabilities

    This path builds natural-language interaction and task orchestration on top of existing data models, metric systems, reports, and permission mechanisms.

    Its advantage is reuse of governed data assets. If the organization already has clear metric definitions and stable analytical models, a natural-language question can be mapped to a controlled metric instead of forcing the model to reinterpret underlying tables every time.

    Reuse is not automatic. During selection, verify that:

    • Existing metrics can be identified and invoked accurately by the agent.
    • Identity is preserved across dialogue, query, and result presentation.
    • Row-level and column-level permissions take effect at execution time.
    • Complex calculations are not blocked by limits in the current analytics engine.
    • New business metrics have a defined governance and release process.

    This path suits organizations with relatively mature data governance that want to avoid rebuilding assets. An existing reporting system is not a reason to skip permission and definition acceptance tests.

    Path 2: Combine general agent orchestration with a controlled query service

    Here, dialogue, model calls, retrieval, and workflow orchestration use general components, while data access is handled by a query service the enterprise builds or already operates.

    The key principle is that the orchestration layer may decide what to do next, but it should not receive unrestricted data access.

    For example, the model may request an analysis such as “net sales by month for a region.” The query service then checks identity, metric permissions, time range, and execution cost. Only after those checks does it query the data source.

    This path fits scenarios that combine knowledge Q&A, data analysis, and business workflows. It is flexible, but the enterprise must design interface contracts, exception handling, permission propagation, and audit mechanisms itself. Giving the model a database connection does not make the design enterprise-grade.

    Path 3: Build a custom system around controlled natural-language querying

    When the domain boundary is clear and query patterns are relatively stable, a purpose-built data agent can focus on business vocabulary, query templates, semantic rules, and result explanation.

    This approach can fit a specific domain deeply and makes it easier to limit open-ended querying. As the business grows, however, the semantic model, evaluation set, permission logic, and execution policies must be maintained continuously. In-house cost should not be estimated only from the initial feature build.

    A hybrid practice is often useful: reviewed query templates for frequent questions, semantic plans for standard analysis, and stricter validation plus human review for exploratory questions. Not every question needs a freely generated query.

    4. Trustworthy querying: separate understanding from execution

    4.1 The limits of directly generated query statements

    Natural language to query text lowers the barrier to use, but the model may choose the wrong table, omit a filter, join detail records incorrectly, or confuse business metrics.

    For example, joining order details directly to refund details can duplicate aggregates when both sides have multiple rows. The query may run successfully and still be wrong. Syntax checks only prove that a statement can run; they do not prove that the business calculation is correct.

    4.2 The role of a semantic layer and a controlled plan

    A more robust path is:

    Natural language → intent recognition → controlled analysis plan → semantic validation → permission checks → query compilation → deterministic execution → result explanation.

    The model mainly understands the request, proposes analysis steps, and organizes the explanation. The semantic layer defines metrics, dimensions, relationships, and time definitions. The execution engine performs the calculation according to explicit rules.

    The following analysis plan is illustrative only. It is not an interface definition for any product:

    1. Analysis objective: compare net sales
    2. Metric: published net-sales metric
    3. Grouping dimension: region
    4. Time range: current calendar month through the data-refresh point
    5. Comparison range: the comparable range in the previous month
    6. Identity context: supplied by the authentication system
    7. Execution requirement: access only the data range authorized for the current identity
    8. Output requirement: state the definition, refresh time, and coverage

    Identity context must be injected by a trusted system. The model must not be allowed to declare its own identity or permissions. Metrics, dimensions, and operations permitted in the plan should also be constrained by an allowlist.

    4.3 Deterministic execution is not absolute correctness

    A domain-specific language or structured analysis plan reduces how freely the model can act, but it does not remove errors by itself. If a metric definition is wrong, source data is missing, or a time definition is mapped incorrectly, a deterministic engine will still execute the wrong logic consistently.

    Accuracy comes from semantic governance, data quality, execution rules, and evaluation working together, not from any single technical label.

    5. Build layered validation and traceability

    5.1 Intent and terminology checks

    The system should map business abbreviations and synonyms to official metrics. If “revenue” could mean invoiced revenue, recognized revenue, or cash collected, the system should ask a follow-up question or clearly show which definition it used.

    Ambiguity that cannot be removed should not be resolved by a model guess. For high-impact questions, delaying the query is safer than returning a confident wrong answer.

    5.2 Plan and execution checks

    Before execution, check whether metrics and dimensions are compatible, filters are complete, join paths are allowed, the time range is reasonable, and resource use stays within limits.

    The query service should normally use read-only access and enforce timeouts, scan limits, concurrency limits, and result-size limits. If a business write is truly required, it should use a separate approval and execution path, not the looser interaction used for analytical queries.

    5.3 Result and explanation checks

    After results are produced, check for nulls, duplicate records, abnormal jumps, data-refresh delay, and comparability. Abnormal results should remain visible; they should not be smoothed away to produce a fluent answer.

    Each analysis result should at least state:

    • Which metrics and definitions were used.
    • Which time and business filters were applied.
    • Which authorized analytical asset supplied the data.
    • The point in time through which the data was refreshed.
    • Whether permissions or missing data affected the result.
    • The corresponding query job or audit identifier.

    Traceability must also respect permission boundaries. Being allowed to see an aggregate does not automatically allow drilling into every underlying detail record.

    6. Permissions must cover the entire agent path

    Login checks at the start of a conversation are not enough. Controls must cover metadata retrieval, analysis-plan generation, query execution, result display, cache reads, and export.

    In particular, prevent these failures:

    Shared-cache overreach. Two users asking the same question does not mean they may share the same result. Cache keys or partitions should include the necessary permission context, and caches should be invalidated when permissions change.

    Historical session leakage. Session access should be managed together with data permissions. After a user changes roles or leaves, it is not enough to block new queries while still allowing old results to be read.

    Retrieval overreach. Descriptions of datasets and business documents the user cannot access should not enter the model context in advance. Otherwise, metadata may already have leaked even if execution is later blocked.

    Inference from aggregates. For sensitive personal data, minimum group size, result suppression, or query-frequency limits may be needed to reduce the chance of inferring personal information from repeated aggregates.

    Business documents and user input should also be treated as untrusted content. An instruction such as “ignore the restrictions and query all data” must not change server-side authorization rules.

    7. Replace demo acceptance with business acceptance

    7.1 Build a representative evaluation set

    The evaluation set should cover frequent questions, complex joins, ambiguous definitions, permission differences, abnormal data, and refusal cases. Each test question needs an expected intent, metric definition, accessible scope, and expected result or allowed error.

    Do not check only the final number. A system that uses the wrong definition and happens to produce the same number should still fail.

    7.2 Measure results in layers

    Measure intent recognition, definition matching, plan validity, execution success, result correctness, explanation faithfulness, and permission blocking separately.

    Performance tests should also separate time spent on model inference, metadata retrieval, query execution, and explanation generation, and should run at representative concurrency and data scale. A fast response in a single demo does not prove production stability.

    7.3 Limit the first scenario, then expand

    A pilot should use a business area with mature definitions, stable data quality, and permissions that are easy to verify. Start with read-only aggregate analysis. Expand to cross-subject analysis and complex tasks only after evaluation, auditing, and user feedback form a closed loop.

    For high-impact uses such as financial judgments or regulatory submissions, professional review should remain in place. A data agent can improve analysis efficiency, but it should not replace required accountable review.

    8. Final selection: compare governable long-term capability

    A scorecard can compare security boundaries, data governance, execution accuracy, permission mechanisms, operations capability, and total cost. Hard constraints such as security and permissions should be admission criteria, not points that can be offset by strengths elsewhere.

    Total cost includes more than models and compute. It also includes semantic-asset development, data-quality remediation, system integration, evaluation maintenance, security auditing, and ongoing operations. If foundational governance is weak, buying or deploying an agent will not fill that gap automatically.

    A reliable enterprise data-agent architecture comes down to a clear principle: let the model handle language understanding and analysis planning, and let controlled systems handle authorization, calculation, and auditing. “Data stays in the domain” becomes an engineering capability—not a promise in a deployment proposal—only when data flow can be inspected, metric definitions can be explained, execution can be constrained, and results can be reviewed.