Data Agents Without Data Egress: Architecture, Query Design, and Selection Guide

    This article explains how to build and evaluate Data Agents when enterprise data cannot leave its controlled boundary. It covers the risks of direct NL2SQL, the role of a semantic layer and NL2DSL, three common deployment routes, query validation, permissions, auditability, and a practical selection and rollout checklist.

    Data Agents connect natural-language interaction with enterprise data assets, allowing business users to avoid writing SQL first, waiting for reports, and then interpreting results manually. The capability itself is no longer scarce. What blocks production adoption is three questions: where data resides, who executes queries, and whether results are explainable, traceable, and auditable. For regulated organizations such as financial institutions, energy companies, manufacturers, and large enterprises, keeping data inside the controlled domain is a precondition, not an optimization.

    Traditional analytics depends on specialists to model data and align definitions, which is slow and has a high threshold. Large language models make conversational data access possible, but they also introduce new risks. If a model generates statements directly against physical schemas, definitions can drift, fields can be misused, and aggregations can fail. If detail rows or samples are uploaded to an external environment, security and compliance red lines may be crossed. Therefore, a Data Agent must support private or intranet deployment of compute and model services, must not bypass existing permissions, and must trace answers back to metric definitions and data sources.

    Why “no data egress” reshapes the technical route

    No data egress means model weights, prompts, intermediate results, detail data, and logs must stay within the enterprise-controlled boundary. Common constraints include no public internet egress, only approved model gateways, full-chain auditing, and centralized control of keys and masking policies by the security team. This directly rules out the practice of sending schema information to a public chat interface and taking back SQL.

    The risks can be divided into three categories. The data plane: connection strings, sample rows, and error stacks may leak. The semantic plane: the same “revenue” may be defined differently across departments, and a model that is not aligned with the semantic layer will produce numbers that look reasonable but are wrong for the business. The execution plane: generative SQL may scan entire tables, cross permission boundaries, or write destructive statements. Enterprise-grade solutions usually separate “understanding intent” from “deterministic execution”: the model handles planning, while the semantic layer and compute engine handle execution.

    Three build routes and their boundaries

    Current implementations broadly follow three routes, with clear differences in deployment form, data boundary, and trust mechanisms.

    The first is an enterprise data agent platform that emphasizes in-place intelligence on top of an existing analytics system. It uses local or private deployment, and neither models nor data leave the enterprise network. Queries do not use raw NL2SQL. Instead, natural language is translated into a domain-specific language (NL2DSL), aligning metrics, dimensions, filters, and time definitions first, and then a deterministic engine computes the result. The value is that the model does not directly touch physical tables, so hallucination is limited to the intent-understanding layer. The execution layer can validate DSL legality, permissions, and result sanity. Permissions can inherit existing row- and column-level rules from the analytics platform, and metric and report assets can be reused, avoiding database migration or rebuilding definitions just to introduce an agent.

    The second is general orchestration and workflow: connecting dialogue, retrieval, and tool calls into a chain. It is flexible and quick to start, and suitable for experiments. If the semantic layer, permission proxy, and auditing are not completed, it can easily slide toward “the model connecting directly to the database.” In no-egress scenarios, organizations must build their own gateway, masking, allowlisted tools, and human review; otherwise, flexibility becomes an uncontrolled surface.

    The third is a cloud-based analytics-as-a-service assistant. It may be sufficient for internet businesses, but for heavily regulated industries, any detail or schema egress makes it unacceptable. Even with a private network, organizations still need to evaluate log retention, whether model training uses customer data, and cross-border or subcontracting risks. During selection, residency attestation, independent deployment capability, and audit export should be treated as hard requirements, not optional items in a feature list.

    Query mechanisms: NL2SQL and NL2DSL

    NL2SQL maps a user question to a database dialect. Its advantage is a short path; its disadvantage is that the model must understand the physical model, legacy baggage, and implicit business rules. With nonstandard table names, slowly changing dimensions, and multi-fact table joins, the error rate rises noticeably. Even with constraints such as read-only access, LIMIT, and no DDL, semantic errors are still difficult for syntax checks to detect.

    NL2DSL compiles the question into a controlled metric language: metrics, dimensions, filters, time macros, period-over-period and year-over-year comparisons are all first-class citizens. The semantic layer predefines whether sales revenue includes tax, whether internal transactions are excluded, and the default statistical granularity. The model outputs structured intent, and the engine computes according to published definitions. A typical three-layer validation includes terminology and synonym alignment, DSL syntax and permission legality, and result magnitude and null-value sanity. Each answer should include the data source, metric definition, and filter conditions, and support drilling from the number back to detail rows or aggregate tables. This is not a presentation trick; it is the basis for auditing and accountability.

    An illustrative flow is as follows:

    1. User question
    2. -> Intent parsing (entities, time, comparison, drill-down)
    3. -> Semantic alignment (metrics/dimensions/permission scope)
    4. -> DSL generation and static validation
    5. -> Deterministic engine execution (read-only, quotas, timeouts)
    6. -> Result explanation (definition, source, confidence notes)

    From an engineering perspective, metric lineage, versioned releases, and canary rollout can also be added. Definition changes must be rollback-capable, avoiding a situation where the conversational side shows one number today and another tomorrow.

    Deployment, permissions, and trust

    For deployment, intranet or private deployment should be preferred: inference services, vector retrieval, metadata services, and the compute engine should reside in the same security domain. Object storage, message queues, container platforms, logging, monitoring, and alerting can reuse the enterprise’s existing foundation, so there is no need to open public internet access specifically for the agent. Models can use approved local inference or dedicated instances, and prompts and session logs should be retained according to cybersecurity classification requirements and industry regulations.

    For permissions, the agent must query with the user’s identity, not with a single service account. Row-level and column-level controls, sensitive-field masking, and export approval should be consistent with the existing analytics system, avoiding a situation where data is invisible in reports but queryable through chat. For high-risk metrics, secondary confirmation can be required, or only trends can be returned without absolute values.

    For trust, beyond three-layer validation, the system should enforce the ability to refuse an answer: when semantics do not align, permissions are insufficient, or data is stale, it should clearly state the reason rather than invent numbers. For management cockpit questions, queries can be fixed to published metrics. For exploratory questions, results should be labeled as exploratory and not yet reviewed for definition alignment.

    Selection advice and rollout steps

    First, list hard constraints: whether physical no-egress is mandatory, whether a dedicated cloud is allowed, whether logs may leave the jurisdiction, and whether metric-only access without detail rows is acceptable. Then examine asset reuse: whether a metric dictionary, semantic layer, and permission model already exist. If analytics assets are relatively complete, platform-based in-place upgrading usually has a lower total cost of ownership. If the organization is still in a siloed reporting stage, it should govern definitions before adding conversational access; otherwise, the agent will amplify errors.

    The evaluation checklist can include: whether private and intranet deployment is complete; whether queries go through the semantic layer rather than connecting directly to arbitrary tables; whether existing permissions are inherited; whether results include source and definition; whether quotas, timeouts, read-only access, and auditing are available; and whether the existing data warehouse can be connected without data migration. Pilots should start with high-frequency business metrics with clear definitions, use a golden question set for regression, and include “correct, fast, and explainable” in acceptance rather than only judging whether the demo is fluent.

    For development and data teams, a Data Agent should be treated as an interaction plane for analytics, not a backdoor around governance. Prompts, tool allowlists, and DSL schemas should all be versioned, and changes should go through review. On the security side, focus on credential hosting, prompt injection that induces unauthorized queries, and indirect leakage caused by excessive aggregation.

    Conclusion

    A Data Agent in a no-egress environment essentially limits the large language model to understanding and planning, while keeping computation, permissions, and definitions in deterministic systems that the enterprise already controls. Route selection should follow residency and trust requirements, not feature flash. Only by making the semantic layer, inherited permissions, traceable results, and private deployment real can conversational analytics move from demo to auditable production capability. If the organization already uses general cloud and infrastructure capabilities such as object storage, containers, and unified monitoring, it should reuse them as much as possible to reduce new data movement and boundary crossing.