AI Agent Hosting Architecture: Data Boundaries and Deployment Models

    Understand what self-hosting an AI agent actually controls, how three common deployment models divide responsibility, and why local data storage does not eliminate external inference traffic. This article examines retention and transmission boundaries, zero data retention requirements, and practical security review checklists for enterprise deployments.

    As large language models move into enterprise applications, AI agents combine planning, tool use, and memory to support increasingly complex workflows. Building a reliable, secure agent system, however, requires more than connecting a model to a set of tools. Teams must manage execution loops, application state, credentials, and data compliance.

    Managed agent services simplify some of that work. Yet the term “self-hosted” often leaves developers and architects with an important question: which parts of the system do they actually control, and which responsibilities remain with a provider?

    The answer requires looking beyond product labels to the architecture itself—particularly the boundaries between data storage, tool execution, and model inference.

    1. What Does Self-Hosting an AI Agent Actually Cover?

    Two concepts are frequently conflated when evaluating agent hosting: data retention and data transmission for inference. Keeping data in your own infrastructure is not the same as preventing it from being sent to an external service.

    Self-hosted agent architectures typically allow an enterprise to take control of three major components:

    1. Agent services and control plane: The agent execution loop, API routing, task scheduling, and related application logic.
    2. Credential management: API keys and authentication credentials for external services and databases, stored in the enterprise’s own secure credential store.
    3. Conversation history and state: Multi-turn conversation context and intermediate tool results, persisted in enterprise-controlled databases.

    However, in an architecture that uses an external model provider, inference still takes place outside the enterprise environment. Each model call sends the context assembled for that request to the inference provider. This can include the original user question, previous interactions, tool inputs, and tool results. The model processes the request and returns its output, potentially as a token stream.

    This distinction exposes a common compliance misconception: self-hosting an agent does not, by itself, mean that data never leaves the network.

    Self-hosting changes who controls stored data. It does not automatically remove external transmission paths. Treating both concerns as a single question—“Does data leave our environment?”—can obscure important risks during a security review.

    2. Three Common AI Agent Deployment Models

    An agent system can be divided into three logical layers:

    • Sandbox: The isolated environment where tools execute commands and manipulate files.
    • Services and control plane: API services, the agent execution loop, and conversation state storage.
    • Model layer: The large language model responsible for inference.

    These layers provide a useful basis for comparing three common hosting arrangements.

    Deployment model Sandbox operated by Services and control plane operated by Model provided by
    Fully managed cloud Cloud provider Cloud provider Cloud provider
    Self-hosted sandbox Enterprise Cloud provider Cloud provider
    Self-hosted control plane Enterprise Enterprise Cloud provider or enterprise-selected inference provider

    Fully Managed Cloud

    In this model, a cloud provider supplies the execution environment, agent services, and model inference. Developers define the agent’s prompts and tools without operating the underlying infrastructure.

    The main advantages are low initial engineering effort and rapid iteration. However, conversation history and application state remain on the provider’s infrastructure. That arrangement may not meet the requirements of highly privacy-sensitive workloads, including some financial services and public-sector applications.

    Self-Hosted Sandbox

    Here, the enterprise brings the execution layer into its own network. Python execution, local file operations, and access to internal databases take place within an enterprise-controlled environment.

    This addresses security concerns associated with where tools run. It does not bring the entire agent system inside the enterprise boundary: API services and conversation storage remain with the cloud provider.

    The distinction matters because local tool execution and local conversation storage are separate architectural decisions.

    Self-Hosted Control Plane

    This model extends enterprise control beyond the sandbox to include the API gateway, agent execution loop, and conversation history database.

    The cloud or model provider then serves primarily as an inference engine. The enterprise operates the orchestration and storage components while selecting an external inference provider.

    For example, the source architecture can use a container platform such as Baidu AI Cloud’s to deploy a custom control plane, with object storage persisting conversation state. The architectural objective is enterprise control over the data lifecycle outside the external inference process; the specific platform must be evaluated against the deployment’s availability and compliance requirements.

    3. Data Security and the Limits of Zero Data Retention

    Moving to a self-hosted control plane changes how zero data retention (ZDR) requirements apply.

    ZDR generally refers to an enterprise service commitment that a model provider will not retain customer request and response data after processing. Its exact scope depends on the service and agreement.

    In fully managed and self-hosted sandbox deployments, the cloud provider still stores conversation context. Exceptions associated with managed conversation storage may therefore remain relevant.

    With a self-hosted control plane, conversation history resides in the enterprise’s own database. If model calls are made as stateless API requests, exceptions specifically associated with provider-hosted conversation storage may no longer apply to those calls.

    However, self-hosting the control plane does not automatically make every model request eligible for ZDR. Eligibility still requires a separate review of several factors:

    1. Model version and endpoint: Some models may not support ZDR, or support may depend on the API endpoint used.
    2. Enabled features: Features such as prompt caching or certain long-context processing capabilities may involve temporary data retention.
    3. Provider agreement: ZDR is often a contractual service commitment, not simply a technical setting. Its scope must be supported by the applicable agreement.

    Security and compliance teams should therefore verify the exact model, API features, and provider terms used by the application. “Self-hosted” and “zero retention” are not interchangeable descriptions.

    4. Practical Checklists for Enterprise Architecture Reviews

    An agent hosting proposal should undergo two distinct reviews: one for retention and another for transmission. Each should produce explicit answers rather than relying on a general statement that the deployment is self-hosted.

    Data Retention Checklist

    • Where is the database physically located? Confirm whether its deployment location satisfies applicable data residency requirements.
    • Where is each category of data stored? Identify the database instances or storage systems holding conversation history, agent configuration, and tool execution logs.
    • Who owns lifecycle management? Establish responsibility for retention periods, automated expiration and deletion, and audit trails.

    Data Transmission Checklist

    • Where do inference requests go? Identify destination domains and IP addresses. Determine whether private connectivity, such as PrivateLink where supported, is available.
    • What does each request payload contain? Check whether requests include personally identifiable information (PII) that cannot be de-identified. Review how tool outputs are truncated, redacted, or otherwise protected before transmission, and whether any encryption approach is compatible with inference.
    • What transport authentication is required? Verify the transport security configuration and whether mutual TLS authentication is required and supported.

    These reviews should remain separate even when the same team owns both. Local storage does not establish the safety of an outbound payload, and a protected network path does not establish the provider’s retention policy.

    Conclusion

    AI agent hosting is a balance between operational convenience and enterprise control. Fully managed services minimize infrastructure work. Self-hosted sandboxes bring tool execution into the enterprise environment. Self-hosted control planes extend that control to orchestration, credentials, and conversation storage.

    None of these labels alone answers every data security question. The decisive step is to map responsibility across the architecture and assess retention separately from transmission. That is how teams can use external model inference while maintaining clear, enforceable boundaries around enterprise data.