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.
| Condition | File |
|---|---|
SPOTLIGHT_HOST_CONFIG is set | that 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.
| Key | Variable | Applies |
|---|---|---|
url | SPOTLIGHT_URL | at a restart |
token | SPOTLIGHT_POOL_TOKEN | at a restart |
trust | SPOTLIGHT_TRUST | at a restart |
oidc-token-file | SPOTLIGHT_OIDC_TOKEN_FILE | at a restart |
name | SPOTLIGHT_HOST_NAME | live |
capacity | SPOTLIGHT_CAPACITY | live |
sandbox-memory | SPOTLIGHT_SANDBOX_MEMORY | live |
sandbox-runtime | SPOTLIGHT_SANDBOX_RUNTIME | at a restart |
image | SPOTLIGHT_RUNNER_IMAGE | live |
registry-config | SPOTLIGHT_REGISTRY_CONFIG | at a restart |
run-timeout | SPOTLIGHT_RUN_TIMEOUT | live |
sandbox-url | SPOTLIGHT_SANDBOX_URL | live |
sandbox-env | SPOTLIGHT_SANDBOX_ENV | live |
sandbox-pass | SPOTLIGHT_SANDBOX_PASS | live |
sandbox-network | SPOTLIGHT_SANDBOX_NETWORK | live |
sandbox-hosts | SPOTLIGHT_SANDBOX_HOSTS | live |
egress-image | SPOTLIGHT_EGRESS_IMAGE | live |
egress-allow | SPOTLIGHT_EGRESS_ALLOW | live |
egress-env | SPOTLIGHT_EGRESS_ENV | live |
egress-pass | SPOTLIGHT_EGRESS_PASS | live |
egress-ca-bundle | SPOTLIGHT_EGRESS_CA_BUNDLE | live |
auto-update | SPOTLIGHT_AUTO_UPDATE | live |
log-level | LOG_LEVEL | at a restart |
state | SPOTLIGHT_STATE | at a restart |
docker-host | DOCKER_HOST | at a restart |
releases-url | SPOTLIGHT_RELEASES_URL | at a restart |
health-addr | SPOTLIGHT_HEALTH_ADDR | at a restart |
sentry-dsn | SENTRY_DSN | at a restart |
sentry-environment | SENTRY_ENVIRONMENT | at a restart |
traces-sampler | OTEL_TRACES_SAMPLER | at a restart |
traces-sampler-arg | OTEL_TRACES_SAMPLER_ARG | at 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
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_URL | required | The Spotlight address: https://app.usespotlight.ai, or a self-hosted deployment's address. A trailing / is removed. |
SPOTLIGHT_POOL_TOKEN | none | A pull pool's token. |
SPOTLIGHT_TRUST | none | The id of a runner trust. |
SPOTLIGHT_OIDC_TOKEN_FILE | none | Path to the workload's OIDC token. Required with SPOTLIGHT_TRUST. Read again on every request. |
SPOTLIGHT_HOST_NAME | none | The 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
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_CAPACITY | 1 | Sandboxes 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_MEMORY | none | The 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_RUNTIME | none | The 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_IMAGE | ghcr.io/usespotlightai/spotlight-runner:<release>, or :latest for a binary built without a release | Comma-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.json | A Docker config file whose auths the host pulls with. Read on every pull. See registry credentials. |
SPOTLIGHT_RUN_TIMEOUT | 6h | A 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_ENV | sandbox.env beside the config file | A file of variables every sandbox gets. A missing default file is ignored; a missing named file is an error. |
SPOTLIGHT_SANDBOX_PASS | none | Comma-separated names of the host's own variables to pass into every sandbox. |
SPOTLIGHT_SANDBOX_URL | SPOTLIGHT_URL | The Spotlight address as sandboxes and egress reach it. |
SPOTLIGHT_SANDBOX_NETWORK | none | A container network egress joins, beside the sandbox's own network. |
SPOTLIGHT_SANDBOX_HOSTS | none | Comma-separated host:ip entries added to egress's hosts file. |
DOCKER_HOST | none | The 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.
| Registry | Keys looked up, in order |
|---|---|
| Docker Hub | https://index.docker.io/v1/, index.docker.io, docker.io, registry-1.docker.io |
| any other | <registry>, https://<registry>, http://<registry> |
| Entry field | Description |
|---|---|
auth | Base64 of <username>:<password>. When set, used in place of username and password. |
username | The user to pull as. |
password | The password or access token. |
identitytoken | A 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>.
| Variable | Sent to | Header |
|---|---|---|
ANTHROPIC_API_KEY | api.anthropic.com | x-api-key |
CLAUDE_CODE_OAUTH_TOKEN | api.anthropic.com | authorization: Bearer |
OPENAI_API_KEY | api.openai.com | authorization: Bearer |
CODEX_API_KEY | api.openai.com | authorization: Bearer |
CURSOR_API_KEY | api2.cursor.sh | authorization: Bearer |
OPENROUTER_API_KEY | openrouter.ai | authorization: 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
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_EGRESS_ALLOW | none | Comma-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_IMAGE | ghcr.io/usespotlightai/spotlight-runner:<release>, or :latest for a binary built without a release | The image egress runs from. Entries in SPOTLIGHT_RUNNER_IMAGE do not change it. |
SPOTLIGHT_EGRESS_ENV | egress.env beside the config file | A file of variables only egress gets. |
SPOTLIGHT_EGRESS_PASS | none | Comma-separated names of the host's own variables to pass to egress only. |
SPOTLIGHT_EGRESS_CA_BUNDLE | none | A PEM file of certificate authorities egress trusts upstream. Sandboxes do not trust them. |
See Egress for what egress allows and blocks.
Logs
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | info | error, warn, info or debug. The host gives it to each sandbox and egress as SPOTLIGHT_LOG_LEVEL. See Observability. |
Health checks
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_HEALTH_ADDR | none | Where 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
| Variable | Default | Description |
|---|---|---|
SENTRY_DSN | none | Where 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_ENVIRONMENT | the Sentry SDK's default | The 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
| Variable | Default | Description |
|---|---|---|
SPOTLIGHT_STATE | /var/lib/spotlight-host as root on Linux, else ~/.spotlight/host | The host's state directory, created with mode 0700. |
The state directory contains:
| Path | Contents |
|---|---|
<state>/host-id | The host's id, made on first start. |
<state>/host.lock | A 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>.git | Bare 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:
| Message | Cause |
|---|---|
SPOTLIGHT_URL is required | No address. |
SPOTLIGHT_POOL_TOKEN and SPOTLIGHT_TRUST are two different authentication methods; set one | A 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 trust | Neither a token nor a trust. |
SPOTLIGHT_OIDC_TOKEN_FILE names the workload token file, and is required with SPOTLIGHT_TRUST | Trust without a token file. |
SPOTLIGHT_CAPACITY: "<x>" is not a count of at least 1 | Bad capacity. |
SPOTLIGHT_SANDBOX_MEMORY: "<x>" is not a size such as 512m or 6g, or none | Bad memory limit, such as 1.5g. |
SPOTLIGHT_SANDBOX_MEMORY: "<x>" is below Docker's least limit, 6m | A memory limit below 6m. |
SPOTLIGHT_RUN_TIMEOUT: "<x>" is not a duration such as 6h | Bad timeout. |
SPOTLIGHT_RUNNER_IMAGE: "<x>" is not an image reference such as ghcr.io/acme/runner:main | Bad image entry. |
SPOTLIGHT_EGRESS_ALLOW: "*" allows everything; leave the list empty for that | SPOTLIGHT_EGRESS_ALLOW=*. |
SPOTLIGHT_EGRESS_CA_BUNDLE: <error> | The host cannot read the CA bundle file. |
SPOTLIGHT_EGRESS_CA_BUNDLE: <path> has no PEM certificate | The CA bundle file contains no PEM certificate. |
the sandbox environment sets <NAME>, which only the host has | A 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.