Skip to main content
A factory key lets a script, a CI job or a runner work inside one factory. OuterLayer records what a key does under that key, so give each machine a key of its own. The Owner, Admin and Write roles can create a key. Only the Owner and Admin roles can edit or delete one. You can give a key only permissions that you hold yourself.

Which credential you need

Authenticate says which credential each endpoint takes.

Create a key

  1. Open the factory, then Settings → API keys.
  2. Choose Create API key.
  3. Enter a Name for what uses the key, such as laptop or ci.
  4. Choose a preset. See Choose a preset.
  5. Choose Create.
  6. Copy the key. OuterLayer shows it only at this time.

Choose a preset

Each preset is a fixed set of permissions. With Custom, you select each permission.
The Create API key dialog with the Preset menu open on Agent, Runner, Reader and Custom

Four presets. Agent is the default and suits the CLI on a developer machine.

The Create API key dialog with the Runner preset chosen and its permissions listed as chips

The Runner preset lists the permissions it carries.

These limits apply:
  • A member with the Write role can create Agent and Reader keys. Only the Owner and Admin roles can create a Runner key, because it includes work.update.
  • An Agent key cannot run work stop, or work remove on another member’s addition. Those need work.update.
  • An Agent key cannot use the cost and trend tools of the MCP server. Those need metrics.read.
  • A key keeps the permissions it had when you created it. To change them, choose Edit API key on the key’s row.
In Custom, when you select work.read or context.read, the dialog also selects git.read.
The Custom preset showing permission checkboxes grouped by area

Custom shows every permission, grouped by area.

Permissions that CLI commands need

work remove also needs work.read when you name the issue and not the item number. work comment needs work.comment, work.insert, evidence.insert, work.review or work.approve. The one it needs depends on what the comment records. A key holds no work.review and no work.approve. See work comment. If spec file or spec edit is refused, edit the key and add spec.insert or spec.update. The same permissions apply to a member in the dashboard:
  • Remove from Work needs work.insert for your own addition. It needs work.update for an item with a build in progress, an open pull request or another member’s addition.
  • To start a draft spec and approve it, a member needs spec.insert.
  • To edit a draft’s spec text, change mocks or approve a spec again, a member needs spec.update.
  • File issue on a problem needs spec.insert.
  • Open PR on a problem needs work.insert and spec.insert.
  • To close or reopen a problem, or to close an item’s pull requests, a member needs work.update.

Give the key to the CLI

Pipe the key to outerlayer login:
--app-id takes the Factory ID, from the factory’s Settings → General. The CLI reads the key from stdin, never from a flag, and never prints it. To keep the key out of your shell history, read it into the variable first. In bash or zsh, run read -rs OUTERLAYER_KEY, then paste the key. The dialog that shows a new key also shows this command with the key and the factory ID filled in. login saves the key in ~/.outerlayer/config.json. Only your user can read the file. To sign in without a key, run outerlayer login with nothing piped and approve it in the dashboard. Then run outerlayer connect to choose a factory. The machine then holds a login for your account. When a machine has both, the CLI uses the factory key. See Cloud commands.

Use a key in CI

Set three environment variables. Do not run login:
The CLI uses these variables before the config file. See Environment variables.

Rotate or revoke

  1. Open Settings → API keys.
  2. Choose Delete API key on the key’s row, then Delete.
  3. Create a new key.
  4. Run login again on each machine that used the old key.
OuterLayer refuses the old key within about five minutes. Your editor’s MCP server uses the new key the next time it connects.

Runner keys

A runner needs a key with the Runner preset. A runner key binds to the host key of the first machine that claims with it. OuterLayer then refuses the key from any other machine. Settings → API keys shows the host key fingerprint of each bound key. To move the key to a new machine, choose Clear host key. See Give the runner its key and Moving a runner to a new host. The audit log records each bind, each clear and each request that OuterLayer refused for its signature.

A personal runner key

You can get a runner key of your own without the dialog. Run outerlayer runner init in your terminal. It opens a page that names the factory and the machine. Choose Approve. The runner gets the key by itself, and you copy nothing. This key is a personal runner key. It belongs to you, and its runner builds only the work you ask for. It holds no more than you hold on the factory, and it stops working when you leave the organization. See Personal and shared runners. To approve, your role must let you create factory API keys, as it must for Create API key. See Roles and permissions. Without that permission, the page refuses and makes no key.

Next steps