Pools, trusts and tokens
People reach a Spotlight workspace by signing in: in the web app, or at a
terminal with spotlight login,
which lets the spotlight command and the Terraform provider act as that
person, with their role. Everything else that acts in
it, a machine running agents or a pipeline applying Terraform, needs a
credential of its own. Spotlight has eight kinds, and they differ in who stores
them, how long they last, and what can be done with one that is stolen.
The eight split into two families. Pool tokens, runner trusts, one-run credentials, egress tokens and run proxy credentials let machines do work: claim runs, carry them out, and add their secrets to outgoing requests. Workspace tokens, OIDC trusts and the token a setup chat's run gets let tools read or change configuration through the resource API. The two families never overlap. A pool token cannot create or change a line, and a workspace token cannot claim a run.
Machines that do work
Pool tokens: a secret the host stores
A pull pool is a named group of hosts that share one token. A host stores the token and presents it every time it requests work. Spotlight stores only a hash of it, and a token Spotlight issues is shown only once.
Each token is single-use. A pool token that was rotated away, or that belonged to a pool since deleted, never works again, even if someone gives it to a new pool later. Rotating is a matter of giving the pool a new token: the old one stops being accepted at once, and runs already claimed with it carry on with their own credentials.
The pool token is the simplest credential source. It works on any machine that can make an outbound HTTPS connection, including a laptop behind a home router. Like any stored secret, it sits in a file on the host until someone rotates it, and anyone who copies it can claim the pool's runs from anywhere. Create a pull pool and get its token sets one up.
A push pool turns this around. Spotlight has no token for it; it calls the pool's provisioning endpoint for each run, signs every call with a secret the pool was given, and hands the sandbox it starts a credential for that one run. The endpoint has to be HTTPS in production, because the call carries that credential.
Runner trusts: nothing stored at all
Many platforms that run workloads, such as Kubernetes clusters and CI services, give each workload a short-lived identity token signed by the platform, an OIDC token. A runner trust tells Spotlight to accept one: tokens from this issuer, for this audience, with exactly this subject.
A host that a trust accepts has no Spotlight secret. It presents its workload token, which it rereads from the platform on every claim, and each claim starts a runner for one run through the trust, the way a pool claim does. Spotlight never issues the host a credential of its own. There is nothing on the machine to steal that outlives the platform's own short-lived token, and nothing to rotate. A trust only works where a platform issues such tokens, though, and it is exactly as trustworthy as the issuer's idea of who a workload is. A runner trust keeps that idea narrow: the subject must match exactly, and it has no wildcards. Run hosts without a stored token walks through it.
One-run credentials: what a sandbox gets
Neither the pool token nor the workload token ever enters a sandbox. When a host claims a run, Spotlight answers with a credential that is good for that one run and nothing else, and that is what the host passes into the sandbox. A runner that has it can claim exactly one piece of work; a second claim fails. Inside the sandbox, the runner reads the credential from the file the host laid down and deletes the file. The agent's processes do not inherit the runner's Spotlight settings or its credential; from the runner they get a local address and a token for handing the task over.
This is the credential side of Why a sandbox belongs to one task: whatever a run could do with what it was given ends when the run does, even when the next run of its task works in the same sandbox. The credential that lets a host keep working stays on the host.
The same thinking applies to git. A sandbox clones and pushes through Spotlight, which stores the GitHub App's credential and adds it on the way to GitHub. The app's credential is never sent to a runner. A run can reach only the repositories its own work names, and only while its runner still has the lease on that work.
Egress tokens and run proxy credentials: a push pool's shared egress
A push pool can name a shared egress, which injects the secrets of many runs into their requests. Two credentials split that job so that neither is worth much alone. The egress process stores the egress token, and Spotlight stores it as a hash. It is the only credential that can fetch the secrets that egress injects for a run, and it never enters a sandbox. Like a pool token, it is single-use, and after a rotation the old one stops working at once.
The run proxy credential is made for one runner, sent in the provision call, and stored by the runner. It lets the run send its traffic through the egress its pool names, and nothing more: Spotlight's API does not accept it, and Spotlight accepts it through the egress only while the runner has not ended. A stolen run proxy credential reaches no secret, since the secrets stay in the egress. A stolen egress token fetches secrets only together with the run proxy credential of a runner whose pool names that egress. Send push pool runs through an egress sets both up.
Tools that read or change configuration
Workspace tokens: stored and scoped
A workspace token lets a program such as Terraform act in one workspace. Like a pool token it is stored as a hash, and it lasts until it is revoked or reaches its expiry, if it has one. What it may do is set by its scopes, fixed when it is issued. Most of them form a ladder from reading configuration to changing it, and three sit beside the ladder and are never implied by it. Two of those are set apart because of where the risk is.
secrets is kept out of configure so that a leaked CI token cannot rebind a
secret to a host its holder controls, and so capture the secret's value.
runners, which manages pools, runner trusts and which of them serve the
workspace, is kept apart because a runner claims runs, checks out repositories
and acts on them with Spotlight's git access: adding a pool or trusting an
issuer amounts to handing out a credential. The third, trusts, covers
OIDC trusts, which issue tokens of their own (see below).
No token administers the workspace; that stays with admins signed in as themselves. The scopes and who may issue a token are listed in Workspace tokens, and issuing one in Issue a workspace token.
OIDC trusts: tokens that expire on their own
A workspace token in a pipeline's secret store has the weakness of any stored secret: a leaked token stays valid until someone revokes it. OIDC trusts exist because CI platforms already issue short-lived OIDC tokens to each job, the same kind of token a runner trust accepts, and Spotlight checks them with the same verifier it uses for runner trusts.
A pipeline sends its job's OIDC token to Spotlight with the trust it wants to
use, and gets back a workspace token that expires within the hour. There is
nothing to store in the pipeline and nothing to rotate. A trust can also tell
jobs apart: its subject and claims are patterns, so a trust for the main branch
can grant configure while a trust for pull requests grants only plan.
Owners and admins see every trust, and when it last issued a token, under
"OIDC trusts" on the API access page of the workspace settings.
Patterns bring a risk that exact subjects do not. A trust open to every owner
would match any workload its issuer signs a token for, which on a public CI
service means anyone's. So a pattern must name its owner before its first
wildcard, as in repo:acme/*.
A trust's tokens act for the person who created the trust, and are tied to the
trust as it was when they were issued; spotlight_oidc_trust lists those rules and the
lifetimes. Run Terraform from GitHub Actions without a stored token shows the whole setup.
A setup chat's token: stored by egress, never by the agent
The setup chat plans Terraform against the workspace, so its run needs a token. A token in the agent's environment would be one the agent could print, or send anywhere the sandbox reaches.
Spotlight issues a token for that run alone, which may read and plan and nothing more, and seals it to the run's egress. The agent has a stand-in, and egress swaps the token in only on requests to Spotlight. The token expires within the hour and is revoked when the run or its attempt ends; see The run's Spotlight token.
Stored secrets and trusts compared
The pattern across both families is the same. A stored secret, whether a pool token or a workspace token, is the most portable: it works anywhere, and it keeps working after it leaks until someone notices. A trust, whether a runner trust or an OIDC trust, stores nothing, and a stolen token is worth minutes; in exchange it needs a platform that issues identities, and it moves trust onto that platform.
Our recommendation is to use a trust wherever the platform supports one. A host on a Kubernetes cluster and Terraform in a CI pipeline both already have a workload identity to offer, and using it costs one resource. A pool token earns its place on a machine that has no identity of its own. For work done by hand on a laptop, a person's own login needs no workspace token: it acts as that person, and it ends after 7 days without use. A stored workspace token remains for a script that runs with no person present. The one-run credential is not a choice; every run gets one, however its host got in.
The reference pages list the fields:
spotlight_runner_pool,
spotlight_runner_trust, Workspace tokens,
spotlight_oidc_trust
and The run's Spotlight token.