Agents

Register agents with registration tokens, approve them, and limit what each agent may write.

Agents

An agent is a machine that sends data to one account. It joins with a registration token, or asks to join and waits for approval. An approved agent holds Data writer on the account; narrow that grant to limit which tables it writes.

Manage agents under Settings → Account → Agents (Agent Management).

Register with a token

  1. Under Registration Tokens, select Create Registration Token.
  2. Choose Expires In (Default (30 days), or from 1 Hour to 1 Year). An expiry is never later than your own sign-in's. Agents registered with the token stop when it expires.
  3. Set Agents it can register (default 10, at most 10,000). Each machine that starts with the token becomes its own agent, so set it to the number of machines you will install, with room for replacements. An agent that sends its installation proof (X-Logship-Enrollment-Proof) redeems the token once: a retry, or a reinstall that kept its proof, gets new credentials for the agent it already registered instead of using up another.
  4. Under Tables agents can send to, keep All tables, or pick Specific tables and add table names or prefixes such as app.* (at most 64). Agents registered with the token send only to those tables, in every token they renew; records for other tables are dropped. The limit shows on the agent's row as Sends to …. Through the API, name them in schemas, for example [{ "schema": "app.*" }].
  5. Select Generate Token, copy it, and put it in the agent's configuration (agent configuration).

An agent that redeems the token is approved at once, so creating a token needs what approval needs: you must be able to hand on agent approval and data writing in the account (for example the Agent manager, Agent approver and Data writer roles, or account access administration). The same is checked again each time an agent redeems the token. A token stops working when its creator is disabled, changes their password or signs out of the session that created it (agent registration tokens); agents it already registered keep working.

Manage registration tokens

Registration Tokens lists the account's unexpired tokens: who created each, when it expires, the tables its agents send to, how many agents it registered of its limit, and its status: Open, Full (at its limit), Closed or Revoked. Viewing the list needs agent_registration.view (Agent viewer); closing and revoking need agent_registration.create_token (Agent manager). Agents registered with a token show Token and the start of its id under Active Agents.

  • Close stops the token registering agents. The agents it registered keep working.
  • Revoke ends the token and every agent it registered: their credentials stop working on every node within about a second, and they must register again with another token.

Neither can be undone. Every agent a token registered counts against its limit, revoked ones too, until it is deleted; deleting an agent frees its place. A machine that loses its stored credential registers again as a new agent and takes another place; delete the old one.

SituationWhat to do
Rotate the token in your install commandCreate a new token, put it in the install command, then Close the old one. Installed agents keep working.
The install command or token leakedClose the token at once so no new machine can join. Under Active Agents, review the agents with its Token, their hosts and when they were registered, and Revoke any you do not recognise. If you cannot tell them apart, Revoke the token, which disconnects all of them, and reinstall your machines with a new token.
A machine is decommissionedRevoke or Delete its agent. The other agents registered with the same token are unaffected; deleting frees its place.
The person who created the token leavesAgents they registered keep working. Their tokens stop registering new agents once they are disabled or lose agent approval; create a new token from another manager for new installs.

Approve a waiting agent

An agent that starts without a token appears under Pending Approvals with its name, host, device ID, source address and when it was first seen. Select Approve on its row, or tick several and select Approve selected, then confirm with Approve. Approving is privileged and needs agent_registration.approve (Agent approver). Delete removes the request. Until it is approved, an agent can do nothing. An approved agent's credential lasts jwt.apiTokenMaxLifetime (366 days by default) from its latest refresh; an agent that stops refreshing for that long must enroll and be approved again.

Active Agents shows each agent's Registered by: the creator of the token it redeemed, or who approved it, and when.

Limit what an agent writes

Each approved agent holds its own Data writer grant on the account. Narrow it like any other grant:

  1. Open Settings → Account → Access and set Subject to the agent.
  2. On its Data writer grant, select Edit condition and exceptions, open Advanced: exceptions and select Add deny.
  3. Set Denied permissions to table.write and Condition to the tables it must not write.

To grant an agent other roles, pick it in Grant access like a user. Custom roles must tick Agent under Can be granted to. Access on an agent's row manages who may view, edit or remove that agent, not what it holds.

Example: an edge agent that writes only edge.* tables

  1. Create a registration token with Expires In 1 Hour, Specific tables edge.*, and install the agent with it.
  2. To limit an agent that registered without a table limit, add an exception to its Data writer grant instead: Denied permissions table.write, Condition !resource.Name.startsWith("edge."). Confirm with Explain access: the agent, table app.logs, table.write is Denied.

Records the agent sends to other tables are dropped, and the rest are ingested (writing data).

Remove an agent

Revoke stops an agent: its tokens stop authenticating on every node within about a second. Delete removes it and ends every token it holds. Either leaves the other agents registered with the same registration token working. A refresh token stays usable until it expires (a day) even after the agent refreshes, so revoke or delete an agent whose token may have leaked.