Skip to the letter
SecureAgentSandbox.com

Security for AI agents that run or test other companies' software: tenant isolation, untrusted code, outbound traffic, secrets, audit logs and questionnaires.

How to control outbound network traffic per customer on a multi-tenant agent platform

In short

Deny all outbound traffic from each agent run by default, then allow only DNS and an egress path limited to the hosts that customer asked you to test. Check resolved addresses, block internal and metadata ranges, keep runs apart, and log every connection with its tenant.

Per-tenant egress control is a rule set that limits each customer's agent runs to the hosts that customer asked you to test, and nothing else. It protects three parties at once: the customer, whose data should not leave for anywhere unexpected; other customers, whose runs should be unreachable; and you, because a run that can be steered by page content must not reach your internal services.

Why does a multi-tenant agent platform need per-tenant egress rules?

A multi-tenant agent platform needs per-tenant egress rules because, by default, nothing stops a run from connecting anywhere, including to other customers' runs. The Kubernetes documentation states the defaults plainly: "By default, all pods in a Kubernetes cluster are allowed to communicate with each other, and all network traffic is unencrypted", and "By default, a pod is non-isolated for egress; all outbound connections are allowed" (Kubernetes multi-tenancy and Network Policies, read 2026-11-26).

NIST SP 800-53 describes the target state in control SC-7(5): "Deny network communications traffic by default and allow network communications traffic by exception" (NIST SP 800-53 Rev. 5, read 2026-11-26).

What does per-tenant egress look like on a hosted sandbox?

On a hosted sandbox, per-tenant egress becomes a setting on each run rather than a policy you maintain yourself. Six providers document such settings on their own pages, all read 2026-11-26.

Promigence's FAQ says each of its sandboxes can have full outbound access, none, or an outbound allow-list of the destinations it needs, and that refused connections are recorded. Its CLI reference gives the switches: --network none for no network, and --allow HOST, repeatable, to "Let the sandboxes reach only these hosts"; a run that sets neither gets the default, egress, outbound access allowed. A run for one customer then carries that customer's approved hosts, built as in Step 3 below. The snapshot name, hosts, count and cap below are illustrative:

promigence run --snapshot acme-e2e --count 8 --cap 5 \
  --allow staging.acme.example --allow assets.acme.example \
  -- sh -c "npm run e2e"

For the records described in Step 5, promigence sandbox network <sandbox_id> shows what a sandbox may reach and, when it has an allow-list, the hosts it was refused. The error reference adds that when a requested allow-list could not be applied, the sandbox was discarded rather than started without the restriction.

The other five providers document these defaults and settings for their sandboxes:

Table: Outbound network settings documented by AWS, Daytona, E2B, Google Cloud and Modal (read 2026-11-26)

ProviderOutbound access by defaultSettings that restrict itSource
AWS (Amazon Bedrock AgentCore Code Interpreter and Browser)Chosen when the tool is created: the console's "Sandbox" setting is an "Environment with limited external network access" and "Public network" "Allows access to public internet resources"Network mode PUBLIC, SANDBOX or VPC for Code Interpreter, and PUBLIC or VPC for Browser; VPC needs a VPC configurationCreate a Code Interpreter, CodeInterpreterNetworkConfiguration, BrowserNetworkConfiguration
Daytona"Open on Tier 3 and above; restricted on Tier 1 and 2"One of networkBlockAll, networkAllowList (up to 10 IPv4 CIDR blocks) or domainAllowList (up to 100 domains, wildcards allowed); on Tier 3 and 4 it can be changed on a running sandboxNetwork limits, Isolation
E2B"Every sandbox has outbound access to the internet by default"allowInternetAccess: false, or network.allowOut and network.denyOut lists of IP addresses, CIDR blocks and domains; domain rules cover HTTP on port 80 and TLS on port 443, and all other traffic must then be deniedInternet access
Google Cloud (Gemini Enterprise Agent Platform sandboxes)Code execution sandboxes run without outbound internet or VPC network access; template-backed sandboxes start with outbound internet offinternet_access: True opens outbound access to public IP addresses; there is no built-in domain allow-list property, so domain rules are enforced in your own VPC (Cloud NGFW or Secure Web Proxy) after a network attachmentSandboxes overview
ModalOutbound connections to any public IP address, and no incoming connectionsblock_network=True, outbound_cidr_allowlist, or outbound_domain_allowlist (Beta, TLS on port 443); with a domain allow-list, other connections are blocked and logged to the Sandbox's system outputNetworking and security

Whichever provider runs the sandboxes, the customer's approved hosts still come from the process in Step 3, and the tests at the end of this article apply unchanged.

What should the egress design look like if you build it yourself?

If you build it yourself, the design has three layers, each enforced outside the agent's reach.

Table: The three layers of per-tenant egress control

LayerEnforced byWhat it decides
Run networkNetworkPolicy, or a per-run container networkA run may reach DNS and the egress proxy, and nothing else
Egress proxyA forward proxy with a per-tenant allow-listWhich hostnames this tenant's runs may reach
Address checkThe same proxy, after DNS resolutionWhether the resolved address is public and permitted

NetworkPolicy alone cannot do the second layer. The Kubernetes page lists "Targeting of services by name" among the things the API cannot do; policies control traffic "at the IP address or port level (OSI layer 3 or 4)" (Kubernetes Network Policies, read 2026-11-26). A hostname can resolve to different addresses from one day to the next, so hostnames are checked by a proxy.

Step 1: How do I deny everything by default?

Deny everything by default with a NetworkPolicy that selects every pod in the tenant's namespace and allows no egress. This is the policy from the Kubernetes documentation:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-egress
  namespace: tenant-acme
spec:
  podSelector: {}
  policyTypes:
  - Egress

Two cautions from the same page. "Creating a NetworkPolicy resource without a controller that implements it will have no effect", so confirm your network plugin enforces policies. And "A default deny-all egress policy also blocks DNS traffic", so allow DNS explicitly in the next step.

Step 2: How do I allow only DNS and the egress proxy?

Allow two destinations: the cluster DNS service and the tenant's egress proxy. Every Kubernetes namespace carries the label kubernetes.io/metadata.name, set by the API server to the namespace's name, which "is useful if you want to target a specific namespace with a label selector" (Kubernetes well-known labels, read 2026-11-26). Check your cluster's DNS pod labels before copying the second selector.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-dns-and-proxy
  namespace: tenant-acme
spec:
  podSelector:
    matchLabels:
      role: agent-run
  policyTypes:
  - Egress
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: kube-system
      podSelector:
        matchLabels:
          k8s-app: kube-dns
    ports:
    - protocol: UDP
      port: 53
    - protocol: TCP
      port: 53
  - to:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: egress-proxy
      podSelector:
        matchLabels:
          tenant: acme
    ports:
    - protocol: TCP
      port: 3128

The proxy port is an example. The policy lets runs reach only the proxy instance serving their own tenant, so one customer's runs never share a proxy configuration with another's. Do not use an empty namespaceSelector: {} in these rules; the multi-tenancy page recommends against it when allowing traffic between namespaces.

Step 3: How do I build each customer's allow-list?

Build each allow-list from what the customer declares, not from what the agent asks for.

  1. Ask the customer for the hostnames of the environments to test, such as their staging and preview hosts.
  2. Run a supervised test session and record every hostname those pages load: scripts, fonts, APIs, identity providers.
  3. Show the customer the combined list and get their approval. Record who approved it and when.
  4. Store it as configuration of that tenant only. Changes need an authenticated request and leave an audit record, as described in our guide to audit logs for agent actions.
  5. Refuse wildcards that cover a whole public suffix or a shared hosting domain, since other parties' sites live there too.

Step 4: How do I stop the proxy being used to reach internal systems?

Stop it by checking the address each hostname resolves to and connecting only to that checked address. OWASP's SSRF cheat sheet is the reference here (OWASP SSRF Prevention Cheat Sheet, read 2026-11-26):

  • "Domain allowlisting alone does not prevent DNS rebinding." "Validate the resolved destination IP addresses against the application's permitted networks", then connect to the validated address rather than resolving again.
  • Refuse private, loopback, link-local and unique-local ranges, and your own service addresses, whatever hostname points at them.
  • Block the metadata endpoints, because "In cloud environments SSRF is often used to access and steal credentials and access tokens from metadata services."
  • Do not follow redirects to a host that is not on the list; the sheet advises to "Disable the support for the following of the redirection in your web client".

Step 5: How do I record what left each run?

Record every connection attempt at the proxy, with the tenant, the run, the hostname, the resolved address, the decision and the bytes sent. The Kubernetes documentation lists "The ability to log network security events (for example connections that are blocked or accepted)" among things NetworkPolicy does not do, so the proxy is where this evidence lives (Kubernetes Network Policies, read 2026-11-26).

Alert on a run that hits many refused hosts, which is a common sign of injected instructions, and on any refused attempt at an internal or metadata address. A customer's security team will ask for exactly these records.

How do I test per-tenant egress?

Test it from inside a real run for each of two tenants:

  1. A host on tenant A's list loads in A's run and fails in B's run.
  2. A host on no list fails at the proxy, and the refusal is logged with the run ID.
  3. A hostname that resolves to a private address fails, even if it is on the list.
  4. A direct connection that bypasses the proxy fails at the network layer.
  5. A connection to another run's address fails.
  6. The metadata address fails by IP and by any hostname pointing at it.

What we read for this article

Questions readers ask

Who decides which hosts a customer's agent runs may reach?

The customer, in writing. Ask for the exact hostnames of the environments to test and of the services those pages load, store them as that tenant's allow-list, and change them only through an authenticated, logged request.

Does a Kubernetes NetworkPolicy filter by domain name?

No. The Kubernetes documentation says targeting services by name is not supported, and policies work at the IP address or port level. Filter hostnames at an egress proxy and use NetworkPolicy to force every run through that proxy.

Why block the cloud metadata address?

Because, as OWASP's SSRF guidance notes, attackers use it to steal credentials and access tokens in cloud environments. An agent that can be steered by page content must not be able to ask your infrastructure for its own credentials.

Can Kubernetes NetworkPolicy log blocked connections?

Not by itself. The documentation lists logging of blocked or accepted connections among the things the NetworkPolicy API does not do. Log at the egress proxy, where every allowed and refused request carries the run and tenant.

Yours,

Revised , 8 minutes to read