Yesterday we switched off the last unscoped API tokens. Since January 2025, anyone who created a token in the console got a string that could do everything its owner could: delete servers, launch runbooks, read invoices. That was convenient and, in hindsight, a bad default. Scoped tokens went generally available in October (CLI 1.7.0). The legacy ones stopped working on Monday.
What a token looks like now
acl_k3f9d2hx_9Zq4WmT1pLr7aVbN0cE5uYgS8oXjH6dK
acl_is a fixed prefix, so secret scanners can find a leaked token in a repository or a paste.- The next eight characters are a public identifier. It appears in the console, in audit events and in log lines, and it is useless without the rest.
- The remainder is a 32-character base62 secret, about 190 bits of randomness.
We store only a SHA-256 hash of the secret part. If you lose the token we cannot show it to you again, because we do not have it. The old format could be shown in full for the first 24 hours after creation, which is exactly as dangerous as it sounds.
Scopes, expiry and network limits
A token carries a list of scopes, an expiry and, optionally, a list of CIDR blocks it may be used from.
| Scope | Allows |
|---|---|
servers:read | List and read servers, sites, plans |
servers:write | Create, delete, power actions, console |
runbooks:read | List runbooks and read job output |
runbooks:launch | Launch and cancel jobs |
images:write | Build and delete images |
inventories:write | Sync and modify inventories |
tokens:admin | Create and revoke tokens |
billing:read | Read usage and invoices |
Expiry defaults to 90 days and cannot exceed 365. A token for a CI job might look like this:
$ acloud token create --name ci-deploy \
--scope servers:read --scope runbooks:launch \
--expires 90d --allow-cidr 203.0.113.0/24
id: tok_01JC7R8M2Q
name: ci-deploy
scopes: servers:read, runbooks:launch
expires: in 90 days
secret: acl_k3f9d2hx_9Zq4... (shown once)
The equivalent API call is POST /v1/tokens with the same fields. A request that needs a scope the token does not have gets a 403 with "code": "insufficient_scope", and the response lists the scope it wanted.
What we learned from the old tokens
When we started the migration in August we had 1,214 active legacy tokens. We wrote to every account owner and gave them a list.
- 41% had not been used in the previous 90 days. Most of these belonged to people who had left, or to projects that had.
- 17% were used from more than one network, which is usually a sign of one token shared by a laptop and a CI system.
- 9% had made at least one call from an address we had not seen for that account in the previous year. We did not assume that this meant anything, and asked. Every one turned out to be an employee on holiday or a CI provider changing addresses.
- Three accounts asked for an extension. We gave them to November 16 and no later.
The cleanup alone justified the project. Old credentials are a liability that accumulates quietly, and the only time anyone looks at them is when something goes wrong.
For integrators
Nothing changed in the API version. /v1 stayed /v1. The only breaking behaviour is that a legacy token returns 401 with "code": "token_retired" and a link to the migration guide. If you see that in your logs, create a scoped token and swap it in.
Rotation is a normal operation now: create the new token, deploy it, check last_used_at on the old one, delete it. GET /v1/tokens returns the timestamp and the last source address for each token. The audit log (GET /v1/audit-events?action=token.created) records who made each one.
Questions go to support@ansiblecloud.io. If you think a token has leaked, revoke it first and write to us second.
Written by Priya Nair. Comments, corrections and arguments to priya.nair@ansiblecloud.io.