What each kind of build protects
Each build records the kind of isolation it ran with.
These rules hold for a build under any built-in hooks:
- The build holds neither the item key nor Claude’s credential. The runner adds them to the requests it forwards.
- The runner forwards a push only when every ref it updates is the branch the claim names. See the branch rule.
- The build can read the files the runner gives it, such as the
ghread token. It cannot change them.
The network helper container
Each container build has a second container, its network helper container. It routes the build’s TCP connections to the runner’s tunnel. It needs one permission,NET_ADMIN, to set up that route. It drops the permission before the build’s container starts. So no program of the build runs while anything in its network holds a permission.
A sandbox build has a helper too, when the sandbox’s kernel gives a TUN device. In a sandbox with no TUN device, the build’s container is on the sandbox’s own network. The runner’s log says so. A program that reads no proxy variable cannot connect there.
A build that uses the sandbox’s Docker daemon (runner.sandbox.docker) is on the sandbox’s own network too. The build holds the daemon’s socket, so a network helper would not confine it. The daemon publishes the ports of the containers the build starts there, such as a local database. The build connects to them on 127.0.0.1.
What isolation does not cover
- With your own hooks, a child process that leaves the process group (for example with
setsid) keeps running after the build stops. - A container build and a microVM build have no Docker inside them. For a build that needs Docker, use a sandbox build with
runner.sandbox.docker. See Builds that need Docker. - The runner checks which branch a push updates, not what it contains. The review covers the diff.
- On macOS, only a Linux VM or the runner image isolates a build. See Docker Desktop.
- A claim made right before the runner restarts may not be recovered. It expires on its own within fifteen minutes.
- Two runners under one account, for the same factory, share the upload checkpoint of
outerlayer syncin the home directory.
What an image build reaches
An image build puts the OuterLayer tools on the universal image. It runs no code from the repository. Where it runs depends on the runner’s hooks. Withbuiltin:vm hooks, the image builds in an image builder, a microVM with no network device. Its only way out is the runner’s tunnel. The tunnel refuses private, link-local and cloud metadata addresses, and applies runner.build.allowHosts.
- An image build step reaches only the public hosts that
allowHostslists. When the list is not set, it reaches every public host. - An image build step cannot reach the host’s own services, its private network, the tailnet or a cloud machine’s metadata address.
- The runner fetches the repository with its read token on the host. The image builder gets the checkout without
.git, so the token never enters it.
builtin:container hooks, and with runner.build.imageBuild set to host, the image builds in the host’s Docker, outside the tunnel. The image build’s steps reach the network as any container on the host does. That includes the host’s own, private, link-local and Tailscale addresses. allowHosts does not limit them. See Image builds.
What a root setup script reaches
A container build and a sandbox build run each repository’s root setup script as root. These limits hold for it:- It runs in a container of its own. That container mounts nothing: no checkout, no file of the runner and no Docker socket. The setup script and the build’s command never run as root.
- It holds no secret. It gets no build variable of the factory, no
repository token and no
ghlogin. - It reaches only the allowed hosts. Its connections go through the runner’s tunnel, as the build’s own do.
- Only the default branch’s script runs. A pull request cannot change what runs as root, or the image that a later build starts from.
Hosts an image build needs
An image build in the image builder calls registries that a build’s agent never calls. Add them torunner.build.allowHosts. Without them, the image build fails at provision and the reason names the refused host.
Egress limits
The tunnel limits what one build sends. The limits apply to a build’s own connections, to a microVM build and to an image build in the image builder. The keys are inrunner.build.egress.
A managed runner applies these defaults to every key the config leaves out. Any other runner applies no limit unless its config sets one.
- Over a connection limit, the tunnel refuses the connection with HTTP 429. The build’s other connections keep working.
- Over the byte limit, the tunnel delays the bytes. An upload gets slower and still completes. The limit covers bytes the build sends, not bytes it receives.
- Too many hosts. The runner log says so when a build reaches more distinct hosts than
flagHosts. The tunnel refuses nothing.
The microVM helper
Forbuiltin:vm hooks on Linux, outerlayer runner install --service also installs a second unit, <unit>-helper. The helper runs as root. It starts, stops and reports microVM builds under Firecracker’s jailer.
- Only the runner’s account can talk to the helper. It refuses every other account, root included.
- It runs only the jailer and Firecracker releases that its CLI release pins by SHA-256. Root owns them, and the helper checks them before each start. The install refuses a helper whose files the runner’s account can write.
- Each build runs as a user of its own, with no network. That user sees only the build’s kernel, disks, configuration and sockets.
- The guest sees no VMX or SVM, so a build cannot run its own virtual machines.
outerlayer doctor reports this on its MicroVM jailer line, and warns when the helper is not the one this CLI release pins. A runner that updates itself does not update the helper. To add or update the helper, see Update the microVM helper.
What the keys limit
- The host key ties the runner key to one machine. The runner key’s first claim binds it to the host key. From then on, a leaked runner key is useless without that host key. Until that first claim, anyone holding the runner key can bind it to their own machine. A build that can read the host key defeats it, such as a build under hooks with no isolation of their own. See The host key.
- The run key is what the agent of a schedule automation’s run uses. It reads the run’s topics, reports what the run found and uploads the run’s session, and reaches nothing else. It stops working when the run ends. A run gets no build variables or destinations, and its git remote refuses every push.
- The item key is what a build uses in place of the runner key. It acts only on the claimed item and stops working when the claim ends. A container or microVM build never holds it. A build under hooks with no isolation of their own holds it in its environment and can read it. See Item key, and Key concepts for claims.
How a runner updates itself
A runner in the install layout updates itself only to a higher CLI version that OuterLayer names. It runs a new version only after every check passes. A version that fails a check is not run.- The runner checks the package’s digest against the npm registry.
- When the version has a provenance record, the runner checks that the record names OuterLayer’s release workflow and covers the same package. A version with no provenance record skips this check.
- The runner installs the version in a staging folder and runs
npm audit signaturesthere. - The new version runs the runner’s own checks before the runner switches to it.
The Codex judge and code review
A Codex judge and a Codex code reviewer run in the build’s own container, after the build, with Codex’s own sandbox off. The container is the wall, as it is for the build. The judge is told to read only, to change no file, to use no network and to run no tests or builds in place. It may write only its answer files. The runner checks that no other file changed in the judge’s input folder. If one did, the runner discards the run’s verdict and records which files changed, never their content. So the judge is instructed and checked. It is not sandboxed. The check finds a change after the run. It does not prevent one, and it does not cover the build’s checkout. Code that the judge reads can mislead it. A misled judge has the power of the build user in the build’s container. It can change the checkout and push to the item’s branch. It can call the model provider with the runner’s key, and it can call OuterLayer with the item’s key. Review the diff, as you do for any build. The judge holds no real credential. Its environment holds a placeholder, and the runner adds the real key to each request. The runner refuses each model request past 60 for each judge run. The reviewers of one review share one pool of 60 requests for each reviewer. Claude Code’s judge has no shell, so it needs no check.If a build escapes
An escape from a microVM or a container is rare. What an escaped build reaches depends on where it ran. The helper limits an escape. It does not change what a build sends through the runner’s tunnel. See What the keys limit.- A microVM, with the helper. The build runs as the user made for that one build. That user holds no credentials and shares no group with the runner’s account.
- A microVM, without the helper. The build runs as the runner’s account. It can read the runner’s credentials: the Claude credential, the runner key, the host key and the host’s
ghlogin. The account is often in thedockergroup, which gives root on the host in practice. - A container on Linux. The build shares the host’s kernel. That is a weaker boundary than a microVM.
The Docker socket in a runner container
A runner in a container holds the Docker socket, so it controls the host’s Docker daemon. The runner key and the Claude credential are in the container’s environment. Anyone who can rundocker inspect on it can read them, and that person already controls the daemon.
A build never gets the socket. A build is a sibling container, with the runner’s tunnel as its only network and nothing of the host mounted. In a container, the tunnel does not refuse a public IPv4 or global IPv6 address that the host holds. So a build can reach a service that listens on one.
Docker Desktop
The runner image can run on Docker Desktop. Its builds are containers, and their only network is the runner’s tunnel. The tunnel refuses loopback, link-local, private and several special-purpose addresses. So a build cannot reachhost.docker.internal, Docker Desktop’s address range or the Mac’s home network. A build mounts nothing from the Mac.
An image build is the exception. It runs on Docker Desktop’s network, outside the tunnel. It can reach the Mac’s local services through host.docker.internal, and the Mac’s home network.
All builds share the kernel of Docker Desktop’s VM. The VM also runs your other containers and shares the Mac’s folders, by default /Users, /Volumes, /private, /tmp and /var/folders. A build mounts none of them. A build that escaped its container would sit beside your own containers.
The Lima VM that outerlayer runner init --vm makes holds only the runner and its builds, and shares no Mac folders. A build that escaped its container there could reach the runner key, the Claude credential and the VM’s host key. It could reach the Mac’s loopback services and its home network. It could reach none of the Mac’s files.
WSL2
On Windows, the runner runs in a WSL2 distribution. Setup turns off interop, the WindowsPATH and drive automount there. The settings apply after you restart the distribution. Then a build that escaped its container as an account other than root cannot start Windows programs or read your Windows files. Root in the distribution can still mount a Windows drive. See Run the runner on Windows.
Managed runners
A managed runner is a runner that OuterLayer operates for many factories. It takes the builds that ask for one, and the runs of schedule automations in a factory that builds on managed runners. Each managed build runs in a sandbox: a microVM of its own at the sandbox provider. The managed runner’s own machine runs none of the build’s code. The conditions a managed runner must meet are in Conditions of a managed runner. A managed runner checks in with no factory, so it does not show on a factory’s Settings → Runners page. That page lists self-hosted runners only. A factory on Managed runners needs no runner there. While no self-hosted runner has checked in, the page says so and hides Runner updates. OuterLayer turns managed builds on for each organization. Until then, the Build settings and Models sections are hidden. Build variables is open to every factory, and shows only the plain variables that approved self-hosted runners receive. An organization with managed sandboxes and no managed builds sees Build settings with Machine size alone. Only a managed build gets the settings on this page. A self-hosted runner ignores them, except the machine size of a managed sandbox. It gets the plain build variables only after a member approves it. See Build variables on a self-hosted runner. It takes its destinations from its own config file.The model keys of a managed build
A managed build uses the key of its agent’s model provider. A member stores each key in Settings, Models. The first save of a key needs the Add build variables permission. Replacing it needs Change build variables. Removing it needs Remove build variables. Edit factory settings gives none of these. Step 3 of the setup panel stores a key the same way, for a factory that builds on managed runners, and needs the same permissions.
Models lists each model provider once. Anthropic and OpenAI have the chip Preset. So does OpenRouter, in an organization that can add a model provider. A custom endpoint has the chip Custom. The key or provider that the default agent needs has the chip Needed by, with the agent’s name, such as Needed by Claude Code. With OpenCode and a Default model, only the provider that owns the model has a Needed by chip. It reads Needed by OpenCode.
While Builds run on is Managed runners, a preset row stays while its key is not set. A factory needs only the key of its default agent. The row of that key shows “No key” in the warning colour. The row of any other provider shows “No key” in a neutral colour.
A factory that builds on self-hosted runners needs no model provider. While Builds run on is Self-hosted runners, Models shows a provider only after its key is stored. A note says that Models apply to managed builds only.
OuterLayer checks each Anthropic and OpenAI key with one call to its provider. For OpenAI, it asks for the list of models, so the key needs permission to list models. A value that does not start with
sk- is refused as not an OpenAI key. OuterLayer saves nothing if the provider refuses the key or cannot be reached.
- OuterLayer stores each key encrypted, apart from the build variables. Nobody can read it back.
- A running build keeps the old key when you replace the key. Revoke the old key at the provider after those builds finish.
- The audit log records each save, replacement and removal. For Anthropic, it records the last four characters at most. For OpenAI, it records no part of the key, and no page shows one.
Add a model provider
Adding a model provider is in early access. Add provider and the OpenRouter row show only for an organization that has it turned on. To turn it on, email hello@outerlayer.ai.
- OpenRouter. OuterLayer fills in the address
https://openrouter.ai/api/v1. Enter at least one model id and your key. - Custom endpoint. Enter a name, an
https://address, at least one model id and your key. The API type is OpenAI Chat Completions. A later release adds other types.
https://, or that names localhost or a private network. It refuses a name that another provider uses. Nothing is saved in these cases.
When you save, OuterLayer makes one call to the address, with your key. For OpenRouter the call is /key. For a custom endpoint it is /models. The call goes to that address only. OuterLayer follows no redirect and sends the key to no other host. It connects to the address that it checked, so a name that later answers with a private address gets no key.
- If the endpoint answers 401 or 403, OuterLayer refuses the key and saves nothing.
- If OpenRouter answers 200, OuterLayer saves the provider as verified.
- A custom endpoint can answer
/modelswith no key. So OuterLayer saves a custom provider as Not verified when it answers 200. It shows the same state when it cannot reach the endpoint, when the address redirects to another host, or when its name resolves to a private address.
ACME_GATEWAY_API_KEY, and never the key. The runner adds the key to each request that the build sends to the provider’s address. OuterLayer names the variable after the provider, and adds a number when that name is taken. The runner allows the provider’s host, whatever the factory’s allowed hosts say.
To change a custom provider, select Replace key on its row. This needs the Change build variables permission. OuterLayer tries the new key before it stores it. To remove a provider, select Remove. This needs the Remove build variables permission. The audit log records each of these changes and holds no part of a key.
OpenCode calls a provider that you add here. See OpenCode on a provider’s model.
OpenCode on a provider’s model
OpenCode can call any model that a provider in Models lists. This is the way to build with an open-source model, or with a model from your own gateway.- Add the provider in Settings, Models. List the model ids that you want to use.
- Set Default agent to OpenCode. A Default model row then shows.
- Choose a model in Default model. Each choice reads
<provider name>/<model id>, such asAcme Gateway/qwen3-coder. - Select Save default agent. The save stores the agent and the model.
"model" in .outerlayer/config.json, or --model on outerlayer work build. Write the model as <provider id>/<model id>, or as the bare model id. OuterLayer refuses a model that no provider lists, with the error model_not_supported. The list of models that the providers show is the list of allowed models.
A job waits when the provider of its model is gone, or when the provider no longer lists the model. The item’s page names the provider. The Default model row also says that the provider was removed, and asks you to choose another model. A runner that is too old for this feature does not take an OpenCode item. It gets the message that asks for a runner upgrade.
- The judge and the code review. They still run on Claude Code, with the factory’s Anthropic key. A factory with no Anthropic key still builds the item. The criteria judge and the code review then record that they could not run.
- Tool calls. OuterLayer cannot tell whether a model supports tool calls. A build on a model that does not support them fails with OpenCode’s own error.
- Price. A session records its tokens. OuterLayer has no price for a model that it does not know, so the session shows no cost for it.
The default agent
A managed runner runs every job of an item with one agent. The build, the amend, the criteria job and the code review all use it. The agent is the one the item names, else the factory’s Default agent. Step 3 of the setup panel also sets it. The panel asks “Which agent builds your issues?” and then asks for the key of that agent only. For OpenCode, the panel shows no key field. It links to Settings, Models, where you add the provider and choose the model. Default agent is above the model providers in Settings, Models. The first model key you store sets it: an OpenAI key gives Codex, and an Anthropic key gives Claude Code. A later key never changes it. A member who can edit factory settings can change it at any time: choose the agent, then select Save default agent. The agents are Claude Code, OpenCode and Codex. An item names an agent with"agent" in .outerlayer/config.json, or with --agent on outerlayer work build. When the factory stores no key for the agent a job runs with, the job waits and no managed runner takes it. The item’s page names the key to add. For an item that names no agent, store that key, change Default agent, or name an agent.
A runner of your own ignores Default agent. It builds an item that names no agent with its own default agent.
Managed build settings
A member who can edit factory settings sets these in Settings, Build settings:- Builds run on. Managed runners or Self-hosted runners. It decides the runner kind of every build of the factory, except the builds of a member who has a personal runner: those go to that runner. Machine size and Allowed hosts show only while Managed runners is selected, or Machine size alone while the organization builds in managed sandboxes. See
outerlayer work build. - Machine size. Small gives 4 vCPU and 16 GiB memory. Small is the default. Large, with 8 vCPU and 32 GiB memory, is coming soon. It also sets the size of each managed sandbox that a self-hosted runner builds in.
- Allowed hosts. The hosts a managed build can reach, added to the runner’s
runner.build.allowHosts. OuterLayer refuses an entry that covers a whole top-level domain, such as*.com.
GitHub is not a default host. Add
github.com or api.github.com to Allowed hosts when your builds need it.
Build variables
A build variable is a named value that the build gets as an environment variable. Add one in Settings, Build variables. The page lists plain variables only. Approved self-hosted runners receive them. The form that sends a variable to a service stays for managed builds. Model keys are in Settings, Models. Three permissions control build variables, apart from Edit factory settings:- Add build variables adds a variable with a new name.
- Change build variables replaces the value of a variable that exists, or changes its service.
- Remove build variables removes a variable.
- OuterLayer stores each value encrypted and never returns it.
- A value needs at least 3 characters, because the runner cannot remove a shorter value from logs.
-
OuterLayer refuses a name that the runner sets itself, such as a name that starts with
OUTERLAYER_. The names of the model keys and of their base addresses are among them, such asANTHROPIC_API_KEYandOPENAI_API_KEY.
Build variables on a self-hosted runner
A self-hosted runner gets the plain build variables of the factory after two one-time approvals. Neither side can complete the approval alone.- The owner of the runner’s machine sets
runner.build.factoryVariablestotruein the runner config. Then the owner runsouterlayer runner request-variables. The command prints the fingerprint of the machine’s host key. - An Owner or Admin opens the request in Settings, Runners. This needs the Approve runners for build variables permission. The dialog shows the fingerprint, when the runner was first seen and how many builds it finished. The member compares the fingerprint with the one the command printed, then confirms.
- A build on a runner that is not approved still runs. Its log and the work item page name each stored variable that was not delivered.
- An approved runner that cannot read the variables ends the build before its agent starts. The reason says so.
- The build also gets the machine’s own
runner.build.variables. The machine’s value wins when both set one name, and the log names the variable. - Only a build and an amend job get the variables. Code review, judge, setup and schedule jobs get none.
- A build that uses your own provision hook gets none. A personal runner cannot be approved.
- A proxied build variable does not reach a self-hosted build yet. The log names each one.
- Every approved runner gets every plain variable.
Managed builds in a sandbox
A managed runner applies the factory’s settings to the sandbox of each build:- Machine size. The runner asks the provider for a sandbox with the factory’s vCPU and memory. A build ends at provision when the provider does not offer that size.
- Build variables. The runner sends each value to the provider with the command that runs in the sandbox, so the provider’s systems carry the value.
- Proxied build variables. A managed build cannot use one yet. A build of a factory that has one ends at provision, and the reason says so.
Proxied build variables
A build variable can go to one HTTPS service instead of into the build. A registry token is a common case. The build holds a stand-in value for the variable. The runner adds the real value to each request that the build sends to the service. A member who has the Add build variables or Change build variables permission sets this in Settings, Build variables. Select Send to a service through the runner when you add a variable. To change an existing variable, select Service on its row. The form asks for these items:- Service address. An
https://address on a public host. It holds no login, query or fragment. OuterLayer refuseslocalhost, private addresses and IPv6 literal addresses such as[2001:db8::1]. Use the address that the repository’s own settings name, such ashttps://npm.example.com/. - Header name. The header that carries the value, such as
Authorization. - Header value. Write
${VALUE}where the variable’s value goes, such asBearer ${VALUE}. No other${...}reference is allowed. - Value of the variable. For an existing variable, enter the value again. OuterLayer does not move a stored value to a new host, or into the build, unless you enter it again.
.npmrc, a pip.conf, a .cargo/config.toml or a Maven settings.xml. No local address reaches a lockfile.
The row then says which host receives the value. The build can reach that host with no entry in Allowed hosts. A factory can send up to 16 variables to a service. Two variables cannot have the same host and path. When two share a host, the longer path wins for a request.
What the runner does with the value:
- One certificate authority for each build. The runner makes it when the build starts. The build gets only its certificate. See What the build trusts.
- It decrypts one host. The runner decrypts the build’s connections to the service’s host, and no others. Every other connection passes through as bytes.
- It sets the header by path. If a request’s path starts with the address’s path, the runner sets the header from the value it holds. It replaces any header of that name that the build sent. It also removes the build’s own
Authorization,CookieandProxy-Authorizationheaders. A request to another path of that host goes to the service with no header from the variable. - It checks the service. The runner checks the service’s certificate against the public roots before it sends a byte. It sends nothing to a service whose certificate it does not trust.
- It drops the value at the end. When the build ends, the runner drops the value and the authority’s key. A request after that gets an error, and the service gets nothing.
- The runner does not follow a redirect. If the service redirects to another host, the build gets the redirect. It follows the redirect as a new connection, with no header added.
- The runner offers HTTP/1.1 on a decrypted connection. It does not offer HTTP/2.
- The runner refuses a service whose name resolves to a private address.
- A tool that pins certificates, or that brings its own list of trusted certificates, rejects the build’s certificate. Keep that variable as a plain variable.
- A value that is not sent in an HTTP header, such as an SSH key or a signing key, stays a plain variable.
What the build trusts
The runner adds the authority’s certificate to the build’s trust before the first command. It holds public certificates only.- The system store. The build reads a bundle of the image’s roots and the authority in place of the image’s own bundle file.
- Tool variables. The runner sets the variables that tools read to find a certificate bundle, such as
SSL_CERT_FILE,CURL_CA_BUNDLE,GIT_SSL_CAINFO,NODE_EXTRA_CA_CERTS,REQUESTS_CA_BUNDLEandCARGO_HTTP_CAINFO. It replaces a team’s own value for each of them. - Java. The runner adds a trust store of the same certificates to
JAVA_TOOL_OPTIONS, after the options the team set.
- A
-Djavax.net.ssl.trustStoreon a command line, in.mvn/jvm.configor inorg.gradle.jvmargsoverridesJAVA_TOOL_OPTIONS. That repository fails with a certificate error for the service. Remove that option, or keep the variable plain. - A team image that adds its own authority only to Java’s
cacertsfile loses it for Java in a build with a proxied variable. Add the authority to the image’s system store. - A build image with no certificate bundle file in a standard place keeps its system store as it is. The tool variables and the Java trust store then hold the roots that Node ships, and the authority.
- A tool that reads neither the system store nor one of these variables fails with a certificate error for that service only.
Package tools
The tests cover npm, pip, Cargo, Maven and Gradle on the universal image. Each works with the repository’s own settings. For npm, the repository’s.npmrc names the registry and _authToken=${NPM_TOKEN}, where NPM_TOKEN is the proxied variable. The build holds a stand-in, so the line resolves. The lockfile keeps the registry’s own address.
These tools have no test: yarn, pnpm, uv, poetry, Go modules, Bundler and git over HTTPS. They are expected to read the system store or one of the variables above. If one does not, it fails with a certificate error for that service only.