Data Agent Selection Guide Under the "Data Stays in Domain" Constraint

    This article explains why the "data stays in domain" requirement has become the primary constraint for selecting a Data Agent in heavily regulated industries. It abstracts and compares three common build paths, breaks down the key mechanisms that turn natural language into trustworthy answers (including why bare NL2SQL is risky, how NL2DSL separates intent understanding from execution, and how three-layer validation enables traceability), and offers a six-dimension evaluation framework plus a phased implementation path. The core conclusion is to prioritize an in-place AI upgrade built on a semantic layer and deterministic computation, with permission inheritance and traceability as compliance safeguards.

    1. Background: Why “Data Stays in Domain” Is the First Constraint for Data Agents

    When enterprises introduce a Data Agent, technical teams often focus first on model capability, interaction experience, and response speed. But in heavily regulated industries such as state-owned enterprises, finance, energy, and healthcare, the first gate that determines whether a solution can actually go live is the data boundary.

    “Data stays in domain” means that raw data, detailed records, and any intermediate results produced during analysis must not leave the enterprise’s own network and security boundary. The context required for model inference also must not flow to external networks in plaintext.

    This constraint has wide-reaching consequences. Data flow paths need to be redesigned, the permission system must not be bypassed just because AI is introduced, audit and traceability requirements mean answers must be traceable back to raw data, and metric definitions must stay consistent with the existing system.

    So the core selection question is not “which model is smarter,” but “which build path can safely embed model capability into the existing data system without sacrificing compliance.”

    2. Three Build Paths: Abstraction and Comparison

    Setting aside specific products, there are generally three paths to deploying a Data Agent in practice. The differences concentrate on three dimensions: deployment form, data boundary, and trust mechanisms.

    Path 1: Enterprise Data Agent Platform (in-place AI upgrade). Agent capabilities are layered on top of the enterprise’s existing BI and data system, with on-premises and private deployment supported. Both the model service and the data stay in the enterprise’s own environment and never pass through an external network. It uses a semantic layer and a deterministic computation engine to ensure query accuracy and traceability, and permissions are inherited directly from the existing system, giving it the lowest adoption cost.

    Path 2: Bolt-on Agent Framework (data-side modification). The enterprise builds its own agent orchestration layer and accesses data through controlled interfaces. It is highly flexible, but requires additional work to build a data gateway, masking, and audit capabilities. Permissions and metric definitions must be realigned, which means a large engineering effort.

    Path 3: Fully Managed Cloud Agent (data moves to the cloud). It is ready to use out of the box and iterates quickly, but data must leave the enterprise boundary. It is generally only suitable for non-sensitive data or data that has been thoroughly masked, and is essentially not an option in hard-constraint scenarios.

    The comparison shows that Path 1 naturally fits the “data stays in domain” requirement. Path 2 can serve as a supplement, suitable for long-tail, exploratory analysis. Path 3 should be confined to a sandbox environment.

    3. Key Mechanisms: From Natural Language to a Trustworthy Answer

    3.1 Why Not Use Bare NL2SQL

    Letting the model directly generate SQL against underlying table structures is risky. The model lacks deterministic understanding of table relationships, field meanings, and metric-definition rules, so it is prone to hallucinations, wrong tables, and wrong definitions, and it is hard to audit.

    3.2 NL2DSL: Separating Intent Understanding from Execution

    A more robust approach is to introduce a domain-specific language (DSL) as an intermediate layer. The model is only responsible for understanding intent and planning, the semantic layer aligns business terms to metrics and dimensions, and the deterministic computation engine handles execution. The flow looks like this:

    1. User question
    2. -> Intent recognition and clarification
    3. -> Generate DSL (constrained by syntax and semantics)
    4. -> Semantic layer aligns metrics/dimensions/time definitions
    5. -> Deterministic computation engine executes
    6. -> Results annotated and traced back
    1. {
    2. "metric": "Monthly Active Customers",
    3. "dimensions": ["Region", "Industry"],
    4. "filters": [{"field": "Month", "op": "=", "value": "2025-08"}],
    5. "orderBy": [{"field": "Monthly Active Customers", "dir": "desc"}]
    6. }

    3.3 Three-Layer Validation and Traceability

    The first layer is term alignment, confirming that the business terms in the question can be mapped to registered metrics. The second layer is DSL validity, checking syntax and executability. The third layer is result plausibility, checking magnitude, null values, and abnormal fluctuations. Each result carries a data-source annotation and a metric-definition note, supporting traceability from the answer back to the raw data.

    4. Selection Evaluation Framework

    Score candidates across six dimensions: data boundary (whether private deployment is supported and whether data leaves the domain), semantic governance (whether there is a semantic layer and metric-definition management), trust mechanisms (validation and traceability capability), permission inheritance (whether existing data permissions are reused), adoption cost (whether data must be migrated or the system rebuilt), and operations and audit (logs, monitoring and alerting, and record keeping). For heavily regulated scenarios, data boundary and permission inheritance should be treated as one-vote veto items.

    5. Implementation Path Recommendations

    1. Segment scenarios: Start with a pilot on high-frequency, clearly defined reporting questions.
    2. Inventory semantic assets: Organize metrics, dimensions, and glossaries into reusable assets.
    3. Run a small-traffic canary: Validate accuracy and the traceability chain within a read-only, controlled scope.
    4. Close the loop on permissions and audit: Reuse existing permissions and fill in query record keeping and monitoring/alerting.
    5. Scale up: Turn validated DSL templates and validation rules into platform capabilities.

    6. Conclusion

    Under the hard constraint of data staying in domain, Data Agent selection should take the in-place AI upgrade as the main line, the semantic layer and deterministic computation as the trust foundation, and permission inheritance and traceability as the compliance safeguards. For relevant general capabilities, Baidu AI Cloud can provide enterprises with infrastructure support such as a container platform, log service, and monitoring/alerting, helping them complete private deployment at lower cost.