jailoc 2.7: control the request, not just the host
November 2026 · release 2.7
Since 2.4, the network broker decides per host: either the agent can reach api.github.com or it can't. That's a blunt tool. Letting an agent read your organization's repositories on GitHub also lets it delete them, if its token allows it. jailoc 2.7 adds a second question for the requests the broker inspects: which method and which path. It narrows what inspected requests can do. It isn't a complete host-level control, and the warning below says where it stops applying.
This post covers HTTP method and path rules, the TLS inspection they need, private DNS answers (internal_zones), and a few smaller fixes. It ends with what the new rules don't protect against, and what to do when you upgrade.
TL;DR
- A rule with an
httptable decides per request by method and path instead of per connection. - Connections selected for HTTP inspection are decrypted by the broker with a per-workspace CA. Other connections stay encrypted end to end.
- Hostnames resolve to private addresses only inside zones you list in
internal_zones. - Sessions keep Go module, npm, Bun and NuGet download caches in the persistent home.
- Restart each workspace once after upgrading. The new broker, runtime and session environment come with the new VM.
Method and path rules
Add an http table to a rule:
[[workspaces.api.network.rules]]
name = "github-readonly"
allow = ["api.github.com"]
http.methods = ["GET", "HEAD"]
http.paths = ["/repos/seznam/**"]
For inspected requests, api.github.com answers GET and HEAD under /repos/seznam. An inspected DELETE, or a GET /user, gets 403 with blocked by network policy (reason=http-no-match). Omit methods or paths to match any.
Warning
HTTP rules decide only the requests the broker inspects. A broad plain allow on the same host and port, such as dev-deps or *, can leave a connection uninspected, and requests on it bypass methods and paths:
- An alternate allowed SNI outside the scope of every matching
httprule can leave a connection uninspected. A connection without SNI can remain uninspected only where no address-scopedhttprule (an IP or CIDR target, or*) applies and the plain rules permit it. - Missing ALPN isn't a bypass: a connection selected for inspection is decrypted and its first line checked. An ALPN list without
h2orhttp/1.1is decided by plain rules first; if allowed and covered by anhttprule, it is also decrypted and checked for HTTP.
Avoid broad plain access to hosts whose methods and paths you rely on http rules to restrict. That lowers the risk but doesn't promise read-only containment. http rules control inspected requests; they aren't complete host security.
Path patterns are split at /. A literal matches that segment, * matches exactly one non-empty segment, and ** matches any number of remaining segments but only as the last one. So /repos/seznam/* matches /repos/seznam/jailoc and nothing deeper, while /repos/seznam/** also covers /repos/seznam/jailoc/issues. Patterns are matched case-sensitively against the path without the query string. Ambiguous paths such as .. segments, // or encoded backslashes are denied as bad-path where a path pattern applies; the reference has the exact rules.
Two behaviors are easy to trip over:
- An
httpallow rule narrows its host. Within an inspected connection, a plain rule such asdev-depsthat also allowsapi.github.comon the same port grants nothing for that host once anhttpallow rule matches it. Only thehttpallow rules decide its requests. - A
denywithhttpis per request. It acts on inspected requests, and never blocks DNS or the connection. It also doesn't open anything, so a host you want to restrict still needs an allow rule:
[[workspaces.api.network.rules]]
name = "registry"
allow = ["registry.example.com"]
[[workspaces.api.network.rules]]
name = "registry-no-writes"
deny = ["registry.example.com"]
http.methods = ["DELETE", "POST", "PUT", "PATCH"]
Inspected reads pass through the plain registry rule. An inspected PUT gets 403 with blocked by network policy (rule=registry-no-writes). Without the first rule the host would be default-denied altogether.
jailoc traffic -f shows one line per inspected request with method, host, path, status and the rule that decided. See Restrict HTTP methods and paths for the full recipe, including how to loosen one host under a broad rule.
How the broker reads HTTPS
To see a request, the broker has to terminate TLS. It does that only for connections selected by a matching http rule. If the TLS handshake negotiates h2 or http/1.1, the broker serves HTTP. Without a negotiated HTTP protocol, it checks the first line instead. A ClientHello that offers only non-HTTP ALPN protocols needs a plain allow rule before inspection; an http rule alone doesn't open it. Allowed connections outside the inspection scope stay opaque, as in 2.4.
For inspected connections the broker presents certificates signed by a per-workspace CA, created on the host the first time a rule has http. The CA key stays in the workspace's state directory on the host with mode 0600. It never enters the VM. The CA certificate does: the guest trusts it, even with ca_bundle = false, so guest root and the agent trust it too. Treat that state directory like the rest of the VM's host-side files.
The broker connects to the real server over a second TLS connection and verifies the upstream certificate against the host's system roots plus the ca_bundle file when you set a path. A failure ends the request with 502. The broker sees full requests and responses in memory, but logs only method, host, path (no query string) and status to broker.jsonl, never bodies.
Network isolation explains protocol detection, HTTP/2 and cleartext HTTP.
What this doesn't protect against
An http rule narrows what the agent can do in inspected HTTP requests. It isn't a defense against exfiltration, and the warning above lists connections that skip inspection.
- A permitted
GETstill carries data in its path and query string. If the agent may read/repos/seznam/**, it can encode a secret into a request there, and the query string isn't checked. - A WebSocket upgrade is checked like any request, but after the
101response the connection passes through unfiltered. Frames aren't inspected. isolated_buildworkspaces don't inspect HTTPS during the image build. Theirallowrules withhttpopen the host and port for every method and path, anddenyrules withhttpdon't apply. jailoc prints a warning.- Clients that pin certificates or keys, keep their own CA store (certifi, a Java keystore, Firefox NSS) or use mutual TLS fail the handshake on inspected hosts.
jailoc trafficshows aninspect-errorwith a hint. Trust the CA in that client, or remove thehttptable from the matching rules. See Troubleshooting. - The broker doesn't chain through an upstream proxy (#398), so
HTTP_PROXYisn't used for upstream connections.
If an agent shouldn't be able to send data out, keep it off the host entirely. Use http rules to cut what inspected requests to a trusted host can do.
Private DNS answers need internal_zones
In 2.4, an allowed hostname could resolve to a private address and open it. That is DNS rebinding territory: whoever runs DNS for an allowed name picks the address, so an allowed *.nip.io name like 10-0-0-5.nip.io would reach 10.0.0.5.
2.7 makes that trust explicit, per DNS zone. The broker drops A and AAAA answers with a private address unless the queried name, the record owner and every CNAME in the answer are in an internal zone:
[defaults.network]
internal_zones = ["corp.example.com"]
[[workspaces.work.network.rules]]
name = "corp"
allow = ["gitlab.corp.example.com", "*.registry.corp.example.com"]
A zone covers itself and everything under it. It only says whose DNS you trust, and opens nothing alone: the names still need an allow rule, and deny rules still win. Zones from [defaults.network] and the workspace are merged. A public name with a CNAME into corp.example.com, or a chain through any public name, is dropped. jailoc traffic shows dropped <address>: private address outside internal_zones.
jailoc rejects zones that would defeat the point: *, public suffixes (com, co.uk, github.io) and wildcard resolvers such as nip.io and sslip.io. Names without a public registry (corp, lan, home.arpa) are fine.
Existing allowed_hosts entries that are valid zones are trusted as internal zones in memory, and jailoc migrate writes them to internal_zones. Entries that are rejected as zones, such as public suffixes and wildcard resolvers, aren't trusted. Two side effects: jailoc no longer resolves these hostnames on the host, and a name that is a CNAME into a zone you didn't list stops resolving to its private address. jailoc up, reload and migrate warn about that CNAME case; add the canonical name's zone.
The corporate example in the 2.4 post needs one extra line, the internal_zones above, to keep reaching private addresses.
Smaller changes
- Clearer denials. A flow denied after SNI or
Hostinspection gets a TLSaccess_deniedalert for HTTPS or a403with the rule name for plain HTTP, so clients report a policy denial instead of a connection reset. - Quieter
jailoc traffic.log = falseon anallowordenyrule hides the events that rule decides fromjailoc trafficunless you pass--all. The rule still applies and the broker still logs its events. See Quiet rules. - Download caches survive restarts. Sessions set
GOMODCACHE,NPM_CONFIG_CACHE,BUN_INSTALL_CACHE_DIR,NUGET_PACKAGESandNUGET_HTTP_CACHE_PATHinto the persistent~/.cache, instead of the in-memory overlay. A variable set by the image or by your workspaceenvwins. These variables also take precedence over.npmrcorbunfig.tomlsettings. jailoc sets only these five and doesn't redirect other tools' caches. See Tool caches and Resource use. - Claude Code background sessions. jailoc sets
CLAUDE_CODE_SANDBOXED=1, so Claude Code trusts the working directory without its prompt, and setsbypassPermissionsModeAcceptedin~/.claude/.claude.jsonwhen the file doesn't. Background sessions (claude --bg, used when switching sessions) can start without an interactive step. The state file is now replaced through a temporary file. - Agent config from a dotfiles repository. A read-only mount whose host directory is missing fails
jailoc upinstead of sharing an empty directory, andjailoc upwarns about symlinks that dangle in the VM. See Use agent configuration from a dotfiles repository. - macOS virtio-fs stall. Unlinking a FIFO without a peer could block the virtio-fs worker. The bundled libkrun carries a patch that opens such inodes non-blocking. It applies to macOS only.
For contributors: the dev Dockerfile already installs a checksum-verified golangci-lint v2.15.0, matching CI. That isn't new in 2.7.
Upgrading
- Update jailoc, then run
jailoc restart <workspace>for each workspace. The restart ends running sessions. It brings the new broker, runtime and session environment (cache variables, Claude Code settings). If the running broker can't apply the network rules you configured,jailoc reloadandjailoc uprefuse to update the policy and ask for a restart. - Check
jailoc trafficfordropped ... private address outside internal_zoneslines. Add zones for internal names you trust, or runjailoc migrateif your config still usesallowed_hosts. - After that, edits to
httprules apply withjailoc reload. New connections follow them. Established connections, including later requests on them, keep the policy they were opened under, so restart the workspace to end that access immediately. - Use
jailoc traffic -fto see what each inspected request hit before you tighten a rule.
Read more: Configure network access, Network isolation, HTTP rules and Internal zones in the configuration reference.