WheelmachineDocs

Keys and scopes

A key says who is calling and what it may do. Give every program and every agent a key of its own, holding only what it needs.

wm

$ wm keys create agent --scope machines:read,machines:write,machines:exec
id:        key_8c41d07e2b9a6f13
name:      agent
scopes:    cloud:machines:read, cloud:machines:write, cloud:machines:exec
projects:  every project
expires:   never
secret:    ak_live_...
wm: store the secret now: it is shown only this once, and cannot be shown again.

A key#

A key is ak_live_ and 40 letters and digits, sent with every call as Authorization: Bearer ak_live_.... Its secret is shown once, in the answer that makes it; after that the API shows only its first and last characters (shown), to know it by. It also has an id (key_ and 16 letters and digits) and a name, for people. wm me (GET /v1/me) shows the key in use: its scopes, its projects, when it ends, and whether the account can spend.

Scopes#

ScopeIn wmWhat the key may do
cloud:machines:readmachines:readSee machines, wait for them, and see what they cost (usage).
cloud:machines:writemachines:writeMake, rename, label, start, pause, stop, archive, copy, snapshot and delete machines, and see them.
cloud:machines:execmachines:execRun commands in machines and read and write their files, and see them. A command can read its environment, so such a key can read the secrets a machine was given.
cloud:gpusgpusMake machines with a GPU, once they are open to the account.
cloud:projects:writeprojects:writeMake, rename and delete projects.
cloud:keys:writekeys:writeList, make and revoke keys.
cloud:secrets:writesecrets:writeSet and delete the account's secrets, and give them to machines (a key of the whole account).
cloud:*allAll of these.

Any key with one of these scopes can see who it is (wm me), its projects, the regions and the GPUs. A call the key's scopes do not allow answers 403 forbidden, naming the scope it needs. A key that holds none of these scopes is refused on every route here.

A key never makes a stronger one#

A new key is made by a key that holds cloud:keys:write, and it can hold no more than that key:

Asking for more answers 403 forbidden. So a key handed to a program, or to an agent, cannot be used to make a key that does more than it.

Keys for some projects#

Terminal
$ wm keys create ci --scope machines:write,machines:exec --project research

A key limited to some projects works inside them alone:

A key that names no projects reaches every project of the account.

End time and rate#

Terminal
$ wm keys create nightly --scope machines:write --expires 30d --rate 120

--expires is a while (30d, 12h) or a date (2026-12-31, or a time such as 2026-12-31T18:00:00Z); in the API, expires_at is a time, at least a minute ahead. A key past its end answers 401 key_expired, and its end cannot be moved: make a new key.

--rate (rate_per_minute) is the calls a minute the key may make, from 1 to 6000. Left out, the new key gets the making key's own rate, which is 600 for a key made without one. See Calls a minute.

Revoke#

Terminal
$ wm keys revoke agent
Revoke key_8c41d07e2b9a6f13? Whatever uses it stops working. [y/N] y
key_8c41d07e2b9a6f13

A revoked key stops working within seconds, everywhere, and cannot be brought back; calls with it answer 401 key_revoked. A key can revoke itself. wm logout is not the same: it only forgets the key on this computer, and the key still works until it is revoked.

wm keys ls lists the account's machine keys, with their scopes, projects, state and when each was last used; never their secrets.

Where keys come from#

For now, an account's first key is made in Wheelmachine's console by the account's owner. After that, a key that holds cloud:keys:write makes the others, with wm keys create, the libraries or POST /v1/keys.

Keep keys safe#