Skip to main content
A worker token is the credential a self-hosted agent uses to talk to the Komodor Agentic Operation Platform (KAOP). Each self-hosted agent has one, and it works only for that agent in your account. Its pods send it on every call, from heartbeats to claiming runs and reporting results. For an agent that Komodor hosts, KAOP creates the token and delivers it to the agent, so there is nothing for you to handle. For an agent on a management cluster, koperator fetches and stores the token for you, as described under each step below.

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:
The response carries the token (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 as AGENTOPS_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.
On a management cluster, koperator fetches the token from KAOP and writes it into a Secret it owns, named <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, send ttlSeconds when you issue or rotate it:
  • ttlSeconds is 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 send ttlSeconds each time.
Because the longest lifetime is 24 hours, 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>.
Between the first step and the last, the agent’s pods cannot authenticate, so rotate when a short gap is acceptable. The old and new values never work side by side. On a management cluster, koperator does the second and third steps for you: it sees the new token, writes it into its Secret and rolls the pods. Rotating an archived agent’s token also takes the agent out of the archive.

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 204 and is safe to repeat:
A revoked token cannot be restored. To bring the agent back, issue a new token with Generate or the API, and deploy it. How other agent actions affect the token:
  • 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 gets 401. 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-tokens returns 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.