Limit where sandboxes can connect
By default a sandbox reaches any public host and no private address. To narrow that, you need a shell on the host machine. The allow-list you set there applies to every sandbox the host starts and to the hooks and integration actions it sends; Spotlight itself and the storage it hands runs stay reachable.
List the hosts
Collect the hosts your runs need:
- The model provider for each harness your lines use, such as
api.anthropic.comfor Claude Code orapi.openai.comfor Codex. Egress injects a harness key only for a host the list allows. - The package registries your
setupcommands and agents install from, such asregistry.npmjs.orgorproxy.golang.org. - The hosts of the tools and MCP servers your stations use, and of the hooks and integration actions the host sends.
docs.usespotlight.ai, where agents read how to set up and change Spotlight when a task or a chat asks about it.- Any private host a run needs, named explicitly (see below).
- For a setup chat,
registry.terraform.io,github.comandrelease-assets.githubusercontent.com, whereterraform initdownloads Spotlight's provider.
An entry is an exact host, or *.example.com for the subdomains of
example.com, with no scheme, port or path.
Allowed hosts has the matching rules.
Set the allow-list
Set the list, comma-separated:
spotlight host config set egress-allow=api.anthropic.com,registry.npmjs.org,*.acme.internalThe command checks the list before it saves it. On an entry it cannot read, it
saves nothing and names the entry. The running host applies the list at once,
to the sandboxes it starts next. To check the setting, run
spotlight host status.
If you run spotlight host serve under your own supervisor, you can set
SPOTLIGHT_EGRESS_ALLOW in its environment instead. The environment overrides
the settings file.
Reach a private host
Egress opens a connection to a private address only for a host an entry names,
exactly or by a *. pattern. Add the name the run uses for the private host,
such as git.acme.internal. Loopback and link-local addresses, including the
cloud metadata address, are always blocked;
Blocked addresses lists the ranges.
Trust an internal certificate authority
If egress injects a secret into requests for a host whose certificate comes from an internal CA, or the host sends a hook or an integration action to one, give egress the CA. Save the certificates as a PEM file, then give egress its path:
spotlight host config set egress-ca-bundle=/etc/spotlight/internal-ca.pemThe running host applies it to the sandboxes it starts next.
Sandboxes do not trust these authorities. If the agent's own tools connect to the host directly, add the CA to your runner image as well; see Run a line in your own runner image.
Find blocked requests
A request to a host the list leaves out fails with status 403 and this
message:
Egress doesn't allow this sandbox to connect to <host>.A connection to an address egress never opens fails with 502. Through a
tunnelled CONNECT, the message is Egress couldn't reach <host:port>. Error: and
the reason. A plain-HTTP request, or one to a host egress injects a secret for,
gets only Egress couldn't reach <host:port>. These reach whatever made the
request, so
look for them in the output of the agent's commands on the run page. Add the
host to the list if the run needs it, and restart the host.
Related
- Egress
- Host settings: every egress setting on the host.
- The sandbox is the security boundary, on what egress protects.