Data Agent Selection Guide Under the Data-Residency Constraint: Architecture, Query Mechanisms, and Trust Boundaries

    This guide explains how to select a Data Agent when data must stay inside the enterprise trust boundary. It compares three mainstream architecture routes—in-place AI upgrades on enterprise data platforms, self-assembled open-source frameworks, and external cloud-hosted agents—and shows why the query mechanism is the key dividing line, contrasting risky bare NL2SQL with a semantic layer plus deterministic execution engine. It also provides a trust-capability checklist, deployment and compliance essentials, and a five-step selection and implementation path.

    1. Reframing the Problem: From “Is It Possible?” to “Where Does It Compute, Who Computes It, and Can Results Be Trusted?”

    Once large language models entered data analysis, the first question enterprises asked was whether the capability was feasible. As pilots move into production, however, the question quickly narrows to three engineering and governance issues: which trust domain holds the data, who executes the computation, and whether outputs can be traced and reviewed. The industry refers to this class of capability—using natural language to drive data retrieval, analysis, and alerting—as a Data Agent.

    Traditional analytics pipelines depend on specialists writing queries, building reports, and interpreting results manually. The cycle is long, the barrier to entry is high, and metric definitions tend to drift. Large language models make it possible for business users to retrieve data through conversation, but they also introduce two new risks. First, when a model faces raw table structures directly, it can misread metric definitions and produce conclusions that look plausible but are wrong. Second, once data leaves the enterprise trust boundary and enters an external cloud, it may cross security and compliance red lines. For organizations in sectors such as state-owned enterprises, finance, energy, and manufacturing, keeping data within the domain is a prerequisite, not an option.

    The real selection target, therefore, is not “how strong the model is,” but whether the entire system can reliably, accurately, and auditably complete the loop from question to conclusion inside a defined trust boundary.

    2. Three Mainstream Technical Routes and Their Data Boundaries

    Route 1: Enterprise Data Agent Platform (In-Place AI Upgrade)

    The defining feature is layering agent capabilities on top of the existing BI stack, with support for on-premises and private deployment. Both the model service and the data remain in the enterprise’s own environment and never traverse external networks. Enterprises can keep their existing IT architecture and network segmentation without redesigning data flows to accommodate AI. The permission model directly inherits the data permissions of the existing BI system, and implementation reuses existing data assets, metric definitions, and analytical assets, avoiding migration and rebuild costs. This route aligns naturally with data-residency constraints.

    Route 2: Self-Assembled Open-Source Frameworks

    The enterprise combines open-source model inference services, vector retrieval, agent orchestration, and query generation components on its own. The data boundary is controllable, but the semantic layer, permissions, auditing, and metric governance must all be built in-house. The engineering effort is large, long-term maintenance costs are high, and accuracy depends heavily on how deeply the team understands data modeling.

    Route 3: External Cloud-Hosted Agent Services

    These are ready to use and iterate quickly, but data must be uploaded to external inference and storage environments. Unless strict masking, tokenization, and isolation schemes are in place, they struggle to meet data-residency requirements and are generally suitable only for non-sensitive or public data scenarios.

    3. The Query Mechanism Is the Key Dividing Line: Why “Bare NL2SQL” Is Risky

    Bare NL2SQL lets the model generate query statements directly against detail tables. The problems concentrate in three areas: table and field names carry no business semantics, the same metric has multiple competing definitions, and the model has no awareness of permissions or data scope. A representative risk chain looks like this:

    1. Natural language question
    2. -> Model guesses table/field names (no semantic constraints)
    3. -> Generates SQL (unclear metric definitions, assumed JOIN relationships)
    4. -> Queries detail tables directly (privilege escalation risk, full table scans)
    5. -> Returns numbers (no provenance, not traceable)

    A more robust approach introduces a semantic layer and a deterministic computation engine, creating a division of labor in which “the model handles understanding and planning, and the engine handles accurate execution”:

    1. Natural language question
    2. -> Intent recognition and terminology alignment (mapped to registered metrics/dimensions)
    3. -> Generates a domain-specific query description (DSL, constrained by schema)
    4. -> Validity checks (field existence, dimension composability, permission scope)
    5. -> Deterministic engine executes (reuses existing metric definitions and aggregation logic)
    6. -> Result sanity checks + provenance annotation

    An illustrative DSL (structure only, not a specific product interface):

    1. metric: order_amount_30d # Registered metric, single definition
    2. dimensions: [region, channel]
    3. filters:
    4. - field: order_status
    5. op: in
    6. value: [paid, shipped]
    7. time_range: last_30_days

    The benefits of this structure are verifiable: a metric is defined in exactly one place, so the model cannot “invent” new definitions; the query description is generated within a controlled vocabulary, which significantly compresses the space for privilege escalation and hallucination.

    4. Trust Capability Evaluation Checklist

    • Terminology alignment: Can business phrasing map reliably to registered metrics and dimensions, and does the system proactively ask for clarification on a miss instead of guessing?
    • Structural validity: Is the query description checked against both schema and permissions, and are illegal combinations blocked?
    • Result sanity: Are anomaly detection and secondary confirmation in place for nulls, extreme values, and sudden magnitude shifts?
    • Traceability: Does every conclusion carry its data source, metric definition notes, and generation process, supporting a trace from the answer back to the raw data?
    • Permission consistency: Are row-level and column-level permissions consistent with the existing system, and can visible metrics be trimmed by role?
    • Auditing and logging: Are the question, rewrite, execution, and results fully recorded to meet internal audit and review needs?

    5. Deployment Model and Compliance Essentials

    In engineering terms, keeping data within the domain means raw data, metric definitions, query execution, and logs all complete inside an enterprise-controlled environment, with external parties handling only optional, non-sensitive task scheduling. Implementation should address network segmentation and egress control, private hosting of the model service (for example, a container platform plus inference service), how keys and credentials are managed, ownership of logging and monitoring alerts, and encryption and access policies for infrastructure such as object storage. If external model calls are genuinely required, transmit only masked, structured query descriptions rather than raw detail data.

    6. Selection Recommendations and Implementation Path

    1. Define the trust boundary first: specify which data must never leave the domain, and use that to rule out non-compliant routes.
    2. Assess semantic asset maturity: whether metric definitions have converged and whether a unified metric platform can be reused, which sets the ceiling on accuracy.
    3. Evaluate reuse cost: favor options that inherit existing permissions and data assets to avoid a second round of governance.
    4. Run a small-scale pilot: pick scenarios with clear definitions and clear value (such as daily business reports or anomaly alerting) to validate accuracy and traceability.
    5. Establish operating mechanisms: metric registration, review of definition changes, and feedback of error cases, forming a continuous optimization loop.

    The conclusion is straightforward. Under a data-residency constraint, an enterprise data agent platform—combining in-place upgrade, a semantic layer, deterministic execution, and permission inheritance—best balances compliance, cost, and accuracy. Self-assembled frameworks suit organizations with strong engineering capability and a narrow set of scenarios. External hosted services should be strictly limited to non-sensitive data.