outerlayer runner init chooses the hooks for the host. To set them by hand,
give provision and cleanup the same value in the runner block of the
config file:
builtin:sandbox, runs each build in a sandbox that OuterLayer provides. See
Build in a managed sandbox.
Container builds
Withbuiltin:container hooks, each build runs in a container. The host must
have these:
- Linux or WSL2, with Docker Engine 26 or later and Docker Buildx 0.18 or later.
- Docker Engine, not Docker Desktop. Docker Desktop works only for a runner in the runner image.
- The TUN device,
/dev/net/tun, for containers. It is a virtual network device that each build’s network needs.
outerlayer doctor to check the host. If its TUN device check fails, run
sudo modprobe tun on the machine Docker runs on. Then run outerlayer doctor
again.
A build that starts on a host without one of these fails at provision, and its
reason says which. See
Outcomes and reasons.
The first container build downloads a helper program from github.com. See
A build host for everything the host
downloads.
MicroVM builds
Withbuiltin:vm hooks, each build runs in a Firecracker microVM with its own
kernel. The host must be x86_64 Linux, not WSL2, and the runner’s account must
be able to open /dev/kvm. outerlayer doctor fails builtin:vm hooks on any
other host and says why.
The host needs no Docker. It needs Docker Engine 26 and Docker Buildx 0.18, or
later, only when runner.build.imageBuild is host. outerlayer runner image
always uses the host’s Docker. See
A runner that needs no Docker.
The first microVM build downloads Firecracker and a guest kernel from
github.com.
Everything on this page applies to a microVM build too, with these differences:
- The
buildlimits work differently. - The reasons
disk_limit_exceededanddisk_check_faileddo not occur. - The build has no Docker daemon. A container build has none either. See Builds that need Docker.
What is inside a build
A build runs in the repository’s build image. That is the universal image, with the repository’s setup script run in it. A build applies no devcontainer file. See The build image.
A build cannot reach your home directory, other builds or the host’s Docker
socket. No folder of the host is mounted into it. A user that is not in the
image fails the build at provision.
The repositories in a build
A build checks out every repository connected to the factory, so one session can change several. The item’s own repository is the primary. The agent starts in the primary checkout.
Each checkout starts on the item’s branch in that repository. See
The branch a claim names.
OUTERLAYER_REPOSITORIES is a JSON list of the checkouts:
outerlayer work open-pr --repository <owner/name>.
Every repository in the build runs on the same universal image.
A build on hooks of your own works in one repository.
The build block
The build block of the runner config sets the limits and variables of each
build. Build limits and hosts
lists every key and what each limit does in a container build. A microVM build
applies the limits this way:
To size the host for these limits, see
Memory limits.
Variables
build.variables lists the names of host variables that a build receives, at
most 100. No other host variable enters a build.
HOME, PATH, a proxy
variable or any OUTERLAYER_ name. It never passes a GitHub token variable
(GH_TOKEN, GITHUB_TOKEN, GH_ENTERPRISE_TOKEN, GITHUB_ENTERPRISE_TOKEN),
and its log names each one it skipped.
A build also gets the plain build variables that the factory stores in
Settings, Build variables, when the runner is approved to receive them.
When both set one name, the value from build.variables wins. The build’s log
names such a variable. See
Build variables on a self-hosted runner.
The gateway and Claude
A build holds neither the item key nor Claude’s credential. The runner adds both to the requests the build sends. In the build,OUTERLAYER_URL and
ANTHROPIC_BASE_URL are local addresses, and OUTERLAYER_API_KEY and the
Claude credential variable hold placeholders.
The runner reads Claude’s credential from its own environment when it starts:
CLAUDE_CODE_OAUTH_TOKEN (from claude setup-token), or else
ANTHROPIC_API_KEY. A terminal claude login does not count. Under the
service, the credential is in claude.env. See
Give the runner Claude’s credential.
Restart the runner after you change the credential. A runner with no
credential claims no work. See
When the runner is blocked.
A managed runner holds no credential of its
own. It uses the factory’s Anthropic API key.
A build on hooks of your own holds the item key as OUTERLAYER_API_KEY. See
The build’s variables.
The tunnel
The tunnel is a build’s only way to the network. The runner serves one for each build. Every TCP connection from every program in the build goes to it, on any port. No DNS query and no UDP packet leaves the build. A connection to the build’s own loopback address, such as a test server on127.0.0.1, stays in
the build.
The runner sets the standard proxy variables to the tunnel,
http://127.0.0.1:3128. A tool that reads none of them reaches the tunnel too.
So Java, Gradle, Maven and Node’s fetch need no proxy setting.
In a sandbox build, a tool that reads no proxy variable reaches the tunnel
only when the sandbox’s kernel gives a TUN device. A build that uses the
sandbox’s Docker daemon is on the sandbox’s own network, so such a tool cannot
connect there. See The network helper
container.
When the tunnel refuses a host, a tool that used the proxy gets a 403 with
the reason. A tool that did not gets a reset connection, and the runner’s log
names the refused host.
Addresses the tunnel always refuses
The tunnel refuses a connection to an address that is not public. The403
text names the range:
refused: <host> is <address>, in the <range name> range <cidr>.
The tunnel also refuses other special-purpose ranges, such as multicast and
reserved addresses. It refuses NAT64, IPv4-mapped and IPv4-compatible IPv6
addresses. It refuses a 6to4 address that carries a refused IPv4 address.
An
allowHosts entry does not change these rules. To reach a private service,
make it a destination.
Limiting the hosts a build reaches
- A host name, such as
registry.npmjs.org. - An IP address.
- A pattern, such as
*.githubusercontent.com. It matches names under the domain, not the domain itself. A pattern needs a domain of two labels or more, so*.comis refused.
403 and the text
refused: <host> is not in runner.build.allowHosts.
The list never limits the gateway, Claude, OpenAI, your destinations or the git
remote. Add these hosts when they apply:
With
builtin:vm hooks, the list limits the image build too. Add the hosts in
Hosts an image build needs. With
builtin:container hooks, or when runner.build.imageBuild is host, the
list does not limit the image build. See
What an image build reaches.
Allow the hosts of shared MCP servers
A control plane can share MCP servers with every governed repository in its.mcp.json. See Share MCP servers. A server with a url needs its host in allowHosts. Without it, the tunnel refuses the connection.
Set controlPlaneServerHosts to true to agree once. The tunnel then allows the host of each shared server that has a url. A new shared server needs no change on the runner’s machine.
false by default. It allows only the hosts of servers in the control plane. A server in a repository’s own .mcp.json opens no host.
A shared server that starts a command has no url, so the setting allows no host for it. The build’s log names the server and says so. A command can call any host, so add the hosts it needs to allowHosts.
A managed runner keeps the setting off. Set the hosts in the factory’s Allowed hosts list in the dashboard.
Find the hosts your builds need
- Run a few builds with
allowHostsunset. - Run
outerlayer doctoron the host. Its “Build hosts” check lists every host that past builds reached, ready to paste intoallowHosts. - Review the list. It also holds any host that a build should not have reached.
egress in the same block limits how fast a build opens connections and
sends bytes. See Egress limits.
The git remote and the build’s tokens
A build holds no credential that can write to its repository. Git andgh
reach GitHub through the runner. The runner adds short-lived read and push
tokens that OuterLayer issues. See
GitHub App permissions and build tokens.
ghcan read, such asgh pr view, but cannot write. It holds a read token for the primary repository only.- A push can update only the build’s own branch, in a repository of the build.
- On an
outerlayer/…branch, any update goes through, force-pushes included. On any other branch, the runner allows only creating the branch and fast-forwards.
A governed repository’s context
When a control plane governs the item’s repository, the build receives the control plane’s instructions, skills, agents and hooks. They arrive outside the checkout, so a commit cannot pick them up. The GitHub App’s installation must include the control-plane repository. See Share instructions across repositories.Stopping a build
Stopping a build stops its container or microVM. The runner then removes what the build made on the host. A container build keeps running when its runner restarts or crashes. It stops when its claim expires with no runner to renew it. See Start and stop the runner. If the runner logscleanup failed, its next
housekeeping pass removes what the
build left, within the hour. To free the space sooner, remove what the line
names with docker rm --force and docker volume rm.
What a build records
outerlayer work status --json shows each build’s environment under
claims. It holds the isolation, the image, the hosts reached
(hostsReached) and refused, the variable and destination names, and the CLI
versions. It never holds a secret.