What a token is
- A token starts with
wt_. The rest is random. - KAOP shows the value once, when it issues or rotates the token, and cannot show it again. If you lose it, rotate the token.
- A worker token cannot issue, rotate or revoke tokens. Only a person or an API key with the right permission can.
{agent} is the agent’s Agent ID or its agt_… id.
Issue a token
The Add agent wizard issues the token when you deploy a self-hosted agent and puts it in the Helm values it gives you. To issue one from the API:token), a short hint to recognize it later (workerTokenHint),
the agent (agentId) and its expiry (expiresAt, null when it does not expire). When no agent
has that Agent ID yet, KAOP creates the agent, and it reads Not installed until its first worker
connects.
Where the token lives in the pod
The agent’s Helm chart reads the token from a Kubernetes Secret and passes it to the worker asAGENTOPS_WORKER_TOKEN. You choose where that Secret comes from:
- With
value, the chart creates the Secret, and the token is also in your Helm release values. Keep those values out of Git. - With
existingSecret, you create and manage the Secret yourself, for example with External Secrets or Sealed Secrets, and the token never appears in the Helm values. Use this in production. - When the chart’s KEDA autoscaling is on, the KEDA scaler reads the same Secret.
<agent id>-agentops-bootstrap. Each fetch is recorded in the audit log.
Expiry
A token does not expire unless you ask it to. To give one a lifetime, sendttlSeconds when you
issue or rotate it:
ttlSecondsis a whole number from 1 to 86400 (24 hours). A value outside that range is refused.- Once a token expires it no longer authenticates. Its status reads Expired, and the agent’s page asks you to rotate it.
- An expiry belongs to one issue or rotation and is not carried to the next. Rotate in the
console sends no
ttlSeconds, so a token rotated there does not expire. To keep an expiry, rotate from the API and sendttlSecondseach time.
ttlSeconds suits tests and short-lived deployments. For
a long-running agent, use a token with no expiry and rotate it on your own schedule.
Rotate a token
Rotating issues a new value for the same agent. The old value stops working, as described in How fast a change takes effect. The agent keeps its id, its run history and its configuration.1
Rotate the token
In the console, choose Rotate on the agent’s Worker token card or in Settings → Agents
→ Worker tokens, and copy the new value from the dialog. From the API, send the same
POST /api/v1/agents/worker-token call again for the agent.2
Put the new value where the pods read it
Update the Secret you manage, or set
controlplane.workerToken.value in a helm upgrade.3
Restart the agent's pods
The worker reads
AGENTOPS_WORKER_TOKEN when it starts, so a running pod keeps the old value
until it restarts. For example: kubectl rollout restart deployment/<release> -n <namespace>.Rotate on a schedule
KAOP has no built-in rotation schedule. To rotate regularly, run the steps above from your own scheduler, such as a CI job that calls the API, writes the new value into your secret store, and restarts the deployment.Revoke a token
Revoking deletes the agent’s token. Its pods can no longer authenticate, so the agent goes offline and takes no new runs. The agent stays, with its history and configuration. Revoking does not stop the worker process itself.- In the console, choose Revoke on the agent’s Worker token card or in Settings → Agents → Worker tokens, and confirm.
-
From the API, the call answers
204and is safe to repeat:
- Delete an agent and its token is revoked.
- Archive and Stop leave the token unchanged.
- The general credentials API refuses to change or delete a worker token. Use the agent endpoints above.
How fast a change takes effect
KAOP refuses a revoked, rotated-out or expired token as soon as it checks the token against its records. To keep up with the volume of agent calls, some KAOP services hold a short in-memory copy of credentials used in the last 30 seconds, so on those services an old token can keep working for up to 30 seconds. Plan on a revoke or rotation taking full effect within 30 seconds. After that, every call with the old token gets401. The same window applies to API keys and to changes in a person’s roles.
Check a token’s status
Status shows metadata, never the token value.- Settings → Agents → Worker tokens lists every worker token in the account, including those of agents that have not connected yet, with Agent status, Token, Created and Expires. Filter by Active or Expired.
- The agent’s Worker token card shows Created, Last rotated and Expires, which reads Never for a token with no expiry.
-
From the API:
GET /api/v1/agents/worker-tokensreturns the same fields for every token in the account.
Audit
Every change to a token is recorded in the audit log with the person or API key that made it.
A rotation and a first issue write the same event. An
agent.token_create for an agent that already
had a token is a rotation, and Last rotated shows when the latest one happened.
Next steps
Agent identity
How a self-hosted worker authenticates as its agent.
Deploy a self-hosted agent
The Helm install that carries the token.