---
title: "Network and egress"
description: "Control which hosts a sandbox can reach."
---

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

# Network and egress

:::note[Planned]
Egress policies are not available yet. The samples show the planned API.
:::

:::note[Today]
Today a sandbox can reach any host. A create that sets an egress policy, or any other network setting, is refused with `INVALID_ARGUMENT`.
:::

An egress policy controls which hosts a sandbox can reach. Use it to run untrusted code, or to make sure a job talks only to the services it needs.

## Modes

Set `network.egress.mode` when you create a sandbox:

| Mode | What the sandbox can reach |
| --- | --- |
| `ALLOW_ALL` | Any host. |
| `DENY_ALL` | No host on the internet. |
| `ALLOW_LIST` | Only the hosts in `hosts`. |

## Integrations

[Integrations](https://docs.jgcp.mistrivedev.com/platform/integrations/) stay reachable under every policy, including `DENY_ALL`. A sandbox with the GitHub integration can call GitHub even when it can reach nothing else. You do not need to add the provider's hosts to an allow list.

## Change the policy

Change the policy of a running sandbox with `update`. A common pattern is to allow a package index while you install dependencies, then switch to `DENY_ALL` before you run untrusted code.

## Inbound traffic

Egress covers traffic that leaves the sandbox. To let traffic in, create a [port](https://docs.jgcp.mistrivedev.com/sandboxes/ports/).

Source: https://docs.jgcp.mistrivedev.com/sandboxes/network/index.mdx
