> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openhands.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Restrict Sandbox Network Access

> Control sandbox egress for OpenHands Enterprise on Kubernetes while keeping Git, builds, and web search available.

Start with the OpenHands Helm chart's sandbox NetworkPolicy. Allow the routes
agents need to clone repositories, install dependencies, and run tests. Use a
firewall or forward proxy for approved internet destinations, and give agents
a search tool for looking up documentation across approved sources.

## Configure Sandbox NetworkPolicy

Use a Kubernetes network plugin that enforces NetworkPolicy. To enable the
chart's policy and disable its broad IPv4 and IPv6 internet rules, add these
settings to your Helm values:

```yaml theme={null}
sandboxNetworkPolicy:
  enabled: true
  internet:
    enabled: false
  ipv6:
    enabled: false
```

Keep cluster DNS, OpenHands app callbacks, and any runtime URLs your sandboxes
use reachable. If sandboxes connect through a load balancer, allow its addresses
and ports explicitly. See the chart's
[sandbox network isolation guidance](https://github.com/OpenHands/OpenHands-Cloud/blob/main/charts/openhands/README.md#sandbox-network-isolation)
for examples for your cluster.

Use `sandboxNetworkPolicy.extraEgress` to allow other required destinations,
such as a Git host, model gateway, or package mirror. Use IP ranges or pod
and namespace selectors. Review all policies that select sandbox pods.
Kubernetes combines their allow rules. See
[Kubernetes NetworkPolicy](https://kubernetes.io/docs/concepts/services-networking/network-policies/).

## Control Internet Access with a Firewall or Proxy

If a workflow needs access to approved public sites, route its traffic through
an outbound firewall or an enforced forward proxy. Set the destination allowlist
there and configure your network rules to permit the required traffic along
that path. With a forward proxy, allow the proxy's address and port, configure
compatible clients to use it, and block direct internet access from the sandbox.

## Provide Search Across Approved Sources

Give agents a search tool through an approved remote MCP service and allow
sandboxes to reach it. Configure the service to keep the upstream provider's
API key and apply an administrator-managed list of domains to every query.
For example, allow the documentation sites for your language and framework.
See [Organization MCP Servers](https://docs.openhands.dev/enterprise/org-mcp-servers.md) to connect the tool.

For the [Exa Search API](https://exa.ai/docs/reference/search), set
`includeDomains`. For the
[Tavily Search API](https://docs.tavily.com/documentation/api-reference/endpoint/search),
set `include_domains` and `include_domains_mode: restrict`.
Start with results and snippets. If you add a tool that fetches full pages,
enforce an approved destination list for fetches, including redirects.

Use an internal search index when queries may contain private code or internal
details. If your organization approves the built-in Tavily integration,
OpenHands can route search through the app using
[`TAVILY_API_KEY`](https://docs.openhands.dev/enterprise/environment-variables#web-search). Use a
customer-managed search service when you need a fixed domain list across
requests.

## Choose Tools and Secrets with Agent Profiles

Use an [Agent Profile](https://docs.openhands.dev/enterprise/agent-profiles.md) to select the tools and saved
conversation secrets a workflow needs. A documentation research profile can
include the approved search tool and omit the terminal. A coding profile can
include the terminal and the secrets needed to build and test.

Profiles apply to conversations launched with them. Members can choose a different
profile, so enforce egress restrictions through your network controls. Review Git
authorization separately. The sandbox's Git credential helper can authenticate
independently of [Agent Profile secret selection](https://docs.openhands.dev/enterprise/secrets-management.md#agent-profile-secret-selection).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.