Host settings

spotlight host reads its settings when it starts and when it reloads. spotlight host init writes them, and spotlight host config reads and changes them by key.

Where settings come from

The host reads a file of KEY=VALUE lines. Lines starting with # are comments, and quotes around a value are removed. A variable set in the host's own environment overrides the same variable in the file.

ConditionFile
SPOTLIGHT_HOST_CONFIG is setthat path
running as root/etc/spotlight/host.env
otherwise~/.spotlight/host.env

spotlight host init and spotlight host config set write this file with mode 0600.

Keys

spotlight host config names each setting by a key. A live setting applies to the sandboxes a running host starts after a reload; running sandboxes keep going. A setting that applies at a restart waits until the host restarts.

KeyVariableApplies
urlSPOTLIGHT_URLat a restart
tokenSPOTLIGHT_POOL_TOKENat a restart
trustSPOTLIGHT_TRUSTat a restart
oidc-token-fileSPOTLIGHT_OIDC_TOKEN_FILEat a restart
nameSPOTLIGHT_HOST_NAMElive
capacitySPOTLIGHT_CAPACITYlive
sandbox-memorySPOTLIGHT_SANDBOX_MEMORYlive
sandbox-runtimeSPOTLIGHT_SANDBOX_RUNTIMEat a restart
imageSPOTLIGHT_RUNNER_IMAGElive
registry-configSPOTLIGHT_REGISTRY_CONFIGat a restart
run-timeoutSPOTLIGHT_RUN_TIMEOUTlive
sandbox-urlSPOTLIGHT_SANDBOX_URLlive
sandbox-envSPOTLIGHT_SANDBOX_ENVlive
sandbox-passSPOTLIGHT_SANDBOX_PASSlive
sandbox-networkSPOTLIGHT_SANDBOX_NETWORKlive
sandbox-hostsSPOTLIGHT_SANDBOX_HOSTSlive
egress-imageSPOTLIGHT_EGRESS_IMAGElive
egress-allowSPOTLIGHT_EGRESS_ALLOWlive
egress-envSPOTLIGHT_EGRESS_ENVlive
egress-passSPOTLIGHT_EGRESS_PASSlive
egress-ca-bundleSPOTLIGHT_EGRESS_CA_BUNDLElive
auto-updateSPOTLIGHT_AUTO_UPDATElive
log-levelLOG_LEVELat a restart
stateSPOTLIGHT_STATEat a restart
docker-hostDOCKER_HOSTat a restart
releases-urlSPOTLIGHT_RELEASES_URLat a restart
health-addrSPOTLIGHT_HEALTH_ADDRat a restart
sentry-dsnSENTRY_DSNat a restart
sentry-environmentSENTRY_ENVIRONMENTat a restart
traces-samplerOTEL_TRACES_SAMPLERat a restart
traces-sampler-argOTEL_TRACES_SAMPLER_ARGat a restart

Any other variable in capitals can be set by its name, and applies at a restart. A reload also reads sandbox.env and egress.env again.

Connection

VariableDefaultDescription
SPOTLIGHT_URLrequiredThe Spotlight address: https://app.usespotlight.ai, or a self-hosted deployment's address. A trailing / is removed.
SPOTLIGHT_POOL_TOKENnoneA pull pool's token.
SPOTLIGHT_TRUSTnoneThe id of a runner trust.
SPOTLIGHT_OIDC_TOKEN_FILEnonePath to the workload's OIDC token. Required with SPOTLIGHT_TRUST. Read again on every request.
SPOTLIGHT_HOST_NAMEnoneThe name shown on the Runners page. Without it, the machine's hostname.

Exactly one of SPOTLIGHT_POOL_TOKEN, or SPOTLIGHT_TRUST with SPOTLIGHT_OIDC_TOKEN_FILE, must be set.

Sandboxes

VariableDefaultDescription
SPOTLIGHT_CAPACITY1Sandboxes the host runs at once. At least 1. A sandbox takes its place for as long as it lives, with or without a run in it. See Sandbox lifetime.
SPOTLIGHT_SANDBOX_MEMORYnoneThe memory limit of each sandbox: a whole number of bytes, or of binary units such as 512m, 6g or 6GiB. At least 6m. none sets no limit. A sandbox gets no swap above the limit. With no limit, a sandbox can use all of the machine's memory. A reload applies it to the sandboxes started after it. Egress has no limit. See Memory.
SPOTLIGHT_SANDBOX_RUNTIMEnoneThe Docker runtime each sandbox runs under, such as sysbox-runc. With none, Docker's default runtime. A runtime such as Sysbox (sysbox-runc) lets a sandbox run its own Docker daemon, for example to start a repository's Docker Compose services in its setup. The runtime must be installed in Docker. The image probe uses it too. Egress does not.
SPOTLIGHT_RUNNER_IMAGEghcr.io/usespotlightai/spotlight-runner:<release>, or :latest for a binary built without a releaseComma-separated images the host serves. Each entry is an exact image reference, or a prefix ending in * such as ghcr.io/acme/*. The first exact entry is the default image, used by every line that names none. If no entry is exact, the built-in default is added.
SPOTLIGHT_REGISTRY_CONFIG$DOCKER_CONFIG/config.json, else ~/.docker/config.jsonA Docker config file whose auths the host pulls with. Read on every pull. See registry credentials.
SPOTLIGHT_RUN_TIMEOUT6hA Go duration. Applies to each run on its own: a run that works longer is stopped and reported timed-out, and its sandbox stays up. A change stack check's sandbox running longer is stopped and destroyed. A reload applies it to the sandboxes started after it.
SPOTLIGHT_SANDBOX_ENVsandbox.env beside the config fileA file of variables every sandbox gets. A missing default file is ignored; a missing named file is an error.
SPOTLIGHT_SANDBOX_PASSnoneComma-separated names of the host's own variables to pass into every sandbox.
SPOTLIGHT_SANDBOX_URLSPOTLIGHT_URLThe Spotlight address as sandboxes and egress reach it.
SPOTLIGHT_SANDBOX_NETWORKnoneA container network egress joins, beside the sandbox's own network.
SPOTLIGHT_SANDBOX_HOSTSnoneComma-separated host:ip entries added to egress's hosts file.
DOCKER_HOSTnoneThe container engine, as unix:// or tcp://. Without it, the host looks for a socket, as below.

With DOCKER_HOST unset, the host tries these sockets in order: /var/run/docker.sock, ~/.docker/run/docker.sock, ~/.orbstack/run/docker.sock, ~/.colima/default/docker.sock, ~/.colima/docker.sock, /run/podman/podman.sock, $XDG_RUNTIME_DIR/podman/podman.sock.

The sandbox environment, from SPOTLIGHT_SANDBOX_ENV and SPOTLIGHT_SANDBOX_PASS, may not set SPOTLIGHT_URL, SPOTLIGHT_POOL_TOKEN, SPOTLIGHT_TRUST, SPOTLIGHT_OIDC_TOKEN_FILE, SPOTLIGHT_ASSIGNMENT_FILE, SPOTLIGHT_RUN_TOKEN or SPOTLIGHT_RUN_TIMEOUT, and may not carry the pool token in any variable. The same applies to the egress environment.

A run goes only to an image that holds its station's harness. An image that holds no harness runs change-stack checks only. For each image that it can use and that holds no harness, the host logs the runner image holds no harness, so it runs checks but no agent run; run spotlight host init in a terminal to build one with a harness. See Harnesses.

Registry credentials

The file named by SPOTLIGHT_REGISTRY_CONFIG is JSON. The host reads only its auths object; credsStore and credHelpers are ignored.

{
  "auths": {
    "ghcr.io": { "username": "<user>", "password": "<token>" }
  }
}

Each key of auths names a registry. The registry of an image is the first part of its name when that part contains a . or a :, or is localhost; any other image is on Docker Hub.

RegistryKeys looked up, in order
Docker Hubhttps://index.docker.io/v1/, index.docker.io, docker.io, registry-1.docker.io
any other<registry>, https://<registry>, http://<registry>
Entry fieldDescription
authBase64 of <username>:<password>. When set, used in place of username and password.
usernameThe user to pull as.
passwordThe password or access token.
identitytokenA registry identity token, sent with the pull.

A missing file, or no entry for the registry, pulls anonymously. A file that cannot be read or parsed, or an auth that is not base64, fails the pull. The image is then unavailable with Image can't be pulled. Error: read registry credentials <path>: <error> or Image can't be pulled. Error: registry credentials for <registry>: auth is not base64, also when the host has a copy of it, unless the image is named by digest or the copy has no registry digest.

Harness keys

These variables, when SPOTLIGHT_SANDBOX_ENV or SPOTLIGHT_SANDBOX_PASS gives them a value, are stored by egress. The sandbox gets the stand-in spotlight-egress:<NAME>.

VariableSent toHeader
ANTHROPIC_API_KEYapi.anthropic.comx-api-key
CLAUDE_CODE_OAUTH_TOKENapi.anthropic.comauthorization: Bearer
OPENAI_API_KEYapi.openai.comauthorization: Bearer
CODEX_API_KEYapi.openai.comauthorization: Bearer
CURSOR_API_KEYapi2.cursor.shauthorization: Bearer
OPENROUTER_API_KEYopenrouter.aiauthorization: Bearer

Any other variable, including OPENCODE_API_KEY, enters the sandbox as it is.

A workspace can also hold these keys as secrets. When the host keeps a key for a host, egress does not inject a workspace secret bound to the same host. The host's own key is used.

Egress

VariableDefaultDescription
SPOTLIGHT_EGRESS_ALLOWnoneComma-separated hosts sandboxes may reach. An entry is an exact host, or *.example.com for its subdomains. * alone is rejected. Without it, any host is allowed; see Allowed hosts.
SPOTLIGHT_EGRESS_IMAGEghcr.io/usespotlightai/spotlight-runner:<release>, or :latest for a binary built without a releaseThe image egress runs from. Entries in SPOTLIGHT_RUNNER_IMAGE do not change it.
SPOTLIGHT_EGRESS_ENVegress.env beside the config fileA file of variables only egress gets.
SPOTLIGHT_EGRESS_PASSnoneComma-separated names of the host's own variables to pass to egress only.
SPOTLIGHT_EGRESS_CA_BUNDLEnoneA PEM file of certificate authorities egress trusts upstream. Sandboxes do not trust them.

See Egress for what egress allows and blocks.

Logs

VariableDefaultDescription
LOG_LEVELinfoerror, warn, info or debug. The host gives it to each sandbox and egress as SPOTLIGHT_LOG_LEVEL. See Observability.

Health checks

VariableDefaultDescription
SPOTLIGHT_HEALTH_ADDRnoneWhere the host answers GET /healthz and GET /readyz, such as 127.0.0.1:9100. See Health checks. Without it, the host listens on nothing.

Error reporting

VariableDefaultDescription
SENTRY_DSNnoneWhere the host reports its errors. When it is set, the host gives it to each sandbox and egress it starts as SPOTLIGHT_SENTRY_DSN, and egress allows the server's host.
SENTRY_ENVIRONMENTthe Sentry SDK's defaultThe environment on each report. The host gives it to each sandbox and egress as SPOTLIGHT_SENTRY_ENVIRONMENT.

See Error reporting for what a report contains.

State

VariableDefaultDescription
SPOTLIGHT_STATE/var/lib/spotlight-host as root on Linux, else ~/.spotlight/hostThe host's state directory, created with mode 0700.

The state directory contains:

PathContents
<state>/host-idThe host's id, made on first start.
<state>/host.lockA lock the host keeps while it runs, holding its process id. A second host on the same directory does not start.
<state>/mirrors/<workspace>/<repo>.gitBare mirrors of the repositories the host has checked out. Mounted read-only into sandboxes. Needs git on the host.

The host also keeps a container volume, spotlight-editor-servers-<host id>-<workspace id>, outside the state directory, one for each workspace it serves. It holds the VS Code and Cursor server releases that editors brought into the host's sandboxes, so that the next editor of the same release on this host finds its server in place. It is mounted at /spotlight/editor-servers into every sandbox of a task or chat of that workspace, once the host knows its workspace. Sandboxes of other workspaces never mount it.

A host id serves one pool or trust at a time. Spotlight rejects a host id that is in use by another pool or trust with 409 host-in-use.

Validation

The host checks every setting before it starts and reports all problems together. spotlight host init, config set and config unset make the same checks before they save, and name each setting by its key in place of its variable. Messages include:

MessageCause
SPOTLIGHT_URL is requiredNo address.
SPOTLIGHT_POOL_TOKEN and SPOTLIGHT_TRUST are two different authentication methods; set oneA token together with a trust or a token file.
SPOTLIGHT_POOL_TOKEN (a pull pool's token) is required, or SPOTLIGHT_TRUST and SPOTLIGHT_OIDC_TOKEN_FILE to claim through a runner trustNeither a token nor a trust.
SPOTLIGHT_OIDC_TOKEN_FILE names the workload token file, and is required with SPOTLIGHT_TRUSTTrust without a token file.
SPOTLIGHT_CAPACITY: "<x>" is not a count of at least 1Bad capacity.
SPOTLIGHT_SANDBOX_MEMORY: "<x>" is not a size such as 512m or 6g, or noneBad memory limit, such as 1.5g.
SPOTLIGHT_SANDBOX_MEMORY: "<x>" is below Docker's least limit, 6mA memory limit below 6m.
SPOTLIGHT_RUN_TIMEOUT: "<x>" is not a duration such as 6hBad timeout.
SPOTLIGHT_RUNNER_IMAGE: "<x>" is not an image reference such as ghcr.io/acme/runner:mainBad image entry.
SPOTLIGHT_EGRESS_ALLOW: "*" allows everything; leave the list empty for thatSPOTLIGHT_EGRESS_ALLOW=*.
SPOTLIGHT_EGRESS_CA_BUNDLE: <error>The host cannot read the CA bundle file.
SPOTLIGHT_EGRESS_CA_BUNDLE: <path> has no PEM certificateThe CA bundle file contains no PEM certificate.
the sandbox environment sets <NAME>, which only the host hasA sandbox variable names a variable only the host sets.
the sandbox environment carries the pool token in <NAME>A sandbox variable contains the pool token.

The same two problems in the egress environment are prefixed egress: . A host that finds another host already using its state directory stops with another spotlight host already serves from <state>: <error>. A host whose SPOTLIGHT_SANDBOX_RUNTIME names a runtime that Docker does not have stops when it reaches the container runtime, with SPOTLIGHT_SANDBOX_RUNTIME: the container runtime has no runtime "<name>", only <runtimes>. Install it, or unset SPOTLIGHT_SANDBOX_RUNTIME for the default runtime.

Exit codes

See The spotlight command for the exit codes of spotlight host.

On this page