Husk
GitHub

Computers

Networking and the egress policy

Three modes, where each one is enforced, and the floor that blocks link-local and RFC1918 even in mode full.

Network policy is declared per husk and defaults to egress.

computer:
  network:
    mode: egress
    allow: ['*.github.com', 'pypi.org']
    deny: ['telemetry.example.com']
ModeMeaning
noneNo egress at all
egressThe allow-list, and nothing else. An empty allow-list permits nothing
fullUnrestricted, minus explicit denies and minus the floor below

An egress policy with no allow list allows nothing. Reading an under-specified policy as "everything" is the interpretation that leaks data, so it is not the one Husk picks.

Where each mode is enforced

This is the part most sandbox documentation is vague about, and vagueness here is how people end up believing they have containment they do not have.

ModeDocker / PodmanHusk's tools and the browser's page loads
none--network=none, enforced by the kernelRefused
egressNot enforced. The container has normal networkingEnforced by hostname
fullNot enforced, by designEnforced only by the floor and by deny

Neither Docker nor Podman can allow-list hostnames, so egress is enforced where the hostname is actually known: in Husk's tools (fetch_url, http_request, browse and the browser's own navigation), and in the browser driver, which checks every document a page loads by itself before anything is sent. A process inside the machine that opens a raw socket, or runs curl in a shell, is not stopped by an egress policy, and nor are a page's images, scripts and fetch calls. Network policy says what each check covers.

Where a provider cannot hold every process in the computer to the policy, Husk warns when it makes the computer. Ask for strict and it refuses to make one instead:

computer:
  network:
    mode: none
    strict: true    # or: husk-mcp --network none --network-strict

Only none on Docker or Podman, and full with no deny list, pass: no provider firewalls egress or a deny list for a process yet.

The floor

isHostAllowed refuses link-local and RFC1918 hosts even in mode: full, unless the operator names them in allow. Loopback is refused too, except on a computer that has a loopback of its own (Docker, Podman and Fly): there 127.0.0.1 is the computer, not your machine, so the dev server an agent starts is one it can look at with browse or the browser. fetch_url and http_request run on your machine, not in the computer, so they never get that exception.

mode: full means the internet. It does not mean the cloud metadata service at 169.254.169.254 that hands IAM credentials to anything that asks — and an agent that has been prompt-injected will ask. Loopback and the private ranges are the same problem one hop further out: the host's own admin panels, and the LAN.

Refused by default, in every mode:

Nameslocalhost, *.localhost, *.local, *.internal, metadata.google.internal
IPv6::1, ::, fe80:* (link-local), fc*/fd* (unique-local)
IPv40.0.0.0/8, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10 (CGNAT)
error network policy refuses 169.254.169.254
hint:  link-local and RFC1918 hosts must be named in computer.network.allow

To reach one deliberately, name it:

computer:
  network:
    mode: egress
    allow: ['192.168.1.50']

Explicit beats implicit, and now the decision is in the file where a reviewer can see it.

The floor is one function, isInternalHost in @husk-ai/core, which the runtime and the agent both use, so a host refused in one place is refused everywhere.

What the floor does not catch

It reads the host as written, decoded: http://2130706433/ (127.0.0.1 as one number), octal and hex forms, and IPv4-mapped IPv6 such as ::ffff:127.0.0.1 are refused as the addresses they are. There is no DNS resolution, though, so a public name that resolves to 169.254.169.254 passes. Classic DNS rebinding.

A * entry in allow satisfies the match and therefore reopens the whole private range. Do not write allow: ['*'] and expect the floor to hold.

Pattern matching

One wildcard form, a leading *.:

PatternMatchesDoes not match
github.comgithub.comapi.github.com
*.github.comapi.github.com, raw.github.comgithub.com
*everything—

*.example.com deliberately does not match bare example.com: a suffix match requires at least one more character. Both sides are lower-cased and lose a trailing dot.

deny is checked before mode, so a denied host is refused even in full.

Order of checks

For fetch_url and http_request, in this order:

  1. The URL parses. Otherwise E_EXEC_DENIED, not a valid URL.
  2. The protocol is http: or https:. file:, ftp:, data: and gopher: are refused with E_EXEC_DENIED, refusing the <scheme> scheme.
  3. The private-address floor, unless the host is named in allow.
  4. isHostAllowed(host, policy) — deny, then mode.

A refusal at 3 or 4 is E_EXEC_DENIED, network policy refuses <host>.

The checks run on the URL you passed, and again on each redirect's target before it is requested. A 302 to http://169.254.169.254/ is refused without asking that address anything, and a public → internal → public chain stops at the internal hop.

web_search calls neither check. It talks to Tavily or Brave directly and is not filtered by the husk's network policy.

Requests Husk itself makes

Requests depend on the task and provider:

  • The model provider you configured.
  • A container registry, when a flavor's image is not already pulled.
  • Chrome for Testing (Playwright's CDN on arm64), from inside the computer, the first time it needs the browser and has no Chromium of its own.
  • Public sources and search services you ask the agent to access.
  • The remote computer provider you configured, if any.
  • With remote access on, the npm registry, for advisories against Husk's own packages.

The installed runtime has no product telemetry or crash reporter. The hosted website and docs use Vercel Web Analytics.