Infrastructure Review Stack

Bring Your Own Cloud vs Hosted Sandboxes for AI Agents

Compliance, latency, and volume decide which sandbox model fits.

· 8 min read
Cover illustration for “Bring Your Own Cloud vs Hosted Sandboxes for AI Agents”
Choosing a Sandbox for AI Agents · November 16, 2026 · 8 min read · 1,883 words

Choosing between bring-your-own-cloud and hosted sandboxes for AI agents is a decision about constraints. Compliance boundaries, data residency, execution volume, and network latency shape which models a team can use. The right choice also depends on whether the team can operate the infrastructure and preserve the state its agents need.

Why the BYOC vs. hosted sandbox decision is not about preference

Hosted sandboxes place execution in a provider’s environment, while bring-your-own-cloud keeps the execution plane inside the customer’s VPC, often with vendor-managed orchestration. That split determines who processes data and who operates the infrastructure on which agents depend. It is a structural engineering and compliance decision before it is a feature comparison.

The pressures are independent of one another. A residency requirement can rule out an otherwise affordable hosted service, while external network round-trips can disqualify it for a latency-sensitive workload. At millions of monthly executions, the cost curve can force a team to review its choice even when regulation and latency leave it free to choose. A team facing none of these constraints has genuine freedom to choose hosted. A team facing any one of them needs to establish which architectures remain possible.

What "in your own cloud" actually means — and where the boundary can be misleading

“Private,” “dedicated,” and “in your VPC” do not describe interchangeable boundaries. Compute may run in the customer’s account while logs, snapshots, orchestration metadata, or control-plane state pass through vendor infrastructure. The distinction is easy to miss. If the requirement is that particular data remain inside a defined boundary, the location of execution alone cannot establish compliance.

BYOC itself covers several allocations of control. In one model, the vendor manages the control plane while customer-managed compute runs the data plane. A forward-deployed or air-gapped control plane brings orchestration inside the customer boundary as well. With fully self-hosted infrastructure, the customer owns both planes in full. These models share a broad label, but they differ in how much data is exposed and who has to run the infrastructure.

A team evaluating a provider should go beyond “Does this run in the customer’s cloud?” and ask where execution, logs, snapshots, backups, and control-plane metadata each reside. Each category needs its own answer. Compliance evidence must then cover that deployment model, even if it already covers the vendor’s managed cloud. Otherwise, a correct statement about compute location can become an incorrect assumption about the whole system.

Isolation models and why the choice of runtime changes the security argument

Standard Linux containers using Docker/runc share the host kernel, with namespaces, cgroups, and seccomp providing boundaries within it. For untrusted AI-generated code at scale, that separation is insufficient whether the containers run in a customer VPC or a hosted environment. Moving them changes ownership while preserving their isolation model.

Stronger runtimes alter the boundary in different ways. gVisor interposes a user-space kernel, reducing the host kernel attack surface, while microVM approaches such as Firecracker and Kata Containers provide a dedicated guest kernel per sandbox. MicroVMs offer the strongest boundary for these untrusted workloads. Northflank uses microVMs for CPU sandboxes in its cloud and gVisor for GPU sandboxes. That difference makes the runtime used for the actual workload more informative than a platform-wide claim of sandbox isolation.

Configuration-Based Sandbox Escape, or CBSE, involves attacker-caused writes to agent configuration files, potentially through prompt injection, that weaken restrictions and disable approval policies when the agent restarts. An agent able to reach the cloud Instance Metadata Service, or IMDS, may also acquire instance credentials. Runtime isolation therefore does not replace configuration and network controls.

BYOC adds an enablement question that hosted providers handle within their infrastructure. Northflank’s BYOC guide notes that microVMs require compatible hardware or nested virtualisation, so installing a runtime alone does not establish isolation for every workload. The customer must verify that the intended runtime is installed and enabled on its own infrastructure.

Where compliance requirements make the deployment model non-negotiable

For workloads touching PHI, personal data subject to GDPR, or regulated financial data, the first evaluation step should be to establish whether in-VPC execution is required and whether the provider supports it. This comes before cost or performance comparisons. Hosted sandbox APIs are third-party data processors in shared multi-tenant environments, so they need a data processing agreement and may conflict with enterprise contracts. HIPAA, GDPR, and SOC 2 requirements can complicate that arrangement, though hosted execution is excluded only if the workload’s actual obligations rule it out.

The compliance boundary must also include the agent. For SOC 2, agents operating within the system belong in its boundary definition, and agent action logs fall under the Security trust service criteria, specifically CC7, system operations. A vendor’s managed-cloud certification does not automatically extend to BYOC. The European Commission’s Article 50 FAQ states that the EU AI Act’s transparency obligations apply from 2 August 2026 to providers and deployers of certain AI systems, including systems interacting directly with natural persons in the EU, subject to limited exemptions.

A team should confirm whether certification scope covers BYOC, managed cloud, or on-premises deployment, and whether a BAA is available where needed. Northflank’s customer-cloud platform comparison states that it is SOC 2 Type 2 compliant and HIPAA compliant across managed-cloud and BYOC deployments, with BAAs supported under Enterprise contracts.

How execution volume changes the cost math between hosted and BYOC

Hosted per-execution pricing is straightforward at low volume because the provider absorbs much of the infrastructure work. As usage approaches millions of monthly executions, however, the accumulated markup can become unsustainable. The crossover depends on usage patterns.

BYOC changes what the team pays for and manages. Costs depend on cloud account pricing and provisioned capacity, which can produce a more predictable curve at scale but require quota management, instance selection, and capacity planning. Operational staffing belongs in that calculation too. Comparing hosted execution charges only with cloud compute charges would omit part of the cost transferred to the customer.

Provisioning choices can change the result within either model. The BYOC guide documents that cto.new migrated its entire sandbox infrastructure to Northflank in two days after EC2 metal instances made scaling costs unpredictable. The new setup could handle thousands of daily deployments with linear, per-second billing.

Latency can add to the cost case for moving execution closer. For real-time coding assistants and tight agent loops, round-trips to an external sandbox service affect how well the product works, while running execution on the same network as LLM inference cuts that delay. Yet this pressure is workload-dependent as well. Hosted execution can still work when the workload can tolerate more latency, so teams need to weigh cost and topology together as usage grows.

Stateful execution and long-running agents: how persistence requirements interact with the deployment model

A coding agent that clones a repository, installs dependencies, edits files, runs a build, and iterates needs continuity across turns. A purely ephemeral runtime would force repeated cloning and installation, making that workflow economically and practically infeasible. Both hosted and BYOC environments can keep state. Evaluating continuity requires identifying which state survives and under what conditions.

Filesystem persistence through attached volumes retains files across restarts and pauses, but not running process state. Full pause/resume preserves memory and running processes so execution can resume exactly, with compute dropping to zero during suspension. Snapshots provide saved environments that can be cloned or restored, supporting reproducible starting points.

Northflank’s persistent sandbox guide documents volumes that retain repositories and artifacts across restarts and pauses, with no fixed session time limit. Pausing stops running processes and terminal sessions without saving RAM. That difference decides whether an agent can carry on with a running task or must restart processes using the files it kept. Session duration alone cannot answer that question.

The deployment model then determines who manages the storage. A fully managed hosted environment abstracts that work away, while BYOC gives the customer control over storage configuration and responsibility for provisioning and attaching volumes correctly. The choice depends on the required persistence semantics and the team’s capacity to operate them.

Operational burden: what BYOC actually transfers to the customer's team

BYOC gives the customer responsibility for the execution-plane as well as the cloud charges. The customer typically owns node provisioning, runtime installation and updates, networking, capacity scaling, quota management, and data-plane incident response, even when the vendor manages orchestration. That is a substantial operating commitment. Underestimating it can leave a deployment unable to deliver the control or economics that justified the move.

Teams therefore need to check how the deployment runs after it has been installed. The BYOC guide identifies custom-image support, concurrent sandbox capacity, startup performance, session duration, persistent storage, and GPU availability as capabilities teams need to verify. Cloud ownership does not make capacity unlimited. Quotas and provisioned infrastructure still constrain how much work can run and how quickly execution can begin.

Building around Firecracker or Kata Containers without a vendor control plane demands months of senior infrastructure engineering and ongoing maintenance. That work is easy to overlook in a comparison centered on per-execution prices. A team that cannot staff infrastructure updates and incident response needs hosted execution or a managed-BYOC arrangement that it can sustain.

Managed BYOC offers a narrower operational commitment. Northflank’s model provisions and manages Kubernetes in the customer’s cloud account while the customer retains infrastructure control, reducing the need to build sandbox orchestration from scratch. Access terms still affect feasibility, however. Some platforms offer self-serve BYOC, while others require an Enterprise agreement and a sales process, changing how quickly a team can respond to regulatory or cost pressure.

A decision framework: matching deployment model to the pressures that apply

The practical decision starts with the constraints that can eliminate options. If the workload touches PHI, regulated financial data, or personal data subject to GDPR, establish the in-VPC requirement first, then examine data locations, certification scope, and BAA availability. A hosted service that cannot satisfy those obligations is not a candidate for a later cost comparison. If no such boundary applies, hosted is still an option.

Next, compare the cost curves at the workload’s expected volume. Low and slowly growing monthly execution counts favor the simplicity of hosted per-execution pricing. Millions of executions, or a trajectory toward them, justify modeling BYOC against hosted markup with operational staffing included. If external round-trips also impair real-time agent behavior, co-locating execution with inference adds a separate reason to favor BYOC or self-hosting.

Then test whether the team can operate that choice. Senior infrastructure engineers and sufficient time make full BYOC or self-hosted control more realistic, while limited operational capacity favors hosted or managed BYOC. Persistence needs require a separate check. For long-horizon work, check whether the agent needs filesystem retention or full pause/resume, and whether the provider will keep managing storage or the customer will take it on.

When these pressures conflict, managed BYOC can resolve the tension. A vendor-managed control plane and Kubernetes layer in the customer’s cloud may preserve the required execution boundary without requiring the team to build orchestration itself. Before committing, verify the isolation runtime in that specific deployment and where logs and control-plane metadata reside. Confirm certification scope, whether access is self-serve or requires an Enterprise agreement, and GPU availability if the workload needs it. The choice is ready only when those answers describe the deployment the team will actually run.

Sources

  1. Quantifying Frontier LLM Capabilities for Container Sandbox Escape
  2. AI Code Sandboxes: A Comparative Security Study. Part 1 of 2 -- Engine-Level Properties (Attack Surface, Leakage, Stackability, CVE History, Patch Cadence, Fuzzing)
  3. Bring your own cloud (BYOC)

More in Choosing a Sandbox for AI Agents