Configuration Reference
Every config.toml field with its type, default, validation rule and merge behavior.
File location
| Source | Precedence |
|---|---|
--config <file> |
1 |
JAILOC_CONFIG=<file> |
2 |
~/.config/jailoc/config.toml |
3 (default) |
~is expanded and relative paths are resolved against the current directory.- The default file is auto-created with defaults on first run. A file set with
--configorJAILOC_CONFIGmust exist. - Per-workspace files, such as the CA bundle copied by
ca_bundle, live inworkspaces/<name>/next to the configuration file. - VM state under
~/.cache/jailoc-vm/is keyed by workspace name only and is shared by all configuration files: workspaces with the same name in two files control the same VM. - All fields are optional unless noted.
- jailoc ignores settings it does not know and prints a warning naming each of them. For a config-load error naming a rejected setting, see Upgrade an existing installation.
- When jailoc prints deprecation notices, it recommends
jailoc migrateafter the notices to update deprecated settings inconfig.toml.
Top-level fields
Besides the tables [vm], [base], [proxy], [defaults] and [workspaces.<name>], the configuration has one setting at the root level. Put it before the first table.
| Field | Type | Default | Description |
|---|---|---|---|
detach_keys |
string | "ctrl-b,d" |
Key sequence that detaches the terminal from an agent session. The --detach-keys flag of jailoc overrides it. |
Syntax of detach_keys:
- A comma-separated list of keys, typed one after another, in the format of
docker attach --detach-keys. - A key is one of:
ctrl-<letter>(lowercase)ctrl-@,ctrl-[,ctrl-\,ctrl-],ctrl-^,ctrl-_DEL- a single character other than a comma
Behavior while a session is attached:
- jailoc holds back input that starts like the sequence until the next key decides.
- Typing the first key twice sends it once to the agent, as in tmux.
- Keys match also when the agent switches the terminal to an extended keyboard mode (xterm modifyOtherKeys or the kitty keyboard protocol). Key release and repeat events, presses of a modifier key alone, and Caps Lock or Num Lock do not break the sequence.
detach_keys = "ctrl-a,d"
[vm]
Host runtime of the workspace VMs. All fields are optional.
| Field | Type | Default | Description |
|---|---|---|---|
runner |
string | (embedded or package-provided) | Path to a jailoc-vm-runner (or go-microvm-runner) binary. Must be absolute; supports ~ expansion. |
lib_dir |
string | (none) | Directory containing libkrun and libkrunfw for a configured runner. Must be absolute; supports ~ expansion. |
builder |
string | "auto" |
Where workspace images are built: "auto", "docker" or "vm". |
builder_disk |
string | "20g" |
Size of the data disk of the shared builder VM, at least 1g (checked when the shared builder VM starts, not by validation). The disk can grow but not shrink. |
runner: runtime selection order
- A configured
runner. - A runtime provided by the package (for example, the Nix package on Linux, which references its runner and libraries in the Nix store).
- The VM runtime (
jailoc-vm-runner,libkrun,libkrunfw) embedded in release builds for darwin/arm64, linux/amd64 and linux/arm64, unpacked into~/.cache/jailoc-vm/runtime/on first use.
Builds with none of these (other platforms, builds from source) require runner and lib_dir.
lib_dir: when it applies
- Ignored when
runneris empty, including with a package-provided runtime, which always uses its own library directory. - When empty with a configured
runner, jailoc uses/opt/homebrew/libon macOS if it exists, otherwise the system library path. This fallback applies only to a configuredrunner.
builder: values
| Value | Where the image is built |
|---|---|
"auto" |
The host Docker daemon when it answers and runs Linux on the host's CPU architecture, otherwise the shared builder VM. With an external ca_bundle selected, always the shared builder VM. |
"docker" |
The host Docker daemon; it is required. Rejected with an external ca_bundle selected. |
"vm" |
The shared builder VM, always. |
A workspace with isolated_build = true always uses its own builder VM, whose data disk follows the workspace's docker_disk, not builder_disk.
With an external ca_bundle selected, "docker" is rejected also when isolated_build = true. Without one, the table above applies.
builder_disk: details
- It sizes the data disk (
docker.img) of the shared builder VM in~/.cache/jailoc-vm/builder. The format and limits are incpu,memoryanddocker_disk. - A value larger than the existing disk grows it, and the file system grows with it, keeping its content. A smaller value makes
jailoc upfail; the disk never shrinks. - jailoc maintains the cache of a builder VM it owns, and never prunes the host Docker daemon. See Builder cache maintenance.
- A builder whose disk is already full can't prune itself. See Builder VM disk is full.
Example
[vm]
runner = "~/.local/bin/go-microvm-runner"
lib_dir = "/opt/homebrew/lib"
builder_disk = "40g"
[base]
Global base image settings. Controls the base image used when no workspace or default image is set. See Image Resolution.
| Field | Type | Default | Description |
|---|---|---|---|
dockerfile |
string | (none) | Local path (/..., ~/...) or HTTP(S) URL to a Dockerfile for the base image. |
ubuntu_mirror |
string | "http://cz.archive.ubuntu.com/ubuntu" |
HTTP URL of the Ubuntu archive the embedded images install apt packages from. |
dockerfile details:
- When set, it takes priority over the embedded Dockerfile.
- Build failure is fatal.
- A local file is a build input when the base cascade is used (no workspace
imageand nodefaults.image); it must stay out of read-write shares. See Build inputs and read-write shares. - Maximum file size for HTTP sources: 1 MiB.
ubuntu_mirror details:
- Passed as the
UBUNTU_MIRRORbuild argument to the embedded Dockerfile and the Docker layer (enable_docker). It replacesarchive.ubuntu.com,security.ubuntu.comandports.ubuntu.comin/etc/apt/sources.list.d/ubuntu.sources. - The embedded base image keeps the replaced sources, so
apt-get installin the workspace VM uses the mirror too. - Images from
[base] dockerfileandimagekeep their own apt sources; workspace Dockerfiles built on the embedded base image inherit the mirror. - The mirror must carry the packages of the host architecture (arm64 or amd64) for the
resolute,resolute-updates,resolute-backportsandresolute-securitysuites. - Validation:
httpscheme, non-empty host, no query, fragment, whitespace, quotes,&or\. httpsis rejected: the embedded images have no CA certificates before their firstapt-get install. apt verifies the downloaded indexes and packages with the archive's GPG signatures."http://archive.ubuntu.com/ubuntu"installs from the main Ubuntu archive, security updates included.
Example
[base]
dockerfile = "https://example.com/Dockerfiles/custom"
[base]
ubuntu_mirror = "http://de.archive.ubuntu.com/ubuntu"
[proxy]
Host ports of the HTTPS proxy for proxy routes. All keys are optional; the table is global and not set per workspace.
| Field | Type | Default | Description |
|---|---|---|---|
http_port |
integer | 80 |
Port browsers use for plain HTTP, and the loopback port that receives the redirect to HTTPS. The listener broker binds it; a proxy without the broker binds it itself. |
https_port |
integer | 443 |
Port browsers use for HTTPS, and the loopback port that serves it. The listener broker binds it; a proxy without the broker binds it itself. A value other than 443 appears in every route URL. |
dns_port |
integer | 5399 |
Loopback port (127.0.0.1) of the proxy's DNS responder, which answers jailoc.local and every name below it with loopback addresses. The proxy binds it itself, as your user, with or without the broker. |
- Each port is 1 to 65535, and the three must differ.
- With the installed listener broker, a root service binds
http_portandhttps_porton127.0.0.1and[::1]and hands each connection to the proxy over a Unix socket; there is no TCP hop between them.jailoc proxy installwrites the ports into the broker service, anddns_portinto the host's name resolution (the/etc/resolver/jailoc.localfile on macOS, thejailoc0link on Linux with systemd-resolved). After changing any of the three, runjailoc proxy installagain and restart the proxy (jailoc proxy stop, thenjailoc proxy). The proxy fixes its ports for its lifetime, and refuses a broker that serves other ports. - Without the broker, the proxy runs as your user and binds
127.0.0.1onhttp_portandhttps_port. A user can't bind the reserved ports 80 and 443 on most hosts, so a standalone proxy needs unprivileged ports, such ashttp_port = 8080andhttps_port = 8081. Browsers and the proxy then use the same ports, and nothing needs forwarding. After changing the ports, restart the proxy, and update a manual resolver file or link whendns_portchanged. See set up the host manually.jailoc proxy --listenoverrides only the HTTPS bind address. - When the
dns_portport is already in use, the proxy prints a warning and keeps serving HTTP and HTTPS. Names that resolve through the DNS responder then don't resolve until the port is free and the proxy restarts. See name resolution.
[proxy]
http_port = 8080
https_port = 8081
dns_port = 5399
[defaults]
Defaults applied to all workspaces. A workspace can override or extend them; see [workspaces.<name>] and Merge Semantics.
Agent and image fields
| Field | Type | Default | Description |
|---|---|---|---|
backend |
string | "vm" |
Accepted values: "vm" or empty. All other values are rejected. |
agent |
string | "opencode" |
Coding agent of the workspaces. Values below. See Coding agents. |
agents |
table | {} |
Settings per coding agent and custom agent definitions, keyed by agent name. See agents. |
image |
string | (none) | Pre-built image used as the base for workspace Dockerfile builds, or used directly when no workspace dockerfile is set. |
agent values: "opencode", "opencode1", "opencode2", "claude", "copilot", "omo", "pi", "agy" or a custom agent.
Environment, mounts and snapshots fields
| Field | Type | Default | Description |
|---|---|---|---|
env |
string[] | [] |
Environment variables for every session, in KEY=VALUE format. |
env_file |
string[] | [] |
.env files loaded for all workspaces. Each file must exist at config load time. |
mounts |
string[] | [] |
Additional directory shares, host:container[:mode]. See mounts. |
snapshots |
string[] | [] |
Read-only snapshots of host files or directories. See snapshots. |
secrets |
table | {} |
Secrets for all workspaces. See secrets. |
Network and port fields
| Field | Type | Default | Description |
|---|---|---|---|
network |
table | {} |
IPv6 and DNS settings of the network broker. See [defaults.network]. |
allowed_hosts |
string[] | [] |
Hostnames whose A and AAAA records are allowed through the network broker even when they resolve to private addresses. Deprecated: its hostnames become an allow rule and internal zones. |
allowed_networks |
string[] | [] |
IPv4 and IPv6 CIDR ranges allowed through the network broker. |
ports |
(int | string)[] | [] |
Guest ports published on host 127.0.0.1. See ports. |
host_ports |
(int | string)[] | [] |
Host 127.0.0.1 ports or Unix sockets reachable from the guest. See host_ports. |
ca_bundle |
bool | string | true |
CA bundle added to the VM's system trust store. See ca_bundle. |
Host integration fields
| Field | Type | Default | Description |
|---|---|---|---|
ssh_auth_sock |
bool | false |
Relay the host SSH agent ($SSH_AUTH_SOCK) into the VM at /run/ssh-agent.sock and copy ~/.ssh/known_hosts into it. |
gpg_agent |
bool | false |
Relay the host gpg-agent extra socket into the VM. Requires gpg in the image. |
git_config |
bool | true |
Copy the host Git configuration read-only into the VM. See git_config. |
import_agent_config |
bool | true |
Copy the coding agent's host configuration read-only into the VM. See import_agent_config. |
timezone |
string | (host zone) | Time zone of the workspace VM, an IANA name such as "UTC" or "Europe/Prague". Omitted: the host's local zone. See timezone. |
notifications |
string | "auto" |
How an attached OpenCode session tells you that the agent finished or needs input while its terminal is not focused: "auto", "native", "osc" or "off". See notifications. |
gpg_agent details:
- The relay socket is
/run/user/<uid>/gnupg/S.gpg-agentin the VM. - jailoc imports into the VM keyring the public key of
user.signingKey, or the public keys of all host secret keys whenuser.signingKeyis unset.
git_config copies these host files: ~/.gitconfig, and config, ignore and attributes from $XDG_CONFIG_HOME/git (default ~/.config/git), plus the files they reference under the home directory.
import_agent_config copies, for example, ~/.claude/CLAUDE.md or ~/.config/opencode.
VM resource and Docker fields
| Field | Type | Default | Description |
|---|---|---|---|
cpu |
float | 2.0 |
vCPUs of the workspace VM, rounded up. |
memory |
string | "4g" |
Memory of the workspace VM, at least 512m. |
docker_disk |
string | "20g" |
Size of the Docker data disk of an enable_docker workspace and of its isolated_build builder VM, at least 1g. The disk can grow but not shrink. |
state_disk |
string | "10g" |
Size of the state disk (state.img) that holds the agent's persistent home directories, at least 1g. The disk can grow but not shrink. See Persistent state. |
cache_disk |
string | "20g" |
Size of the cache disk (cache.img) that holds ~/.cache, at least 1g. The disk can grow but not shrink. See Persistent state. |
tmp_storage |
string | "ram" |
Backing of the guest /tmp: "ram" or "disk". Needs jailoc restart. See tmp_storage, tmp_size and tmp_ttl. |
tmp_size |
string | "1g" |
Capacity of /tmp, at least 16m with tmp_storage = "disk". Needs jailoc restart. |
tmp_ttl |
string | "8h" |
Age after which /tmp entries are removed, or "0" to keep them. Applied by jailoc reload. |
enable_docker |
bool | false |
Run a Docker daemon inside the workspace VM. See enable_docker. |
desktop |
table | {} |
Run a desktop, optionally with Google Chrome, in the workspace VM. See [defaults.desktop]. |
Git protection and build fields
| Field | Type | Default | Description |
|---|---|---|---|
protect_git |
bool | false |
Make Git hooks and configuration read-only inside the VM, and disable sudo and Docker there. See protect_git. |
isolated_build |
bool | false |
Build the workspace image in a builder VM of its own. |
build_context |
string | (none) | Build context for the dockerfile overlay builds of all workspaces. A workspace build_context overrides it. |
protect_git = true together with enable_docker = true is rejected. The protected files, the repositories searched and the failure conditions are in protect_git.
build_context details:
- Build context for workspaces with a
dockerfilebut nobuild_contextof their own. If neither value is set, the context is the Dockerfile's parent directory (local path) or an empty temporary directory (URL). - As with a workspace
build_context,~/refers to the host home directory and relative paths are resolved from the directory where you runjailoc. Use an absolute path or~/to share the same directory regardless of where you run the command. [base] dockerfilebuilds and images used as is (image) don't use it. A workspaceimageignores it; only abuild_contextset in the same workspace asimageis a validation error.
isolated_build details:
- The workspace image is built in a builder VM of its own, with its own build cache and the workspace's network policy, instead of the host Docker daemon or the shared builder VM.
- The build does not inspect HTTPS:
allowrules with anhttptable open their hosts and ports for all methods and paths, anddenyrules withhttpdon't apply. - With an external
ca_bundleselected, the workspace's builder VM gets the bundle, and[vm] builder = "docker"is still rejected.
Example
[defaults]
agent = "claude"
image = "myregistry.example.com/myteam/agent-base:v1.2.3"
env = ["GOPRIVATE=*.example.com"]
env_file = ["~/.config/jailoc/shared.env"]
allowed_hosts = ["internal-registry.example.com"]
allowed_networks = ["10.0.0.0/8", "fd12:3456::/48"]
ssh_auth_sock = true
cpu = 4.0
memory = "8g"
[defaults.agents.claude]
args = ["--model", "sonnet"]
[defaults.network]
Network settings of the workspace VM and its network broker. [workspaces.<name>.network] takes the same fields; a set workspace field wins.
| Field | Type | Default | Description |
|---|---|---|---|
ipv6 |
bool | false |
Give the guest IPv6 (fd00:127::2/64) and let the broker allow IPv6 destinations by the IPv6 policy. |
dns |
string | (host resolver) | Routable numeric IPv4 resolver used for permitted DNS queries. |
rules |
table[] | [] |
Allow and deny egress rules ([[<scope>.network.rules]]). Combined across [defaults] and the workspace; deny always wins over allow. |
internal_zones |
string[] | [] |
DNS zones whose names may resolve to private addresses. Combined across [defaults] and the workspace. See Internal zones. |
agent_endpoints |
string[] | (unset) | Hosts of the agent rule for OpenCode, OmO and pi workspaces: the model and auth endpoints the agent may reach. Unset or []: no agent rule for them. A set workspace list replaces the defaults list. Ignored for Claude Code, Copilot CLI and Antigravity. |
upstream_proxy |
table | (none) | Chain allowed TCP egress through an HTTP proxy with CONNECT. See [defaults.network.upstream_proxy]. A set workspace table replaces the defaults table as a whole. |
ipv6 details:
- On: the guest has IPv6 and the broker applies the IPv6 policy.
- Off: the guest has IPv4 only and the broker denies every IPv6 flow.
- Changing it needs
jailoc restart.jailoc reloadturns it off at the broker right away, except in a VM started by a jailoc release without this setting: that VM keeps IPv6 untiljailoc restart.
agent_endpoints details:
- Entries are host names or
*.domainwildcards; IP addresses, CIDRs and*are rejected. - Applies to the multi-provider agents
opencode,opencode1,opencode2,omoandpi(and custom agents builtfromthem).claude,copilotandagyalways get their built-in endpoints; narrow them with adenyrule. - The setup wizard and
jailoc migrateset it to the endpoints of the model providers you select (seerule=agent). Adding a workspace whose agent, set or inherited, is OpenCode, OmO or pi with the wizard asks for providers and writes the workspace list only when neither the workspace nor[defaults.network]sets one, and keeps an existing list. Endpoints of providers you did not select show as denied injailoc traffic. - Unset for a workspace whose agent is OpenCode, OmO or pi: there is no
agentrule, so the agent reaches its model and auth endpoints only through your other allow rules, and the config load prints a warning.
internal_zones details: each zone covers itself and every name under it (corp.example covers gitlab.corp.example; a leading *. is dropped).
[[<scope>.network.rules]]
| Field | Type | Default | Description |
|---|---|---|---|
allow |
string[] | (none) | Hostnames, *.wildcard names, IP addresses, CIDRs, or "*" (public internet). Exactly one of allow or deny is required. |
deny |
string[] | (none) | Hostnames, *.wildcard names, IP addresses, CIDRs, or "*". Exactly one of allow or deny is required. |
proto |
string | "tcp" |
"tcp", "udp", or "any". |
ports |
(int | string)[] | (all) | Port numbers (1 to 65535) or "a-b" port ranges. |
name |
string | "" |
Label shown in jailoc traffic (rule=<name>) and validation errors. |
http |
table | (none) | Inspect HTTP requests to the matched destinations and apply methods and paths per request. Allowed on allow and deny rules; requires proto = "tcp". See HTTP rules. |
log |
bool | true |
false hides the events this rule decides from jailoc traffic unless --all is given. Valid on allow and deny rules, with or without http. See Quiet rules. |
Quiet rules
log = false only changes what jailoc traffic shows: the broker still enforces the rule and records every event in its log, marked "quiet": true. jailoc traffic --all and --json --all show them.
The mark covers the events the rule itself decides:
- the connection (allowed or denied by the rule) and the TLS or HTTP line of that connection;
- a request an
httprule allows or denies, and a request allowed through a connection the rule allowed.
Events that stay visible:
- Denials for any other reason, such as
http-no-match,bad-path,host-mismatch,sni-requiredordefault-deny. - Failures:
inspect-error,502upstream errors, and DNS events. - A request that a different rule denies, on a connection allowed by a quiet rule.
A running workspace needs jailoc restart instead of jailoc reload to apply the first log = false rule when its network broker was started by an older jailoc.
HTTP rules
A rule with an http table decides per HTTP request instead of per connection. The broker decrypts TLS for the flows such a rule covers (see TLS inspection). Rules without http are plain rules.
| Field | Type | Default | Description |
|---|---|---|---|
http.methods |
string[] | (any) | Request methods. "*" matches any method. Values are normalized to upper case and must consist of RFC 9110 token characters. |
http.paths |
string[] | (any) | Request path patterns, matched case-sensitively against the path without the query string. |
httptakes any target anallowordenyrule takes: names,*.wildcard,"*", IP addresses and CIDRs. Withoutportsit covers all ports.httprequiresproto = "tcp"(the default).proto = "udp"or"any"withhttpfails config load.- An empty table (
http = {}) is valid and matches every request.
[[workspaces.api.network.rules]]
name = "github-readonly"
allow = ["api.github.com"]
http.methods = ["GET", "HEAD"]
http.paths = ["/repos/seznam/*"]
[[workspaces.api.network.rules]]
name = "no-writes"
deny = ["registry.example.com"]
http.methods = ["DELETE", "POST", "PUT", "PATCH"]
Path patterns
A pattern starts with / and is split into segments at /.
| Segment | Matches |
|---|---|
| literal | exactly that segment |
* |
exactly one non-empty segment |
** |
zero or more remaining segments; allowed only as the last segment |
Examples:
/repos/*matches/repos/a. It does not match/repos,/repos/or/repos/a/b./repos/**matches/repos,/repos/,/repos/aand/repos/a/b.- A trailing
/is a trailing empty segment and matches literally.
A pattern is rejected at config load when it:
- does not start with
/; - has a partial wildcard (
foo*); - has
**anywhere but last; - has an empty segment in the middle (
//); - has a
.or..segment; - contains
?,#,%,\or a control character.
A method with a character outside the RFC 9110 token set and http with a proto other than tcp are rejected as well.
Request path checking
When the path is checked. The broker checks and matches the path only when a path pattern takes part in the decision: some http rule in the connection's scope (allow or deny) lists paths and covers the request's method. Otherwise the path is not evaluated, and an odd path such as //x or /a%5Cb is never denied as bad-path.
How patterns match. When patterns apply, the broker matches them against the percent-decoded segments of the request path, taken between literal /. An encoded slash does not split a segment: * matches @scope%2Fname (decoded @scope/name) as one segment, a literal never does, because a pattern segment cannot contain /.
bad-path denial. A request is denied with reason bad-path when its path:
- does not start with
/, or contains//or\; - contains an encoded backslash or NUL (
%5c,%00, any case); - has a segment that fails percent-decoding, or contains a control character;
- has a segment that is, or after splitting on its encoded slashes contains, a
.or..piece (..,%2e%2e,x%2F..%2Fadmin) or an empty piece (%2Fadmin,a%2F,a%2F%2Fb).
deny and allow see different paths.
| Rule | Path the pattern sees |
|---|---|
deny |
The raw segments, and also the path with encoded slashes decoded and split again, so /a/b denies /a%2Fb as well as /a/b. |
allow |
The raw segments only. |
Warning
A server that decodes %2F before routing sees more segments than an allow pattern's * matched. Use deny rules for paths that must stay unreachable.
Evaluation
deny rules with http. They never deny a connection and never block DNS; they act on requests only. For every other decision step the rule counts like a plain rule: an allow rule with http lets the connection reach the TLS or HTTP stage, a plain deny rule denies it first.
Inspection scope. The broker inspects a TCP connection when an http rule (allow or deny) matches its port and, after the TLS server name or HTTP Host is known, its name or address. These rules form the http scope of the connection: the http rules that match the server name together with those that match the destination address. An empty scope leaves the connection to plain rules and undecrypted.
Connections without a name (TLS without SNI, HTTP/1.0 without Host):
- They are judged by the
httprules that match their destination address (an IP or CIDR target, or*). Without such a rule the connection is handled as if nohttprule existed. - With such a rule the connection is inspected under the destination's IP address as its name:
- the broker's certificate carries the IP as a subject alternative name;
- the upstream certificate must be valid for the IP;
- every request's
Hostmust be the IP (an HTTP/1.0 request withoutHostcounts as such).
- A connection without a name whose TLS offers no HTTP protocol in ALPN is handled like one with a name (see Protocol detection): the plain rules decide, and it is inspected under the IP only when an
httprule matches the address. - IPv6 literals in
Hostor:authorityare compared by address, so the compressed and expanded forms are the same host. - Connections that name rules require a name for (a connection allowed by a name, a plain
denyrule with names) still fail withsni-requiredwithout one.
Connections that were not inspected. They stay checked: if a later request on the connection names a host that an http rule covers, the request is refused with reason inspection-required.
http allow rules narrow their host. When the scope has http allow rules, only they decide the requests, and plain allow rules matching the same host and port grant nothing for it.
Order of checks for each request:
- The request host (
Hostor:authority, port stripped) must equal the connection's server name, otherwise421with reasonhost-mismatch. CONNECTand HTTP/2 extendedCONNECTare denied with reasonconnect-denied.- When a path pattern applies to the method (see request path checking), a bad path is denied with reason
bad-path. - A matching
httpdeny rule (method and path both match) denies the request withrule=<name>. - If the scope has
httpallow rules, one must match both method and path, otherwise the request is denied with reasonhttp-no-match. If the scope has none, a plain allow rule allowed the connection and the request passes.
Warning
The http allow rules of the scope are a union, whether they match by name or by address, and any one of them can allow a request. An http allow rule on an IP or CIDR (for example GET only) is not a ceiling when the connection presents a name that another http allow rule (for example POST) matches: the address authorizes the connection, so the presented name doesn't have to resolve to the destination, and the request can use the named rule's methods and paths. Use an http deny rule, which is checked before the allow rules, as a hard cap.
Responses and reasons
| Outcome | Status | Body |
|---|---|---|
| Denied request | 403 Forbidden |
blocked by network policy (rule=<name>) for a deny rule, blocked by network policy (reason=<reason>) otherwise |
| Host does not match the server name | 421 Misdirected Request |
blocked by network policy (reason=host-mismatch) |
| Upstream failure (connect or certificate verification) | 502 Bad Gateway |
the error |
| Reason | Meaning |
|---|---|
http-no-match |
The scope has http allow rules and none matched the method and path. |
bad-path |
The request path failed checking. |
connect-denied |
The request is a CONNECT or an HTTP/2 extended CONNECT. |
host-mismatch |
The request host differs from the TLS server name or Host of the connection. |
inspection-required |
A request on an uninspected connection names a host that an http rule covers. |
Protocol detection
Protocol detection decides per connection whether HTTP is served.
TLS, ClientHello ALPN offers h2 or http/1.1: decrypted, HTTP served.
TLS, ALPN offered but neither is HTTP:
- Plain rules decide; an
httprule alone never opens it. - Allowed and covered by an
httprule (by name, or by address when there is no name): decrypted, offering the guest's ALPN list, and handled like TLS without ALPN. HTTP inside is checked by thehttprules; anything else is relayed to a verified upstream connection that is offered the negotiated protocol, so the client must trust the inspection CA. - Allowed and covered by no
httprule: not decrypted, spliced.
TLS, no ALPN: decrypted; the first line decides.
- A request line (
method SP target SP HTTP/x.y, any method token in any case) or the HTTP/2 preface is served as HTTP. - Anything else is decided by plain rules and relayed (denied: closed,
inspect-error). - A first line that looks like a request but is not valid closes the connection with reason
malformed-request-line, also when it comes after the 1 s peek. Not valid means: a method followed by two spaces or any other whitespace, leading whitespace or empty lines, trailing whitespace after the version, any line ending inHTTP/x.y. - A first line that starts with a word and whitespace is read to its line end before it is judged, because a lenient server accepts any whitespace as a separator.
- A first line over 8 KiB that is no request line, or an undecided partial line when the 1 s peek ends, closes the connection.
- If the guest sends nothing for 1 s the connection is relayed (server-first protocols), but a request line or preface the guest sends later closes it before anything is forwarded.
Plain HTTP request: checked per request, no TLS. A request line that is not valid but looks like one (any whitespace separator, leading empty lines, extra words) is denied, not relayed.
Cleartext HTTP/2 (prior knowledge, h2c): served per request.
- Each
:authorityis decided like a server name (it must resolve to the destination, or be its IP), then thehttpscope of that name applies. - A request without
:authorityis denied (sni-required). - Requests are forwarded upstream as prior-knowledge HTTP/2, so the upstream must speak
h2c.
No server name or Host (silent, server-first or other protocols): plain rules decide; http rules never open non-HTTP traffic; denied connections are reset.
WebSocket and h2c upgrades:
- A WebSocket upgrade request is checked like any request. After the
101response the connection passes through unfiltered; frames are not inspected. - An
Upgrade: h2coffer is removed from the request, which is then sent as plain HTTP/1.1, so a connection can't be switched to HTTP/2 past the per-request checks.
Request bodies and upstream connections
Request bodies:
- Bodies with a known length of up to 1 MiB are buffered in memory (64 MiB in total across a workspace's flows) so the broker can resend them on a new upstream connection, for example after an HTTP/2
GOAWAY. - Larger and chunked bodies stream through, and so do HTTP/1.1 bodies sent with
Expect: 100-continue, which wait for the upstream's100 Continue. - For HTTP/2 guests the broker answers
100 Continueitself and does not passExpectupstream.
Upstream certificate and proxies:
- The broker verifies the upstream certificate against the host's system roots plus the file named by
ca_bundlewhen it is a path. A failure ends the request with502. - The broker does not use
HTTP_PROXY. It chains through a proxy only whenupstream_proxyis configured.
Note
Inspection adds the workspace's inspection CA to the guest trust stores, also with ca_bundle = false. See TLS inspection.
Implicit rules and built-in broker behavior
In addition to [[defaults.network.rules]] and [[workspaces.<name>.network.rules]], the broker applies the rules below.
rule=agent
Allow, proto = "tcp", ports = [443], to the coding agent's model and auth endpoints. A matching deny rule still overrides it.
opencode,opencode1,opencode2,omo,pi: the hosts inagent_endpoints; added only when the list is non-empty. The setup wizard andjailoc migrateask which model providers to allow (all selected by default;--yestakes all) and write the endpoints of those providers. The endpoints come from the agent being configured, so a list written for OpenCode lacks the extra login hosts ofpi.claude,copilot,agy: the built-in endpoints below;agent_endpointsdoes not apply.
Endpoints per agent:
opencode,opencode1,opencode2,omo, per model provider:anthropic:api.anthropic.comopenai:api.openai.com,auth.openai.com,chatgpt.comgoogle:generativelanguage.googleapis.com,oauth2.googleapis.comgithub-copilot:api.githubcopilot.com,*.githubcopilot.comopenrouter:openrouter.aiopencode:opencode.ai,*.opencode.ai
pi, per model provider (the extra hosts are the Claude Pro/Max token exchange and the GitHub device login):anthropic:api.anthropic.com,platform.claude.comopenai:api.openai.com,auth.openai.com,chatgpt.comgoogle:generativelanguage.googleapis.com,oauth2.googleapis.comgithub-copilot:github.com,api.github.com,api.githubcopilot.com,*.githubcopilot.comopenrouter:openrouter.aiopencode:opencode.ai,*.opencode.ai
claude:api.anthropic.comclaude.aiconsole.anthropic.complatform.claude.com
copilot:api.github.comgithub.comapi.githubcopilot.com*.githubcopilot.comcopilot-proxy.githubusercontent.com
agy:generativelanguage.googleapis.comcloudcode-pa.googleapis.comoauth2.googleapis.comaccounts.google.com
Other built-in behavior
rule=legacy(proto = "any"): synthesized in memory when deprecatedallowed_hosts,allowed_networksordns_blocked_zonesare set.-
DoT and QUIC exclusion on
"*": a wildcard rule (allow = ["*"]) without explicitportsexcludes- TCP port
853(DNS over TLS), and - UDP port
443(QUIC/HTTP/3),
so DNS stays on the gateway resolver and HTTPS clients fall back to TCP port
443(where TLS SNI is inspected whenever hostname rules or hostnamedenyrules apply on that port). Listing those ports inportsopens them. - Direct DNS block: TCP and UDP port53to any address other than the gateway (192.168.127.1) is denied (reason=dns-filtered). - Anallowrule opens it only when it lists port53inportsand matches the resolver by IP, CIDR, hostname or"*"(public resolvers only). A rule withoutports, includingallow = ["*"], never opens it. - The broker answers allowed direct queries itself: it sends each query only to that resolver, and applies the same name filtering, NXDOMAIN andHTTPS/SVCBhandling as the gateway resolver. - It does not add the answers to its IP-to-name cache, so connections to the returned addresses match hostname rules only through names the gateway resolver returned. -jailoc trafficshows these queries with@<resolver>. - Gateway services (192.168.127.1): the broker serves - DHCP, - DNS (port53), - SNTP clock sync (UDP port123), - SSH/GPG agent relays (ssh_auth_sock,gpg_agent), - configuredhost_portson the gateway.All other connections to the gateway, guest subnet (
192.168.127.0/24,fd00:127::/64), host interface addresses, and hard-denied ranges are always denied. - Defaultdev-depsrule in new configs: when jailoc creates a missing~/.config/jailoc/config.toml, it writes an explicit[[defaults.network.rules]]entry nameddev-depsinto the file. The rule allows GitHub, GitLab.com, npm, Yarn, Node.js, Bun, PyPI, Astral, Go proxy, crates.io, Rustup, Docker Hub, GHCR, Quay, GCR, MCR, Ubuntu/Debian/Alpine mirrors, and Nix caches. Removing or editing that block inconfig.tomlremoves or changes those rules. - TCP port
Internal zones
A hostname rule opens a private address (RFC 1918, CGNAT, link-local, IPv6 unique local and the other denied ranges) only for names in internal_zones. A zone only marks whose DNS answers are trusted; it opens nothing by itself, so the names still need an allow rule.
- DNS: the broker drops
AandAAAArecords with a private address from an answer unless the queried name, the record owner and everyCNAMEin the answer are in an internal zone.- A public name with a
CNAMEinto an internal zone, or a chain that passes through a public name, is dropped too. - Dropped addresses never reach the guest or the IP-to-name cache, and
jailoc trafficshows them asdropped <address>: private address outside internal_zones.
- A public name with a
- Connect time: a hostname rule matches a private destination only through a cached name in an internal zone. Otherwise the flow is denied with
reason=not-internal-zoneand the name of the rule that matched. The check covers the whole DNS chain of the cached name and uses the current policy, so removing a zone withjailoc reloadcloses its cached names at once. - Other rules: IP and CIDR rules are unaffected,
denyrules still win, and"*"never opens private addresses. Loopback and other hard-denied answers are left in DNS answers; the broker never connects to them. - Validation: a zone must be a domain name.
- Rejected:
"*"; top-level domains and other public suffixes (com,co.uk,github.io); wildcard DNS services that resolve names to any address (nip.io,sslip.io,xip.io,localtest.me,lvh.me,traefik.me,vcap.me,local.gd). - Allowed: top-level names without a public registry, such as
internal,corp,lan, andhome.arpa.
- Rejected:
- Legacy
allowed_hosts:- Its hostnames are trusted as internal zones in memory, and
jailoc migratewrites them tointernal_zones, so they keep resolving to private addresses. - jailoc does not resolve these hostnames on the host into CIDR rules, so they reach private addresses only through the broker's DNS, which asks the upstream resolvers and doesn't read the host's
/etc/hosts. - A hostname that is a
CNAMEalias of a name outside the internal zones and resolves to a private address does not resolve in the VM.jailoc up,reloadandmigratewarn about it, and you add the zone of the canonical name tointernal_zones.
- Its hostnames are trusted as internal zones in memory, and
- Running VMs after an upgrade: the network broker of a workspace VM started by a jailoc release without internal zones keeps the old behaviour, so
jailoc reloadandjailoc uprefuse to update its network policy and ask forjailoc restart.
[defaults.network]
internal_zones = ["internal.example.com"]
[[workspaces.api.network.rules]]
name = "gitlab"
allow = ["gitlab.internal.example.com"] # 10.20.5.10: opened
[[workspaces.api.network.rules]]
name = "saas"
allow = ["*.vercel.app"] # a private answer is dropped
[defaults.network.upstream_proxy]
Sends the TCP flows the network rules allow through an HTTP proxy with CONNECT, for example a corporate proxy or a host proxy that applies its own policy per workspace. The table is read only from the host config.toml and applies only to the VM backend. [workspaces.<name>.network.upstream_proxy] takes the same fields.
| Field | Type | Default | Description |
|---|---|---|---|
url |
string | (none) | http://host[:port] (port 80 by default, no path, userinfo, query or fragment) or unix:///absolute/path. Other schemes and relative socket paths are rejected, and the socket path is at most 103 bytes. Cannot be combined with command. |
command |
string | (none) | Host helper that returns the proxy per workspace; see Helper contract. Cannot be combined with url or auth. |
ca |
string | (none) | Absolute or ~ path to a PEM file with extra roots for a proxy that re-signs TLS. Merged with the helper's ca. |
direct |
string[] | [] |
Allowed flows that bypass the proxy; see Routing. Merged with the helper's direct. |
enabled |
bool | true |
false in a workspace table turns the upstream proxy off for that workspace. |
auth |
table | (none) | Basic credentials for a url proxy. |
One of url or command is required unless enabled = false. A workspace's upstream_proxy table replaces the defaults table as a whole, so a url of one scope never mixes with a command of the other.
[<scope>.network.upstream_proxy.auth]
| Field | Type | Description |
|---|---|---|
username |
string | Basic auth user name. Required. |
from_env |
string | Host environment variable with the password. |
from_file |
string | Host file with the password. |
from_command |
string | Host command whose standard output is the password. |
ttl |
string | Duration for which from_command output is cached in the host system keychain. Only with from_command. |
authis valid only with a staticurl, andusernamemust not be empty.- Exactly one of
from_env,from_fileandfrom_commandis required. The sources work as insecrets. - The configuration may name the source, but the password value never enters the broker policy, the VM specification or the guest. The broker keeps the credentials, and the headers a helper returns, in memory only.
from_envis read from the environment of thejailoc upthat starts the broker, and the broker keeps it. A value changed in your shell later takes effect afterjailoc restart.
Routing
The network rules decide first, with deny winning. direct only picks the route of a flow they allowed; a denied flow cannot be opened through direct.
directentries use the syntax ofallowentries: hostnames,*.wildcardnames,"*", IP addresses and CIDRs, each with an optional:port([fd00::1]:443for IPv6). An entry that noallowrule matches is reported when the configuration loads.- jailoc adds nothing to
directitself, so the coding agent's endpoints go through the proxy unless you list them. - Everything else applies on both routes before the connection leaves the broker:
httprules, TLS inspection, and logging (for the final destination after aCONNECTby name, see Trust, CA and builds).
| Flow | Action |
|---|---|
TCP, allowed, in direct |
Direct dial. |
TCP, allowed, not in direct |
CONNECT <name>:<port>, one tunnel per flow. The name is the hostname the matching rule found in the DNS cache, or the TLS SNI or HTTP Host of a flow the broker inspects; without a known name it is CONNECT <ip>:<port>. |
UDP, not in direct |
Denied. The broker still answers DNS and SNTP itself, and QUIC falls back to TCP. |
Proxy answers other than 2xx |
An inspected flow gets 502 with the proxy's status line, a passed-through flow is reset. The traffic log records the status. |
| Proxy unreachable | The flow fails closed, with a hint in the traffic log. |
Inbound paths (ports, the OAuth callback, the loopback relay, host_ports) don't use the proxy. There is no automatic direct route for model hosts.
The proxy address is reachable by the broker even in a private range or on a Unix socket. That is transport only: it does not allow the guest to connect to that address or range.
CONNECT headers
Every CONNECT carries, with no way to turn them off:
X-Jailoc-Workspace: the workspace name (builderfor the builder VM).X-Jailoc-Flow: the numeric connection ID of the flow injailoc trafficandbroker.jsonl.
Then come the helper's headers or the Basic Proxy-Authorization from auth. The broker builds the request; the guest cannot add to it or change it, and none of these headers reach the origin in the requests of an inspected flow. Header values are never logged, only names.
Helper contract
command runs inside the broker, under /bin/sh -c, without a TTY, with a 10 second timeout, stdin from /dev/null and stdout capped at 64 KiB. It inherits your environment, with these JAILOC_* variables set over any existing ones:
| Variable | Value |
|---|---|
JAILOC_WORKSPACE |
Workspace name. |
JAILOC_UPSTREAM_EVENT |
start, reload or stop. |
JAILOC_UPSTREAM_VERSION |
1. |
The helper gets no project path or working directory. For start and reload it prints one JSON object:
{
"version": 1,
"url": "unix:///run/user/1000/helper/myproj.sock",
"ca": "/home/me/.config/helper/ca.pem",
"direct": ["api.model-provider.example:443"],
"headers": { "Proxy-Authorization": "Bearer <per-session token>" }
}
versionandurlare required;ca,directandheadersare optional. Unknown fields are ignored and an unknownversionis refused. Invalid output fails closed.headersnames must be HTTP tokens and must not start withX-Jailoc-or override a framing header such asHostorContent-Length. Values must not contain CR or LF.caanddirectare merged with the same keys of the configuration.- A helper cannot prompt. One that needs you, for example to sign in, exits non-zero and says on stderr what to do.
| Event | When | On failure |
|---|---|---|
start |
Broker start, before the VM boots. | The VM does not boot, and jailoc prints the helper's stderr. |
reload |
jailoc reload or broker SIGHUP. |
The previous result stays in effect, and a traffic log event carries the stderr. |
start, again |
The proxy is unreachable. | Retried one at a time with backoff from 1 s to 30 s. |
stop |
The VM stops. | Best effort: stdout is ignored and a non-zero exit is only logged. A crash can skip it, so the proxy should expire idle endpoints itself. |
Trust, CA and builds
The upstream proxy enforces the final destination
The broker applies the rules to the name or address the guest asked for. With CONNECT <name>:<port> the proxy resolves the name again, and jailoc cannot pin or check the address the tunnel ends at. The proxy is therefore trusted to refuse private, reserved and internal final addresses; internal_zones, the private-range denial and the DNS rebinding checks do not reach past it. Use a proxy that enforces this, and treat a command helper as code with your host privileges.
- The public certificate in
cais trusted by the broker for the upstream side of flows it inspects, and is added to the guest's system trust store, also withca_bundle = false. Processes that already loaded the store, such as the guest Docker daemon, may need a restart. - The builder VM of
isolated_buildand the shared builder VM use only a staticurlfrom[defaults]; they never runcommand. Image builds with the host Docker daemon are not changed.
[defaults.network.upstream_proxy]
url = "http://proxy.example.com:3128"
ca = "~/certs/proxy-ca.pem"
direct = ["git.example.com:22"]
[defaults.network.upstream_proxy.auth]
username = "jdoe"
from_command = "pass show proxy"
ttl = "8h"
[workspaces.offline-lab.network.upstream_proxy]
enabled = false
Example
[defaults.network]
ipv6 = true
dns = "9.9.9.9"
[[defaults.network.rules]]
name = "dev-deps"
allow = ["github.com", "api.github.com", "*.githubusercontent.com", "registry.npmjs.org"]
[[defaults.network.rules]]
name = "no-paste"
deny = ["pastebin.com", "gist.github.com", "*.ngrok.io"]
[[workspaces.api.network.rules]]
name = "db"
allow = ["10.20.5.10"]
proto = "tcp"
ports = [5432]
[defaults.desktop]
Desktop settings of the workspace VM. [workspaces.<name>.desktop] takes the same fields. A set workspace field wins; an unset one inherits from [defaults.desktop] field by field. Behavior and validation are in desktop; the how-to shows the setup.
| Field | Type | Default | Description |
|---|---|---|---|
enable |
bool | false |
Run the VM desktop (Xvfb, Openbox, Selkies), served by the reserved desktop proxy route. |
chrome |
bool | false |
Also run Google Chrome on the desktop, with remote debugging on guest loopback for agents. Requires enable = true. |
chrome_version |
string | the version pinned by the jailoc release (158.0.8127.107) |
Exact four-part Chrome version MAJOR.MINOR.BUILD.PATCH. Channel names aren't accepted. Requires chrome = true. |
Example
[workspaces.web.desktop]
enable = true
chrome = true
[workspaces.<name>]
Each workspace is a TOML table under [workspaces], keyed by name. Names must match ^[a-z0-9-]+$.
Workspace-only fields
| Field | Type | Default | Description |
|---|---|---|---|
paths |
string[] | [] |
Host directories shared into the VM over virtio-fs at their original absolute paths. See paths. |
dockerfile |
string | (none) | Local path (/..., ~/...) or HTTP(S) URL to an overlay Dockerfile built on top of the base image. |
proxy |
table | {} |
HTTPS proxy routes: route name to guest port (or { port, auth, https_redirect }), served at https://<name>.<workspace>.jailoc.local. See proxy. |
paths: the first path is the working directory; with no paths, the working directory is/home/agent.dockerfile: build failure is fatal. Maximum file size for HTTP sources: 1 MiB. A local Dockerfile is a build input and must stay out of read-write shares; see Build inputs and read-write shares.
Overriding fields
| Field | Type | Default | Description |
|---|---|---|---|
backend |
string | (inherit) | "vm" or empty. All other values are rejected. |
agent |
string | (inherit) | Coding agent of the workspace. See Coding agents. |
agents |
table | {} |
Settings per coding agent; a set field overrides [defaults.agents.<name>]. See agents. |
image |
string | (none) | Pre-built image used directly, bypassing all build steps. Cannot be combined with dockerfile or build_context. |
build_context |
string | (inherit) | Build context of the overlay build; wins over [defaults].build_context. |
network |
table | {} |
Same fields as [defaults.network]; a set field wins. |
desktop |
table | {} |
Same fields as [defaults.desktop]; a set field wins, an unset one inherits. |
build_context: wins over[defaults].build_context; when neither is set, the Dockerfile's parent directory (local path) or an empty temporary directory (URL). Only the overlay build of the workspace'sdockerfileuses it. A workspace-levelbuild_contextcannot be combined with the workspace'simage. The whole directory is a build input and must stay out of read-write shares;.dockerignoredoes not exempt anything.
Fields with the same meaning as in [defaults]; the workspace value wins and the default is inherited. Each takes the type of its [defaults] field:
ssh_auth_sock,gpg_agent,git_config,import_agent_configcpu,memory,docker_disk,state_disk,cache_disk,tmp_storage,tmp_size,tmp_ttl,timezone,notificationsenable_docker,protect_git,isolated_build,ca_bundle
Merged fields
| Field | Type | Default | Description |
|---|---|---|---|
mounts |
string[] | [] |
Directory shares for this workspace, merged with [defaults].mounts. |
snapshots |
string[] | [] |
Read-only snapshots, merged with [defaults].snapshots. |
allowed_hosts |
string[] | [] |
Merged with [defaults].allowed_hosts. |
allowed_networks |
string[] | [] |
Merged with [defaults].allowed_networks. |
ports |
(int | string)[] | [] |
Merged with [defaults].ports. |
host_ports |
(int | string)[] | [] |
Merged with [defaults].host_ports. |
env |
string[] | [] |
Overrides [defaults].env entries with the same key. |
env_file |
string[] | [] |
Loaded after [defaults].env_file. |
secrets |
table | {} |
Overrides default secrets with the same name. |
| See Merge Semantics for the exact rules. |
Example
[workspaces.my-project]
paths = ["~/projects/my-project", "~/shared/libs"]
allowed_hosts = ["api.example.com"]
snapshots = ["~/.npmrc:/home/agent/.npmrc"]
ports = [3000, "8080:80"]
dockerfile = "~/.config/jailoc/images/my-project/Dockerfile"
Coding agents
Each workspace runs one coding agent. By default, sessions start it in unattended mode, because the VM is the security boundary. The flags that enable unattended mode are the agent's default_args, which a configuration can replace or clear.
opencode is an alias of opencode2: it runs the same harness and shares its persistent home directories, while agents.opencode and agents.opencode2 are separate tables.
Harness and package
agent |
Agent | Package |
|---|---|---|
opencode2 |
OpenCode 2 | @opencode/cli |
opencode1 |
OpenCode 1 | opencode-ai |
claude |
Claude Code | @anthropic-ai/claude-code |
copilot |
GitHub Copilot CLI | @github/copilot |
omo |
OmO | omo-ai |
pi |
pi | @earendil-works/pi-coding-agent |
agy |
Antigravity CLI | GitHub release google-antigravity/antigravity-cli |
Default session command and flags
agent |
Session command | Continue (-c) |
Resume (-s ID) |
|---|---|---|---|
opencode2 |
opencode --standalone --auto |
--continue |
--session ID |
opencode1 |
opencode |
--continue |
--session ID |
claude |
claude --dangerously-skip-permissions --settings /etc/jailoc-tui-plugin/claude-settings.json |
--continue |
--resume ID |
copilot |
copilot --allow-all |
--continue |
--resume ID |
omo |
omo --permission-preset full-access --extension /etc/jailoc-tui-plugin/pi.js |
--continue |
--session ID |
pi |
pi --approve --extension /etc/jailoc-tui-plugin/pi.js |
--continue |
--session ID |
agy |
agy --dangerously-skip-permissions |
--continue |
--conversation ID |
Persistent home directories
agent |
Directories |
|---|---|
opencode2 |
~/.local/share/opencode, ~/.local/state/opencode |
opencode1 |
~/.local/share/opencode, ~/.local/state/opencode, ~/.omo |
claude |
~/.claude |
copilot |
~/.copilot |
omo |
~/.omo |
pi |
~/.pi |
agy |
~/.gemini |
Environment set by jailoc
agent |
Variables |
|---|---|
opencode2 |
OPENCODE_DISABLE_AUTOUPDATE=1, OPENCODE_DISABLE_MODELS_FETCH=1, OPENCODE_CLI_CONFIG_CONTENT |
opencode1 |
OPENCODE_DISABLE_AUTOUPDATE=1, OPENCODE_DISABLE_MODELS_FETCH=1, OPENCODE_TUI_CONFIG |
claude |
CLAUDE_CONFIG_DIR=/home/agent/.claude, CLAUDE_CODE_SANDBOXED=1, DISABLE_AUTOUPDATER=1, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 |
copilot |
COPILOT_AUTO_UPDATE=false |
omo |
PI_OFFLINE=1, OMO_DISABLE_TELEMETRY=1, OMO_RUNTIME=node |
pi |
PI_OFFLINE=1 |
agy |
AGY_CLI_DISABLE_AUTO_UPDATE=1 |
The update, model catalog and telemetry switches keep each agent within its agent rule: OpenCode uses the models.dev snapshot it ships, and pi and OmO use their shipped model data instead of the pi.dev catalog.
Optional default arguments
agent |
Built-in default_args |
|---|---|
opencode2, opencode |
["--auto"] |
opencode1 |
[] |
claude |
["--dangerously-skip-permissions"] |
copilot |
["--allow-all"] |
omo |
["--permission-preset", "full-access"] |
pi |
["--approve"] |
agy |
["--dangerously-skip-permissions"] |
--standalone of opencode2, and the plugin flags --settings and --extension, are not default arguments: they are always present.
Session command line: the agent binary, its always-present --standalone (for opencode2), the effective default_args, the plugin flags (--settings, --extension), the continue or resume flag, then args from agents. The default session command table shows the line with the built-in default_args.
Agent-specific behavior
- OpenCode 2 runs with
--standalone, so each session has its own server and environment instead of sharing a background service. - Every agent shows the workspace name.
OPENCODE_TUI_CONFIG,OPENCODE_CLI_CONFIG_CONTENT,--settingsand--extensionload the jailoc indicator. See Workspace indicator. - For
copilotandagy, jailoc adds astatusLineto~/.copilot/settings.jsonand~/.gemini/antigravity-cli/settings.jsonwhen it sets none. Forcopilotit also setsstoreTokenPlaintext = truein~/.copilot/settings.jsonwhen unset, so Copilot stores logins without a system keyring. - For
claude, jailoc setsbypassPermissionsModeAccepted = truein~/.claude/.claude.jsonon every VM start when the file does not set it, andCLAUDE_CODE_SANDBOXED=1makes Claude Code trust the working directory without its trust prompt. Background sessions (claude --bg, which switching sessions in Claude Code uses) start only after both, and would otherwise ask to runclaude --dangerously-skip-permissionsinteractively once.
Installation
- The package versions are pinned by the jailoc release;
versioninagentsinstalls another one. - jailoc installs the agent with
npm install -g. Foragyit downloads the release asset of the VM's architecture (x64 or arm64, glibc), checks its pinned SHA-256 and installs the binary as root into/usr/local/bin. - The agent goes into a separate layer on top of the base image, before the workspace
dockerfileoverlay, in every image jailoc builds: the base image, a[base] dockerfile, anddefaults.imagewith a workspacedockerfile. - An image used directly (workspace
image, ordefaults.imagewithout a workspacedockerfile) must contain the agent binary. - Before a session starts, jailoc checks that the binary is on
PATHin the VM.
Changing agent or the agent's profile of a running workspace takes effect after jailoc restart; sessions fail until then.
agents
Settings per agent live in [defaults.agents.<name>] and [workspaces.<ws>.agents.<name>], where <name> is a built-in agent or a custom agent. Only the settings of the selected agent apply.
| Field | Type | Default | Description |
|---|---|---|---|
from |
string | Custom agents only: the built-in agent it is derived from. | |
install |
bool | true |
Install the agent in the images jailoc builds. With false, the image must provide the binary, for example through the workspace dockerfile. |
version |
string | (pinned) | npm or release version installed instead of the version pinned by jailoc, e.g. "2.1.400". |
default_args |
string[] | (built-in) | Optional default arguments of the session command line, such as the flags that enable unattended mode. A set list replaces the built-in ones. See the built-in values under Coding agents. |
args |
string[] | [] |
Arguments appended to every session command line, after default_args. |
mounts |
string[] | [] |
Mounts added while the agent is selected. See Agent mounts. |
profile |
false or string |
(unset) | Where the agent's persistent home directories live. See Agent profiles. |
Field notes:
version: must be an exact version; dist-tags such aslatestare rejected. Foragy, jailoc reads the checksums of another version's assets from the GitHub API.default_args: an unset field inherits the value from[defaults](or the base agent for a custom agent), falling back to the built-indefault_argsof the agent's harness.default_args = []clears them, and a non-empty list replaces them. Each entry is one argument. It doesn't touch the always-present arguments (--standaloneofopencode2,--settingsand--extensionof the plugin) orargs. Each ofdefault_argsandargsis inherited independently of the other.default_argsis not a permission policy. Removing a flag doesn't prevent the agent from running without prompts: imported agent settings, or entries inargs, can still enable a permission bypass. The VM remains the boundary.args: a workspace list replaces the[defaults]list;args = []clears it.args = []removes only the extra arguments you added; the built-indefault_argsstay.default_args = []removes the built-in defaults;argsstay.- A change to
default_argsorargsapplies to sessions started afterwards (new, resumed or continued). A running attached session keeps its arguments. Neither needsjailoc restartorjailoc reload. mounts: same syntax and validation asmounts. An empty host (":/home/agent/.agents") removes a mount added by the agent or an earlier table.profilevalues: unset means per workspace;falsemeans per workspace, emptied on every VM start; a name selects the shared profile~/.local/share/jailoc/profiles/<name>.
[workspaces.my-project]
paths = ["~/projects/my-project"]
agent = "copilot"
[workspaces.my-project.agents.copilot]
version = "1.0.110"
args = ["--model", "gpt-5"]
Custom agents
An agents table whose name is not a built-in agent defines a custom agent: the built-in agent named by from under another name, with its own settings. Select it with agent like a built-in one. It is installed, started and persisted like the agent it is derived from.
[defaults.agents.claude]
version = "2.1.400"
[defaults.agents.claude-opus]
from = "claude"
args = ["--model", "opus"]
[workspaces.my-project]
paths = ["~/projects/my-project"]
agent = "claude-opus"
- A custom agent defined in
[defaults]can be selected and configured in any workspace; one defined in a workspace only there. - Each field except
mountsandprofiletakes the first value set in, in this order (default_argscounts as set when written, including[]):- the workspace's table of the agent
- the defaults' table of the agent
- for a custom agent, the workspace's table of the agent it is derived from
- for a custom agent, the defaults' table of the agent it is derived from
- In the example,
claude-opusinstalls Claude Code 2.1.400.
Agent mounts
The mounts of the selected agent are merged by guest path; a later entry replaces an earlier one with the same guest path, an empty host removes it. The order is:
- the built-in mounts of the agent's harness, including
~/.agents:/home/agent/.agents:ro mountsof the built-in agent's table in[defaults], then in the workspace- for a custom agent,
mountsof its own table in[defaults], then in the workspace [defaults].mounts, then the workspace'smounts
[defaults.agents.opencode-legacy]
from = "opencode"
mounts = ["~/.config/opencode-legacy:/home/agent/.config/opencode"]
A mount at the destination of an import_agent_config copy replaces the copy.
Agent profiles
profile selects where the agent's persistent home directories (see Coding agents) are stored. It is read from the selected agent's own tables: the workspace's, then the defaults'. A custom agent does not inherit profile from the agent it is derived from.
| Value | Storage | Lifetime |
|---|---|---|
| unset | ~/.cache/jailoc-vm/workspaces/<workspace>/state.img, in <dir> |
until jailoc down --purge |
false |
the ephemeral directory on state.img |
emptied on every VM start |
"<name>" |
~/.local/share/jailoc/profiles/<name>/<dir> |
until deleted by hand; jailoc down --purge keeps it |
<dir> is the name of the harness's state directory:
| Harness | <dir> |
|---|---|
| OpenCode 2 | opencode2-data, opencode2-state |
| OpenCode 1 | opencode-data, opencode-state |
OmO plugin's ~/.omo (with OpenCode 1) |
opencode1-omo |
| Claude Code | claude |
| Copilot | copilot |
| OmO | omo |
| pi | pi |
| Antigravity | antigravity |
- One profile can hold the state of several harnesses, and two agents of the same harness share it when they name the same profile.
~/.cachestays per workspace, oncache.img.- A mount over a persistent home directory replaces it.
- A named profile is used by one running workspace at a time:
jailoc upandjailoc restartfail while another workspace using the profile is running.
Warning
Every workspace using a named profile can change what the harness executes in the others (hooks, plugins, MCP servers, instructions stored in its state directory), read the login and resume the sessions stored there. Share a profile only between workspaces of the same trust level. See Threat Model.
[workspaces.old-project.agents.opencode]
profile = "opencode-legacy"
Validation Rules
Rules checked at config load or at jailoc up and jailoc reload, per setting.
Unsupported configuration
Any backend value other than "vm" and empty is rejected. For a config-load error naming a rejected setting, see Upgrade an existing installation.
Moved network settings
filtered_dns, dns_upstream and dns_blocked_zones directly in [defaults] or a workspace fail config load with [defaults]: filtered_dns moved to the [defaults.network] table; run `jailoc migrate` to update the config (or the workspace's network table). jailoc migrate moves them.
paths
~is expanded.- An empty list is allowed; empty entries are rejected.
- Each path must exist on the host and be a directory.
jailoc upandjailoc reloadfail with an error naming the workspace and path otherwise;jailocdoes not create a missing path. This differs from read-writemounts, whose missing host directories are created. - Paths equal to or under these prefixes are rejected:
/home/agent,/usr,/etc,/var,/bin,/sbin,/lib,/lib64,/opt,/root,/proc,/sys,/dev,/run,/tmp,/certs. - The rejected host paths of
mountsapply as well, so a path such as~,~/.sshor~/.local/share/jailoc, or a symlink to one of them, is rejected. - Several workspaces may share a path, for example to run different agents in the same project. When the current directory matches several workspaces at the same depth,
jailocfails and asks for-w.
Share limit. Each path is a separate virtio-fs share. A VM boots with at most:
| Host | Shares |
|---|---|
| linux/amd64 | 11 |
| arm64 (macOS and Linux) | 120 |
- With
enable_dockerthe limit is one fewer, and withtmp_storage = "disk"one fewer. - Paths,
mountswith a host directory and the state directories of a named agent profile count towards the limit. jailoc upandjailoc reloadfail above the limit. List a common parent directory instead of many sibling directories.
mounts
Format: host:container[:mode], mode ro or rw (default rw). Mounts are virtio-fs directory shares.
host
- Absolute or
~path. Must be a directory; a file mount fails atjailoc up. Usesnapshotsfor files. - A missing host directory of a read-write mount is created.
- A missing host directory of a read-only mount fails
jailoc upandjailoc reload, except for the built-in mounts of the agent's harness (see Merge Semantics), which are created. - An empty host (
":/home/agent/.agents") removes an inherited mount with that destination. jailoc upandjailoc reloadwarn about a symbolic link directly inside a path or mount that resolves to a file under the home directory that no path, mount or snapshot makes available at the path the link names; the link is dangling in the VM.jailoc reloadchecks the paths and mounts the VM runs with, which change only on restart.
container
- Absolute, or
~/..., where~stands for the guest home/home/agent. - Rejected when equal to or under
/,/usr,/etc,/var,/bin,/sbin,/lib,/lib64,/opt,/root,/proc,/sys,/dev,/run,/tmp,/certs. - Destinations under
/home/agent/...are allowed.
Rejected host paths. Host paths equal to or under these entries are rejected:
- System directories:
/,/boot,/dev,/etc,/private,/proc,/sys,/run,/var - Credential directories and files:
~/.ssh,~/.gnupg,~/.aws,~/.azure,~/.config/gcloud,~/.config/gh,~/.docker,~/.kube,~/.netrc - jailoc configuration, state and proxy CA:
~/.config/jailoc,~/.cache/jailoc-vm,~/.local/share/jailoc
Matching details:
- Parents of the entries under
~are rejected too, so~,~/.config,~/.cache,~/.localand~/.local/sharecannot be shared whole. - Entries under
~are also compared after resolving symlinks, so a symlink to~/.ssh, or a dotfiles directory that~/.sshlinks into, is rejected as well.
Error message. The error explains why the matched entry is protected:
- for credential directories it shows SSH or GPG agent forwarding or a file secret holding the one file a tool needs;
- for
~/.config/jailoc,~/.cache/jailoc-vmand~/.local/share/jailocit suggests keeping shared directories outside them or using an agent profile.
snapshots
Format: host:container, optionally :ro; :rw is rejected because snapshots are read-only. Host and destination rules are the same as for mounts, except that the host may be a file or a directory. An empty host removes an inherited snapshot.
- jailoc copies the sources when the VM starts and again on every
jailoc reload, which also applies added and removed entries. - At
jailoc upandjailoc reload, the destination must not equal, contain or lie inside a shared path (workspacepaths,mountsdestinations, the persistent home directories), and the source must exist. - A symlink given as the source root is resolved; symlinks inside a copied directory are copied unchanged.
git_config
When true, jailoc adds read-only snapshots of the host Git configuration at jailoc up and jailoc reload:
| Host | Guest |
|---|---|
~/.gitconfig |
/home/agent/.gitconfig |
$XDG_CONFIG_HOME/git/config |
/home/agent/.config/git/config |
$XDG_CONFIG_HOME/git/ignore |
/home/agent/.config/git/ignore |
$XDG_CONFIG_HOME/git/attributes |
/home/agent/.config/git/attributes |
$XDG_CONFIG_HOMEdefaults to~/.config.- Missing files are skipped. Other files in the directory are not copied.
- The Git credential stores
~/.git-credentials,$XDG_CONFIG_HOME/git/credentialsand~/.config/git/credentialsare never copied, whichever path or link names them. - At most 256 configuration files are read.
Referenced files. Files referenced by the copied configuration files are copied to the same path relative to /home/agent when they lie under the host home directory. The referencing settings are:
include.pathandincludeIf.<condition>.path: followed recursively, relative paths resolved against the including file; the included file must stay under the home directory or$XDG_CONFIG_HOMEcore.excludesFilecore.attributesFilecommit.templategpg.ssh.allowedSignersFileuser.signingKeywhen its value is a path
Path and credential checks.
- The home directory check uses the path as written, so a symlink under the home directory may point elsewhere, such as a dotfiles checkout or the Nix store.
- The credential checks apply to both the path as written and the file it resolves to, including hard links to files in
~/.ssh,~/.gnupgand~/.awsand in the directories symlinks there point to. The copy holds the content that was checked.
Not copied, with a warning. A referenced file is not copied and produces a warning when it is:
- missing, or outside the home directory;
- not a regular file of at most 1 MiB;
- a Git credential store;
- in
~/.ssh,~/.gnupgor~/.aws; - or when its path in the VM is already taken by a different file.
Exceptions: public data only. gpg.ssh.allowedSignersFile and user.signingKey are exceptions to the directory rule but copy public data only:
- The
user.signingKeycopy holds the first SSH public key in the file. - The
gpg.ssh.allowedSignersFilecopy holds its signer lines (principals, thecert-authority,namespaces,valid-afterandvalid-beforeoptions, and the public key) without comments. - A
user.signingKeyfile without an SSH public key, or an allowed signers file with any other line, is not copied and produces a warning.
Rewrites. Configuration files are copied with two rewrites:
- values of the path variables above that lie under the host home directory become
~/...; includeIf "gitdir:~/..."andincludeIf "gitdir/i:~/..."conditions use the host home directory, which workspace paths keep inside the VM.
Overriding. Each copy is a default snapshot: a snapshots entry with the same destination replaces it, an entry with an empty host removes it, and a directory snapshot that contains its destination replaces it.
import_agent_config
When true, jailoc adds read-only snapshots of the selected agent's host configuration at jailoc up and jailoc reload. Each host path is copied to the same path under /home/agent.
| Agent | Host paths |
|---|---|
opencode, opencode2 |
~/.config/opencode, without node_modules and service.json |
opencode1 |
~/.config/opencode, without node_modules and service.json; ~/.omo/omo.jsonc, ~/.omo/omo.json |
claude |
~/.claude/CLAUDE.md, ~/.claude/RTK.md, ~/.claude/settings.json, ~/.claude/agents, ~/.claude/commands, ~/.claude/hooks, ~/.claude/skills, ~/.claude/output-styles |
copilot |
~/.copilot/copilot-instructions.md, ~/.copilot/agents, ~/.copilot/hooks, ~/.copilot/skills, ~/.copilot/mcp-config.json |
agy |
~/.gemini/GEMINI.md |
omo |
~/.omo/omo.jsonc, ~/.omo/omo.json |
pi |
~/.pi/agent/AGENTS.md, ~/.pi/agent/SYSTEM.md, ~/.pi/agent/APPEND_SYSTEM.md, ~/.pi/agent/models.json, ~/.pi/agent/keybindings.json, ~/.pi/agent/mcp.json, ~/.pi/agent/extensions, ~/.pi/agent/skills, ~/.pi/agent/prompts, ~/.pi/agent/themes |
- Missing sources are skipped.
- Logins, sessions and the agents' own
config.jsonandsettings.jsonofcopilot, andsettings.jsonandauth.jsonofpi, stay in the persistent state directory. - The OpenCode copy gets the
.gitignoreOpenCode would write (unless the host directory has one). - The OpenCode 2 copy includes
service.jsonwith{"disabled":true}so CLI commands run without--standalone(such asopencode debug config) use a private server instead of failing on the read-only directory. - OpenCode doesn't install the dependencies of local plugins in the read-only directory: plugins listed in
pluginstill install into~/.cache, but a local plugin that imports a package needs it installed in the image. - The copies inside a persistent state directory (
~/.claude,~/.copilot,~/.omo,~/.pi,~/.gemini) hide what is there in the VM: a skill the agent installs into~/.claude/skillsis not visible while that directory is copied. When the snapshot is dropped, the empty mount points it left in the state directory are removed at the next start.
Overriding. Each copy is a default snapshot like the Git configuration: a snapshots entry with the same destination replaces it, an entry with an empty host removes it (snapshots = [":/home/agent/.claude/settings.json"]), and a directory snapshot that contains its destination replaces it. A copy whose destination equals, contains or lies inside a shared path, such as a mount of ~/.claude or a named profile state directory, is skipped.
ports
Each entry is a port number or "HOST:GUEST", with ports 1 to 65535.
| Entry | Meaning |
|---|---|
3000 |
guest 3000 on host 3000 |
"8080:80" |
guest 80 on host 8080 |
- A host port may appear only once per list.
- A workspace entry replaces a
[defaults]entry with the same host port. - Ports are published on host
127.0.0.1only. - Guest services listening on
0.0.0.0,192.168.127.2,127.0.0.1or[::1]are reachable.
host_ports
Each entry makes a host service reachable from the guest:
| Entry | Guest port | Host target |
|---|---|---|
9222 |
9222 | 127.0.0.1:9222 |
"8931:3845" |
8931 | 127.0.0.1:3845 |
"7100:/tmp/mcp.sock" |
7100 | Unix socket /tmp/mcp.sock (absolute or ~/) |
- Ports are 1 to 65535.
- A guest port may appear only once per list; a workspace entry replaces a
[defaults]entry with the same guest port. - Guest ports 22, 53, 2375, 7022, 7023, 7024 and 7025 are reserved.
- Inside the guest each port is reachable on the gateway
192.168.127.1, on the nameshost.jailoc.internalandhost.docker.internal, and on127.0.0.1and[::1]when nothing in the guest already listens on that port. - TCP targets are always host loopback.
- A Unix socket that does not exist yet produces a warning; connections fail until it exists.
- jailoc warns when an entry targets port 9222 (Chrome DevTools Protocol) or a container runtime socket (
docker.sock,containerd.sock,podman.sock,buildkitd.sock).
Warning
Host services reached through host_ports bypass the network policy. Anything in the guest gets the same access to them as a local process on the host.
allowed_hosts and allowed_networks
allowed_networksentries must parse with Go'snet.ParseCIDR; IPv4 and IPv6 CIDRs are accepted.allowed_hostsIP addresses and CIDRs are allowed as they are.allowed_hostshostnames become hostname allow rules and internal zones; they are not resolved on the host.- Some IPv6 ranges stay denied regardless of these lists; see Network isolation.
Filtered DNS
When network.filtered_dns = true, an effective dns_upstream and at least one effective dns_blocked_zones entry are required.
dns_upstream: a numeric IPv4 address other than unspecified, loopback, link-local or multicast.
Each blocked zone: a DNS name of labels with letters, digits or internal hyphens (63 characters per label, 253 total); a trailing dot is accepted and "." is rejected.
Filtering behavior:
- Queries for names in blocked zones get NXDOMAIN, matched case-insensitively including subdomains, and so do answers that name a blocked zone anywhere, for example through a CNAME.
- Queries with more or fewer than one question are refused.
- Direct DNS to port 53 of other servers is blocked unless an
allowrule opens it (see Direct DNS block), and such queries get the same filtering.
With filtering on, an effective allowed_hosts entry equal to or under an effective blocked zone is rejected at config load.
ca_bundle
| Value | Effect |
|---|---|
omitted or true |
Automatic discovery. The non-empty SSL_CERT_FILE environment variable is used first, then NIX_SSL_CERT_FILE. If the selected variable points at an invalid source, jailoc up fails without trying the next one. If neither is set, no bundle is forwarded. |
false |
No bundle. |
| non-empty string | Custom bundle path, absolute or ~. Symlinks are resolved; the target must be a readable regular file with at least one CERTIFICATE PEM block and no private-key PEM block. |
| empty string or any other TOML type | Rejected at config load. |
Trust store.
- The bundle is added to the VM's system trust store, which its Docker daemon also uses, and to the builder VM's Docker daemon. It also reaches the image builds; see Image builds with a CA bundle.
- In the VM,
/etc/ssl/certs/ca-certificates.crtthen holds the image's roots plus the forwarded certificates, also when the image keeps its own bundle elsewhere. - Each forwarded certificate is also written to
jailoc/under/usr/local/share/ca-certificatesor/etc/pki/ca-trust/source/anchors, if the image has that directory, so runningupdate-ca-certificatesorupdate-ca-trustin a session keeps it. - When a reload removes or replaces these certificates, jailoc runs that tool, if the image has it, so stores it generated stop trusting the old ones.
Environment variables. When a bundle is forwarded, sessions get NODE_USE_SYSTEM_CA=1 and these variables set to /etc/ssl/certs/ca-certificates.crt, for clients that ship their own roots or read only a variable:
| Variable | Read by |
|---|---|
UV_SYSTEM_CERTS |
uv (true) |
NODE_USE_SYSTEM_CA |
Node.js (1) |
NODE_EXTRA_CA_CERTS |
Node.js, Bun and the agents built on them |
SSL_CERT_FILE |
OpenSSL, Go, uv, httpx |
REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE |
Python requests, curl |
PIP_CERT |
pip |
AWS_CA_BUNDLE |
AWS CLI and SDKs |
CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE |
Google Cloud CLI |
HTTPLIB2_CA_CERTS |
httplib2 |
GRPC_DEFAULT_SSL_ROOTS_FILE_PATH |
gRPC |
CARGO_HTTP_CAINFO |
cargo |
GIT_SSL_CAINFO |
git |
NIX_SSL_CERT_FILE |
Nix |
DENO_CERT |
Deno |
HEX_CACERTS_PATH |
Hex |
A variable set by the workspace's env, env_file or an env secret takes precedence.
Inspection CA.
- When any network rule has an
httptable, the workspace's inspection CA certificate is appended to the bundle, also withca_bundle = false(the bundle then holds only that certificate), so the guest trusts it and the variables above are set. - A
ca_bundlepath is also the extra trust anchor for the broker's upstream certificate checks. - The
caofupstream_proxyis added to the same bundle and the guest trust store, also withca_bundle = false.
Image builds with a CA bundle
When ca_bundle selects an external bundle (a custom path, or a file picked by automatic discovery), jailoc forwards it to the image builds it starts. ca_bundle = false, and automatic discovery that selects no file, leave builds unchanged. The workspace inspection CA is not part of the forwarded bundle, and the builder does not inspect HTTPS.
- Builder. The build runs in a builder VM, never on the host daemon; see
builder: values. jailoc doesn't change the trust or configuration of the host Docker daemon. - Builds covered. Every image jailoc builds (embedded, preset, Docker layer, agent layer and workspace overlay), including multi-stage builds. No Dockerfile edits, build flags, mounts or TLS variables are needed.
- Fetches covered. External image pulls (
FROM,COPY --from, frontend image resolution) and HTTPS remoteADDdownloads trust the bundle, and so do the tools aRUNstep starts. - Client trust in a stage. Each stage except a file-source stage adds the bundle to the system trust store, which
apt,curl,git,uvand Node.js withnpmuse on Debian and Ubuntu. For clients that read a variable, jailoc sets the missing variables from the table above in the stage. A variable that the base image or the Dockerfile sets wins, and a laterENVin the Dockerfile overrides the default. A client that a variable points at another file, or that pins its own roots, bypasses the system store, and jailoc doesn't force it. - Roots. The image's public roots stay trusted, including roots a build step adds. TLS verification stays on.
- Requirements. Stages must use Debian or Ubuntu with a shell, except for file-source stages. A file-source stage is an intermediate stage that consists only of a
FROMinstruction naming an external image, supplies files viaCOPY --fromorRUN --mount from=, and is not theFROMbase of another stage. The builder uses the bundle to pull that image but does not install CA trust in the stage.ONBUILDtriggers in base images fail the build, even for file-source stages. The build needs BuildKit and the standard Dockerfile frontend; classic builders and custom frontends fail with an error. - Registry images. External images in
FROMandCOPY --frommust be available from a registry the builder reaches. An image that exists only in the host Docker daemon isn't transferred: the build fails with an error asking you to publish it. Stages built within the same build and images jailoc builds need no registry. - Private networks. The shared builder VM reaches public addresses only. A build that needs a private network needs
isolated_build = truewith the hosts inallowed_hostsorallowed_networks. - Size. A bundle larger than 500 KiB fails with a size error when it is passed as a build secret; it is not truncated.
Persistence. The bundle becomes part of the image layers and stays in the image's trust store. The VM runtime keeps the image's own roots, so removing the bundle from the configuration, ca_bundle = false or jailoc reload doesn't revoke what the image holds, and a later layer that deletes the certificate doesn't remove it from the layers below.
Rotation. jailoc compares the content of the bundle, so an edit at the same path counts. A changed bundle, or ca_bundle = false, rebuilds the affected images at the next image build without cache pruning, and the new images hold only the trust of the new setting plus the roots of their own base. The shared builder VM drops the roots of the previous bundle before the next build.
Running workspace. jailoc reload applies the bundle to the VM's trust store as described above and reports that jailoc restart is needed to rebuild the image and apply its trust. It doesn't rebuild the image or interrupt sessions.
enable_docker
- With
enable_docker = true, jailoc startsdockerdinside the workspace VM; an image withoutdockerdfailsjailoc up. enable_docker = truetogether withprotect_git = trueis rejected, because Docker access is root access inside the VM.protect_gitalone turns Docker off.- In the images jailoc builds, Docker is installed only when
enable_dockeris on; see Docker layer.
desktop
desktop.enable = true runs a native desktop in the workspace VM and serves it to a browser on the host through the reserved proxy route desktop, at https://desktop.<workspace>.jailoc.local. desktop.chrome = true also runs Google Chrome on it, which agents drive over the Chrome DevTools Protocol (CDP). See the how-to.
| Item | Guest side |
|---|---|
| Desktop | Xvfb on display :1 that resizes to the browser window, up to 7680x4320 (X11 over TCP off), Openbox with D-Bus and an xterm, and the Selkies server (pinned upstream 2.2.1, HTTP and WebSockets only, software encoding, no VNC) on loopback port 6080 |
| Streamed channels | Screen, keyboard, pointer and text clipboard. Audio, microphone, webcam, gamepads, printing and file transfer are off |
desktop route |
Reserved. Exists only with desktop.enable = true, always serves guest port 6080 and opens at / |
| Chrome | With desktop.chrome = true: /opt/google/chrome/google-chrome of the version desktop.chrome_version, started automatically after Selkies with its sandbox on. Profile /home/agent/.local/share/jailoc/chrome on the state disk, kept across restarts like the agent's state (empty with every VM with profile = false) |
| Remote debugging | 127.0.0.1:9222 inside the VM only; not reachable from the host or the network. OAuth sign-in callbacks can't use guest port 9222, nor the desktop's 6080 |
| Chrome restarts | jailoc restarts Chrome when it exits, for example when its window is closed, with a backoff of up to 30 s |
google-chrome |
/usr/local/bin/google-chrome wrapper that opens a page in Chrome with the same profile |
| CA bundle | Chrome's NSS database holds the roots of the forwarded ca_bundle: jailoc adds and removes them before every Chrome start and on jailoc reload. An open Chrome may trust a new root only after it restarts |
| Session environment | DISPLAY=:1 while the desktop is on; JAILOC_CHROME_CDP=http://127.0.0.1:9222 while Chrome is on |
| Desktop environment | A snapshot taken at boot, without the env and secrets delivered afterwards; programs an agent session launches inherit that session's environment |
- All three fields default as in
[defaults.desktop]and can be set in[defaults.desktop]and per workspace; unset workspace fields inherit field by field. desktop.chrome = truewithoutdesktop.enable = truefails withdesktop.chrome requires desktop.enable = true. Adesktop.chrome_versionwithoutdesktop.chrome = truefails withdesktop.chrome_version requires desktop.chrome = true.enable_desktopin[defaults]or a workspace is deprecated. It stands in for an unsetdesktop.enableof the same scope and prints a deprecation notice;jailoc migratemoves it todesktop.enable. Setting both in one scope fails withenable_desktop and [workspaces.<ws>.desktop] enable are both set; keep only [workspaces.<ws>.desktop] enable(or[defaults.desktop]).ports,host_ports, and customproxyroutes can't use guest port 6080 while the desktop is on, or 9222 while Chrome is on. Thedesktoproute has no entry of its own: it takesauthandhttps_redirectfrom[workspaces.<name>.proxy], then[defaults.proxy]. The desktop has no authentication beyondauth.- The workspace name must be a DNS label (the pattern for workspace names allows more).
- Changing any
desktopfield takes effect afterjailoc restart;jailoc reloaddoesn't start or stop the desktop or Chrome. A running VM keeps port 6080 (and 9222 with Chrome) reserved until it restarts, even after the configuration drops them. If a new setting uses such a port,jailoc reloadasks forjailoc restart. - In the images jailoc builds, the desktop packages and Selkies are installed only when
desktop.enableis on, and Chrome only whendesktop.chromeis on; see Desktop layer and Chrome layer. An explicitimagemust contain the desktop programs, and withdesktop.chromeChrome at/opt/google/chrome/google-chrome(packagegoogle-chrome-stable);jailoc upfails naming what is missing. - The version jailoc pins is installed from Google's package pool after a pinned SHA-256 check. Any other
desktop.chrome_versioncomes from Google's apt repository, which serves only the current stable version; for any other version the image build fails withChrome <ver> is not the current stable version in Google's repository (<current>, <arch>). See Chrome layer. - Software rendering needs CPU:
cpu = 4andmemory = "6g"are a reasonable start; usememory = "6g"or more with Chrome. The VM has no GPU, and the desktop streams no audio.
proxy
proxy serves guest ports to a browser on the host over HTTPS; see the how-to. Every workspace VM runs a proxy relay on NIC port 6081, forwarding to the loopback port of each route; without routes its allowlist is empty and denies every port.
[defaults.proxy]
auth = false
https_redirect = true
[workspaces.demo.proxy]
app = 3000
admin = { port = 8080, auth = true }
legacy = { port = 9000, https_redirect = false }
- Each entry in
[workspaces.<name>.proxy]is either<route> = <port>or<route> = { port = <port>, auth = <bool>, https_redirect = <bool> }. auth(defaultfalse) gates the route behind a one-time login code and a__Host-jailocsession cookie. It can be set per route, at[workspaces.<name>.proxy], or in[defaults.proxy].https_redirect(defaulttrue) answers a plain-HTTPGETorHEADto the route's host onhttp_portwith307to its HTTPS URL (the path and query are kept, and a nonstandardhttps_portis included).https_redirect = falsemakes plain HTTP to the route answer421. It resolves likeauth: route, then[workspaces.<name>.proxy], then[defaults.proxy], thentrue. A route namedredirectis an ordinary route.- The redirect never reaches a route's login or the guest app. Other methods get
405. - The HTTP and HTTPS ports are set globally in
[proxy].
Validation:
proxyroute keys are lowercase DNS labels (1 to 63 characters ofa-z,0-9and-, not starting or ending with-);desktopis rejected as a key;desktop.enableprovides that route.proxyports are 1 to 65535. Port 6081 is rejected, and so is a port thathost_portsorportsalso lists as a guest port (the effectiveports, after merging with[defaults]). Aportsentry whose host side matches aproxyport is fine; only the guest side counts.- With the desktop or any
proxyroute, the workspace name must be a DNS label (the pattern for workspace names allows more). portsandhost_portscan't use guest port 6081 in any workspace, with or withoutproxyroutes: it is reserved for the proxy relay, and withdesktop.enablealso 6080, withdesktop.chromealso 9222 (seedesktop). Aproxyroute can't target 9222 while Chrome is on.- A proxy route is not a published port: nothing listens on the host except the local proxy listeners (HTTPS and the HTTP redirect).
jailoc reload applies every change to proxy routes: adding, renaming or removing a route, changing its port, auth or https_redirect, and going from no routes to some or back. The guest relay allowlist is replaced live and connections through a removed route's port are closed; other sessions keep running. The proxy refuses a running VM whose routes don't match the configuration until it is reloaded. jailoc up, jailoc restart and jailoc reload start or update the background proxy, and jailoc down removes the workspace's routes from it.
A VM started by a jailoc release whose guest protocol predates live proxy reloads applies route changes only after jailoc restart. Such a VM also keeps the guest ports of its proxy routes reserved until it restarts, even after the configuration drops proxy; jailoc reload rejects a host_ports or ports entry that uses one of them and asks for jailoc restart. A VM started before the proxy feature has no relay and needs jailoc restart for any route. The desktop route exists with desktop.enable and changes only with jailoc restart.
protect_git
Workspace paths are shared read-write, including .git. Git on the host runs hooks and commands named in .git/config (such as core.fsmonitor), so an agent that writes there can run code on the host. protect_git = true makes the hooks and configuration listed below read-only inside the VM.
[workspaces.myproject]
protect_git = true
Warning
protect_git = true disables sudo and Docker in that workspace. Combining it with enable_docker = true is rejected.
Warning
Only repositories that exist at jailoc up are covered. Repositories the agent creates or clones later aren't protected until the next restart, and repositories inside node_modules, .venv, venv, __pycache__, .tox, .terraform, .next, .gradle and .cache aren't searched. Files that tools run from the working tree, such as Makefile or package.json scripts, aren't covered either. The protection is enforced inside the guest; it holds against the agent, not against an exploit of the guest kernel.
Repositories covered. At every jailoc up, jailoc finds the repositories, including bare ones, under the workspace paths and read-write mounts, including symlinked workspace roots.
- A repository visible at several paths in the VM is protected at each of them.
- A repository hidden under a read-only mount is skipped.
- The search fails when it scans more than 500,000 directories under the writable shares (the error ends with
protect_git needs narrower paths). Skipped directory names do not count.
Read-only inside the VM.
.git/hooks,.git/configandconfig.worktree- linked worktree
commondirpointers - every
core.hooksPathdirectory:- a relative
core.hooksPathis protected both below the working tree and below the git directory; - values from the host's system and global Git configuration count too, so a host-wide hooks directory inside a share is protected.
- a relative
- files named by
include.pathorincludeIf, whether or not theincludeIfcondition matches - the same metadata of submodules, worktrees and separate git directories reached through
.gitfiles - the files that symlinked hooks point at
Side effects.
- A missing
.git/configorconfig.worktreeis created empty so that it can be protected. - These git directories and their parents cannot be renamed or removed.
jailoc up fails when:
- the path to a protected file runs through a symbolic link inside a share, because the link itself could be redirected;
- a protected file or hook has another hard link;
- a configuration file is not a regular file or is larger than 1 MiB;
- a configuration includes more than 256 files;
- a hook links to a missing file;
- a hooks directory has more than 1024 entries;
- a
commondirpoints at another linked git directory.
cpu, memory, docker_disk, state_disk and cache_disk
| Field | Rule |
|---|---|
cpu |
A finite number greater than 0. |
memory |
Must match ^[1-9][0-9]*[kmgKMG]?$ (for example 512m, 4g). At jailoc up, at least 512m. |
docker_disk |
Must match ^[1-9][0-9]*[kmgKMG]?$ (for example 512m, 4g). At jailoc up, at least 1g, and rounded up to whole MiB. |
state_disk |
Same format and limits as docker_disk. |
cache_disk |
Same format and limits as docker_disk. |
When an existing docker_disk, state_disk or cache_disk data disk is larger than its setting, jailoc up fails instead of shrinking it.
[vm] builder_disk follows the same format and grow-only rule, with at least 1g, checked when the shared builder VM starts for a build, not by validation.
tmp_storage, tmp_size and tmp_ttl
These settings apply to the guest /tmp only. /var/tmp, ~/.local/tmp, /run/secrets, persistent caches and directories named by an overridden TMPDIR are not affected. A workspace value wins over [defaults], which wins over the built-in value.
| Field | Valid values | Default | Applied by |
|---|---|---|---|
tmp_storage |
"ram", "disk" |
"ram" |
jailoc restart |
tmp_size |
positive integer of bytes, optionally followed by k, m or g (binary multiples, either case); at least 16m with "disk" |
"1g" |
jailoc restart |
tmp_ttl |
positive Go duration (time.ParseDuration, e.g. "15m", "8h") or "0" |
"8h" |
jailoc reload |
tmp_ttl = "0" disables the cleanup. A value outside these rules is rejected. A VM started by a jailoc release with an older guest protocol (before protocol 4) needs jailoc restart before it uses any of these settings, including tmp_ttl.
Storage
tmp_storage |
/tmp lives in |
Capacity |
|---|---|---|
ram |
a tmpfs in the VM's memory | tmp_size is an upper bound. The pages count against the VM's memory, and idle ones go to compressed swap (zram). The host reserves nothing, and its free disk space is irrelevant. A cap above memory does not add room. |
disk |
an ext4 file system on a private sparse disk | tmp_size is the size of the disk. ext4 metadata reduces the available capacity below it. The sparse file is a cap, not a reservation: the host stores only the blocks the guest has written. |
With disk:
- The disk is private to the workspace. It is the file
tmp.imgin the workspace state directory on the host, outside every guest share, and it is independent of the Docker data disk (docker_disk). - jailoc creates the disk empty at every VM start and formats it with
mkfs.ext4from the workspace image. Nothing in/tmpsurvives a VM stop or restart. - The image must contain
mkfs.ext4(packagee2fsprogs), as it must for the state and cache disks. The embedded base image does. An image without it fails the VM start with an error that namesmkfs.ext4; jailoc installs nothing. See Use a custom image. - The guest trims freed blocks periodically (
FITRIM) so that the host can reclaim them, and jailoc removes the disk file when the VM stops.
Mount options
/tmp has mode 1777 and is mounted nosuid, nodev, strictatime and executable, so access times are exact and build tools and test runners can run files from it.
Cleanup
With tmp_ttl above zero, the guest sweeps /tmp every 15 minutes. The cutoff is the current time minus tmp_ttl.
| Entry | Removed when |
|---|---|
| Regular file | its access, modification and change times are all older than the cutoff |
| Directory | it is empty and its access and modification times are older than the cutoff; its change time is ignored |
The sweep skips:
- entries that another process holds an
flockon; - sockets, symbolic links, devices and FIFOs;
- other mounts below
/tmp; the sweep does not cross into them.
The checks are best effort. A file renamed into a checked name during a sweep can be removed in its place, and a program that keeps a file open without an flock does not protect its path, though it keeps reading the unlinked file through its descriptor. Removal happens at the first sweep after the cutoff, not at exactly creation time plus tmp_ttl.
The default 8h is more aggressive than the 10 days that distributions typically keep /tmp files. The cleanup cannot stop a running job from filling /tmp before the TTL passes; the capacity limit still applies.
Session environment
Sessions get TMPDIR, TMP, TEMP and GOTMPDIR set to /tmp. A variable set by the image configuration, the workspace's env or env_file, an env secret, or the command itself takes precedence.
[defaults]
tmp_storage = "ram"
tmp_size = "2g"
[workspaces.build]
tmp_storage = "disk"
tmp_size = "20g"
tmp_ttl = "0"
timezone
timezonemust match^[A-Za-z0-9_+-]+(/[A-Za-z0-9_+-]+)*$; absolute paths and POSIXTZrules are rejected.- Without it, the VM takes the host's zone from
TZwhen set, otherwise from/etc/localtime. jailoc-guestpoints/etc/localtimeat the zone in the image's/usr/share/zoneinfo, or copies the host's data for that zone when the image lacks it, and writes the name to/etc/timezone.- A zone that neither the image nor the host has leaves the image's zone in place.
jailoc reloadapplies a changedtimezoneto a running VM.
notifications
notifications must be "auto", "native", "osc" or "off". jailoc reads it on the host each time a session attaches, so a change applies at the next attach, without jailoc reload or jailoc restart.
| Value | Transport |
|---|---|
"auto" |
"native" when the host can show desktop notifications and neither SSH_CONNECTION nor SSH_TTY is set, otherwise "osc" |
"native" |
A desktop notification from a host command: /usr/bin/osascript on macOS, notify-send on PATH on Linux with WAYLAND_DISPLAY, DISPLAY or DBUS_SESSION_BUS_ADDRESS set. Without that command, notifications are off and jailoc warns |
"osc" |
An OSC 777 notify sequence written to the terminal, inside a tmux passthrough sequence when TMUX is set. Only terminals that implement OSC 777 show it |
"off" |
None |
Notifications are sent only when all of these hold:
- The agent is
opencode,opencode1,opencode2or a custom agent derived from one of them; their TUI plugin reports the agent's state. Other agents send none. - The session is attached interactively: standard input and output are terminals.
- The terminal reported through focus reporting (DEC mode 1004) that it lost focus, and has not regained it before the notification goes out. While the focus is unknown, such as in a terminal without focus reporting, nothing is sent.
Content and timing:
- The title is
jailoc / <workspace>and the body is eitherThe agent finished.orThe agent needs your input.; neither contains session content. - jailoc sends at most one notification every 3 seconds and queues each kind at most once.
- A native notification command gets 5 seconds.
- A terminal notification is written between two chunks of agent output and only when it does not wait: when the terminal is not reading, agent output is being written or it ends inside an escape sequence, the notification is dropped, not kept for later.
- After the agent exits, queued notifications are sent for at most 2 seconds; detaching, a takeover from another terminal or a lost connection drops them.
- Dropped and failed notifications are recorded in
~/.cache/jailoc/jailoc.log.
A detected native command does not guarantee a visible notification: macOS notification permissions and Focus settings, or the Linux desktop's notification service and D-Bus session, still control display. A failed native delivery is not retried through OSC.
image, dockerfile, build_context
imagecannot be combined withdockerfileorbuild_contextin the same workspace, and must not be whitespace-only.[defaults] build_contextis not checked againstimage: a workspace withimageignores it.dockerfileaccepts absolute paths,~paths andhttp/httpsURLs with a non-empty host (http:///pathis rejected). Relative paths and other schemes are rejected.- Build inputs (the local
[base] dockerfilewhen the base cascade is used, the local workspacedockerfileand the wholebuild_context) must stay out of read-write shares: a workspace does not start when a read-write share of it or of a running workspace exposes one, and does not start when its read-write shares expose the build inputs of any other configured workspace. See Build inputs and read-write shares.
agent and agents
agentmust beopencode,opencode1,opencode2,claude,copilot,omo,pi,agyor a custom agent defined in the workspace's or the defaults'agents.- A key of
agentsthat is not a built-in agent is a custom agent:- its name must match
^[a-z0-9-]+$; from, set in that table or in the defaults' table of the same name, must be a built-in agent (custom agents cannot be derived from custom agents).
- its name must match
fromis rejected on built-in agents.versionmust be an exact version (1.2.3, optionally with a-prereleaseand+buildsuffix).mountsfollows the rules ofmounts.profilemust befalseor a name matching^[a-z0-9-]+$;trueis rejected.
env
Each entry must be KEY=VALUE with a non-empty key.
Reserved keys, which jailoc sets itself:
JAILOC,JAILOC_WORKSPACE,NODE_USE_SYSTEM_CA,SSH_AUTH_SOCK- the agent variables listed in Coding agents for every agent:
OPENCODE_DISABLE_AUTOUPDATE,OPENCODE_DISABLE_MODELS_FETCH,OPENCODE_TUI_CONFIG,OPENCODE_CLI_CONFIG_CONTENT,CLAUDE_CONFIG_DIR,CLAUDE_CODE_SANDBOXED,DISABLE_AUTOUPDATER,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,COPILOT_AUTO_UPDATE,PI_OFFLINE,OMO_DISABLE_TELEMETRY,OMO_RUNTIME,AGY_CLI_DISABLE_AUTO_UPDATE
env_file
- Paths must be absolute or start with
~, and the files must exist at config load time. - Format:
KEY=VALUElines,#comments, empty lines ignored, quoted values allowed, inline comments stripped. - Values are literal; no host variable expansion.
- Entries are checked against the reserved keys.
secrets
Secrets live under [defaults.secrets.env.<NAME>], [defaults.secrets.file.<NAME>], [workspaces.<ws>.secrets.env.<NAME>] or [workspaces.<ws>.secrets.file.<NAME>]. The sub-table sets the destination, the field sets the source.
| Field | Type | Description |
|---|---|---|
from_env |
string | Host environment variable to read. Must match ^[A-Za-z_][A-Za-z0-9_]*$. |
from_file |
string | Host file to read. Absolute or ~ path. |
from_command |
string | Command run on the host with /bin/sh -c; its standard output is the value. Must not be blank. |
ttl |
string | Duration (time.ParseDuration, e.g. "15m", "1h") for which from_command output is cached in the host system keychain per workspace. Only valid with from_command; must be positive. |
Exactly one of from_env, from_file and from_command must be set.
| Destination | <NAME> rule |
In the guest |
|---|---|---|
secrets.env.<NAME> |
^[A-Za-z_][A-Za-z0-9_]*$; not HOME, PATH or a reserved env key |
exported as <NAME> in session environments |
secrets.file.<NAME> |
^[a-zA-Z0-9_-]+$ |
/run/secrets/<NAME> |
A name may not appear in both secrets.env and secrets.file of the same scope.
Reading sources. At jailoc up, jailoc reload and jailoc add, jailoc reads every source on the host:
- a
from_envvariable must be set and non-empty; - a
from_filepath must be a regular file; - a
from_commandmust exit with status 0, print something and finish within two minutes. Commands run with the terminal attached andJAILOC_WORKSPACEset to the workspace name.
Env secret values lose trailing \r and \n characters and must not contain line breaks or NUL.
Caching with ttl.
- When
ttlis set on afrom_commandsecret, jailoc caches the command output in the host system keychain (macOS login keychain or Linux kernel user keyring) for that duration, keyed by configuration file, workspace, secret destination, secret name and command. jailoc reload --purge-cacheevicts the cached entries and runs the commands again, andjailoc down --purgedeletes them.- Both fail when the keychain refuses to delete an entry and keep it recorded, so the next purge retries it.
Delivery.
- Values travel to the guest over SSH.
- File secrets are written to
/run/secrets(tmpfs, mode0400, owned by the agent) and env secrets go to the session environment only. - jailoc never writes them to plain files on host disk.
jailoc reloadre-reads and re-pushes secrets and removes files of secrets no longer configured; running sessions keep their old environment.
See the secrets how-to.
Merge Semantics
env: variables merge in this order, later wins per key:
[defaults].env[defaults].env_file(in list order)- workspace
env_file(in list order) - workspace
env
allowed_hosts and allowed_networks: unions of the defaults and workspace lists, deduplicated in order.
mounts: merges three layers keyed by destination: built-in default mounts of the workspace's agent, [defaults].mounts, workspace mounts. The last layer to set a destination wins; an empty host removes it. Built-in default mounts:
| Agent | Destination | Host source | Mode |
|---|---|---|---|
| all | /home/agent/.agents |
~/.agents |
ro |
- The agent's configuration is copied instead of mounted; see
import_agent_config. - The OmO plugin (
oh-my-openagent) ofopencode1writes its configuration, state and lock files to~/.omo, which is a persistent home directory of the workspace. To share the host's~/.omoinstead, mount it:[defaults.agents.opencode1] mounts = ["~/.omo:/home/agent/.omo:rw"].
snapshots: merges [defaults].snapshots and workspace snapshots keyed by destination. git_config, import_agent_config and ssh_auth_sock add lowest-priority snapshots (the Git configuration files, the agent configuration, /home/agent/.ssh/known_hosts), which a snapshots entry for the same destination replaces or, with an empty host, removes.
ports and host_ports: ports merges by host port; the workspace entry wins. host_ports merges by guest port; the workspace entry wins.
secrets: merges by name.
- A workspace secret replaces a default secret with the same name entirely, also across
envandfile. - An inherited default secret can't be unset in a workspace.
Scalar settings: agent, ssh_auth_sock, gpg_agent, git_config, import_agent_config, cpu, memory, docker_disk, state_disk, cache_disk, tmp_storage, tmp_size, tmp_ttl, timezone, notifications, enable_docker, protect_git, isolated_build, ca_bundle, and network.ipv6, network.filtered_dns, desktop.enable, desktop.chrome, desktop.chrome_version take the workspace value when set, otherwise [defaults], otherwise the built-in default.
agents.<name>:
- The scalar rule applies to each field of
agents.<name>; a custom agent then falls back to the tables of the agent it is derived from (see Custom agents). agents.<name>.mountsmerges instead (see Agent mounts), andprofileis not inherited from the derived-from agent.
DNS settings: an empty workspace network.dns_upstream and an omitted network.dns_blocked_zones inherit the defaults; a set dns_blocked_zones replaces the default list. A set workspace network.agent_endpoints, including [], replaces the defaults list.
network.upstream_proxy: a set workspace table replaces the defaults table as a whole; its fields are never merged with the defaults. enabled = false in a workspace turns the proxy off for it.
Persistent state
Each workspace has two persistent disks in ~/.cache/jailoc-vm/workspaces/<workspace>/, which survive restarts:
| Disk | Size setting | Default | Holds |
|---|---|---|---|
state.img |
state_disk |
10g |
The agent's persistent home directories (see Coding agents) |
cache.img |
cache_disk |
20g |
~/.cache |
Their size is the most host space each can take: a full disk fails writes inside the guest, not on the host. Both are sparse ext4 files, so the host stores only written blocks, and the guest periodically trims freed blocks so the host can take them back. A full ~/.cache does not take space from the agent's state. Both disks grow with their setting after jailoc restart and never shrink.
jailoc down --purgedeletes both disks.- The workspace image must contain
mkfs.ext4andresize2fs(packagee2fsprogs). The guest formats an unformatted disk withmkfs.ext4and grows the file system to a raised disk size withresize2fs. Withoutmkfs.ext4the VM does not start; withoutresize2fsthe file system keeps its size. The embedded base image has both; see Use a custom image. - An agent
profilemoves the agent's directories to a shared profile or makes them ephemeral. - A workspace whose persistent home directories were stored as a directory (
guest/home) keeps them there until its next start. The guest then copies the agent's state directories tostate.img, and jailoc moves the old home tolegacy-homenext to the disks (legacy-home-1,legacy-home-2and so on when one exists), with a message.cache.imgstarts empty: the old~/.cacheis not copied and stays inlegacy-home. jailoc never deleteslegacy-homeon its own; delete it by hand once you no longer need it.jailoc down --purgeremoves it with the rest of the workspace's VM state.
Tool caches
Sessions get these variables, so download caches that tools keep outside ~/.cache by default land in the VM's persistent ~/.cache (/home/agent/.cache) instead of its in-memory overlay:
| Variable | Value | Read by |
|---|---|---|
GOMODCACHE |
~/.cache/go-mod |
Go module cache (default ~/go/pkg/mod) |
NPM_CONFIG_CACHE |
~/.cache/npm |
npm (default ~/.npm) |
BUN_INSTALL_CACHE_DIR |
~/.cache/bun |
Bun install cache (default ~/.bun/install/cache) |
NUGET_PACKAGES |
~/.cache/nuget/packages |
NuGet global packages (default ~/.nuget/packages) |
NUGET_HTTP_CACHE_PATH |
~/.cache/nuget/v3-cache |
NuGet HTTP cache (default ~/.local/share/NuGet/v3-cache) |
Precedence:
- A variable the image sets is kept. For npm, which reads its variables case-insensitively, either
NPM_CONFIG_CACHEornpm_config_cachecounts. - A variable set by the workspace's
env,env_fileor an env secret takes precedence. When both npm spellings occur in the merged environment delivered to the guest, the last entry wins. - The variables also take precedence over the tools' own configuration files, such as a
cachesetting in.npmrcorbunfig.toml; set the variable in the workspace'senvto choose another location.
See the workspace configuration how-to for step-by-step setup.