Safeguard
AI Security•

Self-hosted or vendor-hosted agent sandbox: who owns isolation?

A vendor-hosted agent sandbox hands isolation to the provider. A self-hosted one hands it to you. What each choice changes for egress, secrets, evidence.

Safeguard Security Team
6 min read

With a vendor-hosted sandbox, the provider builds and operates the isolation, and you configure access and review output. With a self-hosted one, isolation is your responsibility: host hardening, network egress, credentials, and cleanup. Choose based on where code may run and how much isolation work your team can sustain.

What the documentation says

One platform states that sessions routed to a self-hosted environment run on your own infrastructure, where isolation is your deployment's responsibility, and that you restrict session egress at your own network boundary. In its hosted environments it describes isolated VMs, a network proxy, and credentials kept outside the VM. It also notes that a self-hosted environment does not have the stored network secrets feature, and that your deployment supplies git credentials.

Another platform recommends, for self-hosted runners, ephemeral single-use runners, restricting network access so the agent has no open access to your network or the public internet, and disabling its integrated firewall because the firewall is incompatible with self-hosted runners. That last point is easy to miss: moving to your own runner can remove a control you were relying on, so you must replace it.

Comparison

AreaVendor-hostedSelf-hosted
Isolation technologyProvider chooses and operatesYou choose and operate
Network egressProvider defaults plus your settingsYour network boundary
CredentialsProvider mechanisms such as proxiesYou supply and protect them
Source locationUploaded to the providerStays in your environment
EvidenceProvider docs and your session recordsYour own logs and configs
EffortConfiguration and reviewBuild, patch, monitor
Controls that may not carry overNone to replaceBuilt in firewalls or secret features

Decision guide

  1. Can the code leave your network? If policy says no, self-host.
  2. Do you have staff to patch hosts and tune egress? If not, hosted may be safer in practice.
  3. Do you need proof of controls for an audit? Hosted gives you the vendor's documentation. Self-hosted gives you control and the duty to produce your own evidence.
  4. How untrusted is the code? Untrusted code argues for stronger isolation, such as a user-space kernel or microVM, whichever you pick.
  5. Can you run ephemeral environments? Single use sandboxes reduce leftover state in either model.

If you self-host, minimum bar

  • One sandbox per task, destroyed afterward.
  • Default deny egress with an allowlist you own.
  • No access to the cloud metadata address from the sandbox.
  • Credentials issued per task, scoped, and short-lived.
  • Logs for tool calls, network decisions, and git operations.
  • A patch process for the host and runtime.

Worked example: two teams, two choices

Illustrative scenarios.

Team One builds consumer software, has a small platform group, and keeps source in a hosted git service. They choose a vendor hosted sandbox. Their work is to configure a tight network setting, add scoped repository access, require held workflows and review, and read the vendor's documentation each quarter for changes. They accept that source is uploaded to the provider and confirm retention terms in writing.

Team Two builds software for customers whose contracts forbid source leaving a controlled network. They choose a self-hosted environment on their own cluster. Their work is bigger: pick an isolation runtime, write network policy, run an egress proxy, issue per-task credentials, patch hosts, collect logs, and test the setup. They also replace any built in control the hosted option offered, such as a managed firewall or credential proxy, because those do not carry over.

Both are reasonable. The failure modes differ. Team One's risk is trusting defaults. Team Two's risk is under-investing in the platform.

Effort comparison

TaskVendor-hostedSelf-hosted
Patch the host and runtimeProviderYou
Define egressConfigure provider settingsBuild and run it
Credential handlingUse provider featuresBuild or buy
Capacity and cost controlProvider limitsYou
Incident response for the sandbox layerShared, depends on contractYou
Evidence of controlsProvider docs and reportsYour own records
CustomizationLimited to what is offeredFull

Questions for a self-hosting plan

  1. Who is on call for the sandbox platform?
  2. How fast can you patch the runtime after an advisory?
  3. How do you test isolation, and how often?
  4. What does a session leave behind, and who cleans it?
  5. How are costs capped when an agent loops?
  6. What is the exit plan if the platform proves too costly to run?

A middle path

Some teams use a vendor hosted sandbox for public or low sensitivity repositories and self-host only for the sensitive ones. That keeps operational effort proportional to risk. It also means two sets of rules, so write both down and make the dividing line explicit.

Contract and evidence angles

For hosted options, ask for documentation on isolation, retention, and subprocessors, and align what you tell your own customers with what the vendor states. Do not repeat a vendor's marketing as your own claim. For self-hosted, maintain your own architecture notes, network diagrams, and test records.

Where Safeguard fits

Safeguard does not host sandboxes. It supports governance in either model through agent identity, policies and gates, MCP Guardrail, and compliance and evidence automation.

Try it yourself

Click through it at your own pace, or open it full screen.

Click through it and look at how continuous checks surface changes over time, since a self-hosted sandbox needs the same ongoing attention.

Quick check

Is self-hosted always more secure?

No. It keeps code in your network, but you must build and maintain the isolation yourself.

Can I move from hosted to self-hosted without changing controls?

Not safely. Some controls, such as built in firewalls or credential features, may not apply, so list them first.

Can a small team realistically self-host agent sandboxes?

Yes, if scope is narrow and the platform is treated as a product with an owner. Without an owner and a patch process, a hosted option is often safer in practice.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.