Skip to main content
A runner with built-in hooks runs each build in an environment of its own: a container or a microVM. The build reaches the network only through the runner, and the runner holds every credential. This page says what a build holds, what it can reach, and how to limit it. 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:
The runner refuses a config in which the two hooks differ. A third value, builtin:sandbox, runs each build in a sandbox that OuterLayer provides. See Build in a managed sandbox.

Container builds

With builtin: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.
Run 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

With builtin: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 build limits work differently.
  • The reasons disk_limit_exceeded and disk_check_failed do 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:
The agent decides from the issue which repositories to change. It opens one pull request for each changed repository with 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.
The runner refuses a name that it sets itself, such as 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.
Every program in the build can read a variable in build.variables. For a secret, use a destination when the tool allows it.

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 on 127.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.
A build's only exits are four local addresses. One reaches the OuterLayer gateway, one reaches api.anthropic.com for Claude, one reaches your destinations and the services they stand for, and one reaches the runner's tunnel. The tunnel carries git and gh to github.com with the build's tokens added, and reaches public hosts, limited by allowHosts when set. The host itself and private, loopback, link-local, Tailscale and several other special-purpose addresses are always refused with a 403.A build's only exits are four local addresses. One reaches the OuterLayer gateway, one reaches api.anthropic.com for Claude, one reaches your destinations and the services they stand for, and one reaches the runner's tunnel. The tunnel carries git and gh to github.com with the build's tokens added, and reaches public hosts, limited by allowHosts when set. The host itself and private, loopback, link-local, Tailscale and several other special-purpose addresses are always refused with a 403.

Addresses the tunnel always refuses

The tunnel refuses a connection to an address that is not public. The 403 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

By default a build can reach every public host. Any program in it can send what the build can read, such as a build.variables value, to any of them. Set build.allowHosts to close that.
This list is a starting point for an npm or Yarn 1 project. An entry is one of these:
  • 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 *.com is refused.
The list holds at most 500 entries. An empty list refuses every public host. The tunnel answers an unlisted name with a 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.
The setting is 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

  1. Run a few builds with allowHosts unset.
  2. Run outerlayer doctor on the host. Its “Build hosts” check lists every host that past builds reached, ready to paste into allowHosts.
  3. 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 and gh reach GitHub through the runner. The runner adds short-lived read and push tokens that OuterLayer issues. See GitHub App permissions and build tokens.
  • gh can read, such as gh 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 refused push updates no ref, and git prints the reason. When a build’s push is refused lists the messages.

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 logs cleanup 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.