Self-hosted Spotlight settings

A self-hosted Spotlight is configured through environment variables, read once when it starts. Hosts have settings of their own; see Host settings.

Validation

Spotlight checks the variables when it starts. With any problem, it stops and lists each one:

Invalid environment variables:
  <variable>: <problem>

Neither SPOTLIGHT_SECRETS_KEY nor SPOTLIGHT_SECRETS_KMS_KEY_ID set gives SPOTLIGHT_SECRETS_KEY: wraps each workspace data key when SPOTLIGHT_SECRETS_KMS_KEY_ID names no AWS KMS key; generate one with: openssl rand -base64 32.

Service

VariableDefaultDescription
DATABASE_URLrequiredA postgres:// or postgresql:// URL.
PORT3000The port Spotlight listens on.
NODE_ENVdevelopmentdevelopment, test or production.
LOG_LEVELdebug in development, else infofatal, error, warn, info, debug, trace or silent. What Spotlight logs is in Observability.
SPOTLIGHT_RELEASEnoneThe release the install script installs, and the runner image tag it pulls, when it is a release, as in v0.1.0. Without it, or with any other value, canary, the latest staging build.
SPOTLIGHT_INSTALLER_DIR/opt/spotlight/installerThe directory that contains the install.sh served at /api/install.sh.
REDIS_URLnoneA redis:// or rediss:// URL. Set it to run more than one control plane server: the servers then share live updates in the app, run streams, live drafts, host tunnels, the leader lease and the rate limit through Redis. Without it, run one server.
REDIS_URLnoneA redis:// or rediss:// URL. Lets several control plane servers share live drafts, run streams, notifications, host tunnels, the leader lease and the rate limit. Set it when you run more than one server.

Addresses and sign-in

VariableDefaultDescription
BETTER_AUTH_URLrequiredThe app's public URL, used for sign-in.
BETTER_AUTH_SECRETrequiredSigns sessions. At least 32 characters.
SPOTLIGHT_PUBLIC_URLBETTER_AUTH_URLThe Spotlight address in what Spotlight hands out: the install script's SPOTLIGHT_URL, invite links, links in Slack and on GitHub, the OAuth callback and the issuer of hook tokens.
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETrequiredThe GitHub OAuth app people sign in with.
GITHUB_APP_IDrequiredThe GitHub App that clones and pushes.
GITHUB_APP_PRIVATE_KEYrequiredThe GitHub App's private key, in PEM. \n in the value is read as a line break.
GITHUB_WEBHOOK_SECRETemptyThe GitHub App's webhook secret. While empty, every GitHub webhook is rejected.

Secrets

VariableDefaultDescription
SPOTLIGHT_SECRETS_KEYnone32 bytes, base64 encoded, as made by openssl rand -base64 32. Wraps each workspace's data key, which encrypts secrets and the other credentials Spotlight keeps, such as integration connection tokens. Required unless SPOTLIGHT_SECRETS_KMS_KEY_ID is set.
SPOTLIGHT_SECRETS_KMS_KEY_IDnoneAn AWS KMS key that wraps workspace data keys. When set, used in place of SPOTLIGHT_SECRETS_KEY.

AWS KMS is reached with the default AWS credential chain and region.

Never lose SPOTLIGHT_SECRETS_KEY. Without it, no encrypted value can be decrypted: every secret has to be set again and every integration connected again.

Calls out of Spotlight

VariableDefaultDescription
SPOTLIGHT_OUTBOUND_ALLOWED_HOSTSemptyThe hosts that Spotlight may call for a workspace's configuration, separated by commas. Empty allows every public host. See Allowed hosts.
SPOTLIGHT_OUTBOUND_ALLOW_LOOPBACKfalseWith true, Spotlight may call a loopback address for a host that SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS names. For tests and local development.
SPOTLIGHT_OUTBOUND_RATE_LIMIT50The requests each workspace may send to other services each second. At least 1. See Rate limit.
OAUTH_CLIENTS{}The deployment's OAuth clients, as JSON mapping an integration's name to { "id", "secret" }, with issuer, the authorization server, for an MCP server it discovers. Used for an integration whose definition has no connection.oauth2.client. See OAuth client. Example: {"linear":{"id":"...","secret":"..."}}.
HOOK_SIGNING_KEYnoneA P-256 private key, in PEM, that signs hook OIDC tokens with ES256. \n in the value is read as a line break. Without it, a hook with oidc is rejected.
SPOTLIGHT_MCP_RELIST_SECONDS600How often the tools of an integration's MCP server are listed again.
SPOTLIGHT_CATALOG_URLhttps://catalog.usespotlight.aiWhere catalog tools are called. Always reached, whatever SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS says.
SPOTLIGHT_CATALOG_TOKENnoneThe token sent with each catalog call.

Register each OAuth client with the callback <SPOTLIGHT_PUBLIC_URL>/api/integrations/oauth/callback. See OAuth connect and callback.

OAUTH_CLIENTS that is not JSON, or not of this shape, stops Spotlight at start with OAUTH_CLIENTS is not JSON: <error> or OAUTH_CLIENTS must map an integration name to { id, secret }, ....

Calls the settings apply to

SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS and the blocked addresses apply to each call that Spotlight makes for a workspace's configuration:

  • Integration requests: actions that Spotlight sends, with from set to spotlight, polls, schedules, tools, file fetches and event lookups.
  • Hook requests that Spotlight sends, with from = "spotlight".
  • Remote MCP servers.
  • OAuth discovery, token exchange and client registration.
  • API spec fetches.
  • The JWKS of a webhook's JWT check.
  • The provision calls of push pools.
  • OIDC discovery and the JWKS of the issuer of an OIDC trust or a runner trust.

They do not apply to hook requests and integration actions whose from is network, which a host of the workspace sends through its egress, or to the calls Spotlight makes for itself, such as to GitHub, the catalog, model providers and the push services. The time and size limits of these calls are in Limits and timeouts.

Allowed hosts

SPOTLIGHT_OUTBOUND_ALLOWED_HOSTSHosts Spotlight calls
emptyAny public host.
a listEach exact host listed, and the subdomains of each *.<domain> entry. *.example.com allows api.example.com, not example.com.

An entry is a host, such as api.example.com, or a pattern, such as *.example.com. An entry has no scheme, port or path. Host names are compared without regard to case, and without the port.

An entry that is not a host or a pattern stops Spotlight at start with one of:

MessageCause
"*" permits every host. Leave the list empty to permit every public host.The entry is *.
"<entry>" is not a pattern such as *.example.com.The entry starts with *., and the rest has a * or has no ., as in *.com.
"<entry>" is not a host such as api.example.com or a pattern such as *.example.com.The entry has a *, /, : or space.

Workspace lists

A workspace can have its own list of hosts, outboundHosts, with the same entries as SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS. For the calls below, Spotlight calls a host only if both lists allow it:

SPOTLIGHT_OUTBOUND_ALLOWED_HOSTSWorkspace's outboundHostsHosts Spotlight calls for the workspace
emptyemptyAny public host.
emptya listThe hosts the workspace's list allows.
a listemptyThe hosts the deployment's list allows.
a lista listThe hosts both lists allow.

The workspace's list applies to each call that Spotlight makes for the workspace's configuration, as in Calls the settings apply to:

  • Integration requests: actions that Spotlight sends, polls, schedules and the tools written in a definition.
  • Tools generated from an API spec, and the tool calls of an MCP server.
  • The event lookups and file fetches of a webhook delivery, and the JWKS of a webhook's JWT check.
  • OAuth discovery, client registration, token exchange and token refresh, both the refresh when a call gets 401 and the refresh before a token expires.
  • API spec fetches, and the listing of an MCP server's tools.
  • Hook requests that Spotlight sends, with from = "spotlight". Spotlight checks the host when the request is sent, and when the hook is written if its url has no expression. A hook definition whose url names a host that either list does not allow is rejected with sends to <host>, which is not an allowed outbound host.
  • The provision calls of push pools. A blocked call fails with not-allowed and This workspace’s outbound allow-list doesn’t include <host>.
  • OIDC discovery and the JWKS of the issuer, when a workload exchanges a token through an OIDC trust or a runner trust admits a runner.

It does not apply to hook requests and integration actions whose from is network, which a host of the workspace sends through its egress, or to the calls Spotlight makes for itself. For those, the host's egress allow-list decides.

A call to a host that the workspace's list does not allow is blocked with Outbound call to <host> blocked. Host is not on the workspace's allowed list. The workspace's list does not change the blocked addresses. Spotlight calls a private or loopback address only for a host that SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS names.

Each control plane server keeps a workspace's list for up to 30 seconds after it reads it, so a change can take up to 30 seconds to apply to calls. The check of a hook definition reads the list when the hook is written.

Blocked addresses

Spotlight checks each address that a host resolves to, each time it opens a connection. This includes the connection for each redirect. If one of the addresses is blocked, Spotlight does not call the host. If a URL names an IP address, Spotlight checks that address.

AddressBlocked
Link-local (including 169.254.169.254), multicast, unspecified, 0.0.0.0/8Always.
Loopback: 127.0.0.0/8, ::1Unless SPOTLIGHT_OUTBOUND_ALLOW_LOOPBACK is true and SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS names the host.
Private: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, fc00::/7, 64:ff9b::/96, 2002::/16Unless SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS names the host. An empty list names no host.
Any otherNever.

Errors and messages lists the messages of a blocked call. These settings do not apply to the connections out of a sandbox. A host has its own allow-list for them; see Limit where sandboxes can connect.

Rate limit

Each workspace may send SPOTLIGHT_OUTBOUND_RATE_LIMIT requests each second to other services, and as many at once after a second with no requests. The hosted service uses the default, 50.

The limit counts:

  • Integration polls, schedules and actions. This includes actions whose from is network, each counted once before Spotlight queues it for a host.
  • The event lookups and file fetches of a webhook delivery.
  • Tool calls: tools written in the definition, tools generated from an API spec, and the tools of an MCP server. This includes a hook step with call.
  • Hook requests that Spotlight sends, with from = "spotlight". Spotlight checks the limit before it signs or sends the request.

Each counts once, also when Spotlight sends it again after it refreshes an OAuth token. The limit does not count hook requests with from = "network", the listing of an MCP server's tools, OAuth discovery, token exchange, refresh and client registration, API spec fetches, the JWKS of a webhook's JWT check, the provision calls of push pools, the OIDC discovery and JWKS of a trust, or the calls Spotlight makes for itself.

When REDIS_URL is set, all control plane servers share the count of each workspace through Redis. Without REDIS_URL, each server counts on its own. If Redis fails or does not answer within 2 seconds, each server counts on its own until Redis answers again. Spotlight logs Limiting outbound calls on this instance alone, without Redis, at most once a minute on each server.

When the workspace is over the limit, a call waits up to 5 seconds for a free request. If no request becomes free in that time, the call fails and is not sent:

CallResult
Tool call from a runThe agent gets 502 with calling a service: this workspace sends more than <limit> requests each second to other services.
PollSpotlight logs a warning with the same message. The poll raises nothing and keeps its cursor. The next poll is at its usual time.
ScheduleSpotlight logs a warning with the same message. The schedule runs again at its next time.
Action on a task eventSpotlight logs a warning with the same message. Spotlight does not send the action again.
Event lookupReading the delivery fails. Spotlight retries it as in Delivery address.
File fetchSpotlight logs a warning, and the task gets no copy of the file.
Hook step with callThe step fails with tool-failed and the same message.
Hook requestThe step fails with throttled and the reason this workspace sends more than <limit> requests each second to other services.

A failed hook step is retried as in Failures.

Sandboxes

VariableDefaultDescription
SPOTLIGHT_SANDBOX_GRACE10mHow long a sandbox with no run and no editor stays up before Spotlight drains it. The sandbox of a task at Completed drains with no grace.
SPOTLIGHT_EDITOR_LIMIT12hHow long editors alone keep a sandbox up after the last run in it ended.
SPOTLIGHT_WARM_SANDBOX_AGE24hHow long a warm sandbox that no run took stays up before Spotlight drains it and starts a new one.

Each is a whole number above 0 followed by ms, s, m or h, such as 90s, 10m or 12h. A value in another form fails validation with <variable>: is a duration such as 90s, 10m or 12h. See Sandbox lifetime.

Platform egress

VariableDefaultDescription
SPOTLIGHT_PLATFORM_EGRESS_URLnoneThe URL of the deployment's own shared egress, http or https. A push pool names it as spotlight in provision.egress. Without it, spotlight is rejected.
SPOTLIGHT_PLATFORM_EGRESS_TOKENnoneThe token that egress calls Spotlight with: 32 to 255 of A-Z a-z 0-9 . _ ~ -. Give the same value to the egress as SPOTLIGHT_EGRESS_TOKEN.

Give both or neither. One without the other gives SPOTLIGHT_PLATFORM_EGRESS_TOKEN: goes with SPOTLIGHT_PLATFORM_EGRESS_URL. Set both to name the platform egress, or neither; generate a token with: openssl rand -hex 32. With NODE_ENV production, a runner is not provisioned for an egress whose URL is not https.

Models

Spotlight calls no model itself, so a deployment sets no model or model key. Change stacks, the grading of answers to layer questions, judges and memory upkeep run as sessions in the team's own harness.

Error reporting

VariableDefaultDescription
SENTRY_DSNnoneWhere Spotlight reports its errors. Without it, nothing is reported.
SENTRY_WEB_DSNSENTRY_DSNWhere the web app reports its errors.
SENTRY_ENVIRONMENTthe Sentry SDK's defaultThe environment on each report.

See Error reporting for what a report contains.

Custom settings pages

A deployment can add its own pages to the settings of the web app, such as a handbook for its people. Each of these custom settings pages is a custom element that a JavaScript module on the address of the web app defines. Spotlight loads the module when a person opens the page.

VariableDefaultDescription
SPOTLIGHT_CUSTOM_SETTINGS_PAGESemptyThe pages, as a JSON array. Empty adds no page.
SPOTLIGHT_CUSTOM_SETTINGS_PAGES='[{"id":"handbook","label":"Handbook","roles":["owner"],"script":"/handbook/element.js","element":"x-handbook-page"}]'
FieldDefaultDescription
idrequiredUp to 32 lowercase letters and digits, in groups joined by single hyphens, as handbook or team-handbook. The page opens at /w/<slug>/settings/custom/<id>. Each page has its own id.
labelrequired1 to 40 characters: the text in the sidebar and the title of the page.
groupworkspaceThe sidebar group of the page: workspace or account. The page comes after the pages of Spotlight in that group.
roles["owner", "admin"]The roles that see the page: owner, admin and member. At least one.
scriptrequiredThe path of the module on the address of the web app, as /handbook/element.js. Route that path to your own service, for example with a rule in your reverse proxy. A URL, a path that starts with //, and a path with a backslash, a . or .. segment, ?, #, % or a space are refused.
elementrequiredThe name of the custom element that the module defines, as x-handbook-page. Each page has its own element. A name that HTML keeps for its own elements, such as font-face, is refused.

There are at most 8 pages. Spotlight checks the pages when it starts, as in Validation. A script on another address gives SPOTLIGHT_CUSTOM_SETTINGS_PAGES.0.script: is a path on this origin, as in /handbook/element.js.

What the element gets

Spotlight shows the element under the title of the page, with these attributes:

AttributeValue
workspaceThe slug of the workspace.
workspace-roleThe role of the person in the workspace: owner, admin or member.
themelight or dark: the theme that the app shows. It changes when the person changes the theme.
contract-version1. Spotlight changes it when what the element gets changes.

To open another page of the app, the element sends a spotlight-navigate event with the path in detail.to, as in /w/acme/settings/members. Send it with bubbles and composed set. Spotlight opens only paths on its own address. It ignores a URL on another address.

The theme variables of the app, such as --background, --foreground, --primary, --border and --radius, also apply inside a shadow root. Put the content of the element in a shadow root, so that the styles of the app and of the element do not change each other.

When the module fails to load, or does not define the element within 10 seconds, the page shows "The <label> page could not be loaded." with "Try again". A page that SPOTLIGHT_CUSTOM_SETTINGS_PAGES does not add, or that is not for the person's role, opens the General settings.

Security

  • The module runs in the web app as the person who opens the page, and can do what that person can do. Add only modules that you control.
  • Only SPOTLIGHT_CUSTOM_SETTINGS_PAGES adds pages. A workspace cannot.
  • roles only hides the page from the other roles. The service behind the page must check who the person is, and their role, itself. The browser sends the Spotlight session cookie with each request to the address of the web app.
  • The content security policy of the web app does not change. A page cannot load a script from another address or show a frame. To send a person to another site, use a link or a redirect.

Traces and metrics

Spotlight exports traces and metrics only when an OTEL_* exporter is set. The variables are in Observability.

Storage

Attachments and working copy archives are kept in one S3 bucket. Browsers and runners never get its keys: they upload and download through presigned URLs that last 15 minutes.

VariableDefaultDescription
S3_BUCKETrequiredThe bucket's name.
S3_REGIONus-east-1The bucket's region.
S3_KEY_PREFIXnoneA prefix for the keys that this instance writes, such as previews/feat-x. Spotlight adds the / after it. See Objects.
S3_ENDPOINTAWSThe S3 endpoint Spotlight itself calls. Set for storage other than AWS S3.
S3_FORCE_PATH_STYLEfalsetrue addresses the bucket by path, for S3_ENDPOINT and S3_RUNNER_ENDPOINT.
S3_PUBLIC_ENDPOINTS3_ENDPOINTThe endpoint in URLs presigned for browsers, such as a CDN.
S3_PUBLIC_FORCE_PATH_STYLEfalsetrue addresses the bucket by path in URLs presigned for browsers.
S3_RUNNER_ENDPOINTS3_ENDPOINTThe endpoint in URLs presigned for runners, for when S3_ENDPOINT is private.
S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEYnoneThe bucket user's keys. Without both, the default AWS credential chain.

Egress always allows the storage host runners reach: the host of S3_RUNNER_ENDPOINT, else of S3_ENDPOINT, else <bucket>.s3.<region>.amazonaws.com, or s3.<region>.amazonaws.com with S3_FORCE_PATH_STYLE.

Objects

KeyContains
pending/<workspace id>/<attachment id>A file a browser has uploaded but no task, answer or message has taken yet.
workspaces/<workspace id>/attachments/<attachment id>A file a task, answer or message has taken.
workspaces/<workspace id>/archives/<archive id>.tar.gzA working copy archive.

A browser uploads to pending/. Once a task, answer or message that names the file is saved, Spotlight copies it under workspaces/ and the pending copy is dropped. Spotlight never removes an attachment under workspaces/. It removes archives itself, on the schedule in Limits and timeouts.

With S3_KEY_PREFIX, every key above starts with the prefix when Spotlight writes it, such as previews/feat-x/pending/…. To read an object, Spotlight tries the key with the prefix first, then the key without it. So an instance that runs on a copy of another instance's database finds the other instance's files, and never changes them: it deletes only keys under its prefix. A delete in that instance does not remove the other instance's object, but the copied database no longer refers to it.

Bucket setup

Spotlight does not create the bucket. It needs:

  • Public access blocked.

  • A CORS rule for the app's origin:

    [
      {
        "AllowedOrigins": ["https://spotlight.acme.example"],
        "AllowedMethods": ["PUT", "GET"],
        "AllowedHeaders": ["content-type", "x-amz-meta-uploader", "x-amz-meta-name"],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
      }
    ]
  • A lifecycle rule that expires objects under pending/ after one day.

Never expire objects under workspaces/. An archive that expires takes its task's conversation with it.

The keys need only s3:PutObject, s3:GetObject and s3:DeleteObject, on arn:aws:s3:::<bucket>/pending/* and arn:aws:s3:::<bucket>/workspaces/*. With S3_KEY_PREFIX, they also need the same actions on arn:aws:s3:::<bucket>/<prefix>/*.

Notifications

Spotlight tells a person about each new item in their inbox. An open Spotlight tab gets the item through the server. A browser that is closed gets it through Web Push, which needs a VAPID key pair. Generate one with npx web-push generate-vapid-keys.

VariableDefaultDescription
VAPID_PUBLIC_KEYnoneThe public key of the pair, base64url.
VAPID_PRIVATE_KEYnoneThe private key of the pair, base64url.
VAPID_SUBJECTnoneA mailto: or https: address where push services can reach the operator.

Give all three or none. Some but not all gives VAPID_PUBLIC_KEY: goes with VAPID_PRIVATE_KEY and VAPID_SUBJECT. Set all three to send Web Push, or none; generate a key pair with: npx web-push generate-vapid-keys. Without them, Spotlight sends no Web Push, and notifications show only while a Spotlight tab is open. Keep the same key pair: a new pair stops Web Push to every browser until each person turns notifications on again.

Spotlight sends Web Push only to these push services, whatever SPOTLIGHT_OUTBOUND_ALLOWED_HOSTS says. The list is fixed. A browser whose push service is not on it cannot turn on Web Push: Spotlight answers 422, and a message at the bottom of the settings page shows the 422.

  • fcm.googleapis.com (Chrome and other Chromium browsers)
  • updates.push.services.mozilla.com (Firefox)
  • web.push.apple.com and *.push.apple.com (Safari)
  • *.notify.windows.com (Edge on Windows)

With several control plane servers, set REDIS_URL. Without it, an open tab gets only the items that the server holding its connection announces, and misses the others.

Mail

Spotlight sends invites by email.

VariableDefaultDescription
SMTP_URLnoneThe mail server, as in smtps://user:pass@smtp.example.com:465.
MAIL_FROMSpotlight <noreply@usespotlight.ai>The sender. Must be one the mail server permits.

With SMTP_URL unset, Spotlight sends nothing. It logs each message at warn with No mail server is configured, so Spotlight only logged this message.

On this page