In maruhi, keys belong to devices and access belongs to people. You are one member of a project — one user ID, one role, one environment scope — and that membership holds a set of device keys, one per machine. Each key is generated on its machine and never leaves it. When a device is lost, its key alone is revoked; you stay a member, your other devices keep working, and nobody has to re-invite you.
Each device key carries a cap: a role bound and a subset of your environments that the device may hold keys for. The default cap is your full access; a phone that only votes on four-eyes proposals, or a container that only needs dev, can be registered with less. Your effective access on a device is the smaller of your membership and the device’s cap, so a device can never reach past you.
One more device key is the reserve key: a device key that lives only in the recovery ledger on the server, sealed with your recovery code (and optionally a passkey or your guardians). It is what brings you back when every machine is lost — see Recover your key.
| To | Where | Command |
|---|---|---|
| Register a new machine | The new machine | maruhi device add --label <name> |
| Approve it | A registered device | maruhi device approve <fp-or-words> |
| See your devices on every project’s chain | Any of your devices | maruhi device list |
| Revoke a lost or retired device | Another device | maruhi device revoke <ref…> |
| Revoke its API token | Any device, or the dashboard | maruhi token revoke <token-id> |
| Replace the reserve key | A registered device | maruhi key reserve rotate |
maruhi device --help lists the group. Only you can add or revoke your own devices (any role, readers included); an admin or owner can revoke another member’s device by fingerprint. Registering, approving and revoking devices is done in the CLI — the dashboard only shows what the server reports (below).
Add a device
Nothing secret moves. The new machine generates its own key and shows its fingerprint; a device you already have approves that fingerprint and adds the key to your projects’ chains.
On the new machine:
maruhi login
maruhi device add --label "MacBook" # default label: the hostnameIt generates this machine’s device key, prints the fingerprint as 32 hex characters and as 12 words, and waits (“Waiting for approval (Ctrl+C to stop waiting; the request stays valid)…”). The request lives 15 minutes. The fingerprint is public: anyone who sees it can only approve this key onto your account, from a device that is already yours.
On a registered device of yours:
maruhi device approve <32-hex-fingerprint> # or the 12 words, quotedType the full fingerprint or all 12 words as shown by maruhi device add — fingerprints are never truncated for approval, because the approval is what stops a server from slipping in a key of its own. Read the fingerprint off the screen of the machine you are adding, not from a message. A request is created with an account-wide admin API token, so anyone holding one of yours could put a request on your account and send you its fingerprint; approving it would add their key to every project you belong to (maruhi token list shows each token’s scope). Comparing against the new machine’s own screen is the only thing that tells the two apart. The CLI prints the request’s label, fingerprint and 12 words again, reminds you to compare them with the new machine’s screen, then appends the device to every project you belong to and distributes the keys of every environment in the device’s cap, every epoch, so the new device can read history too. --project <id> limits it to one project.
The cap is set at approval time and cannot be changed later — to change it, revoke the device and add the machine again with a new key:
maruhi device approve <fp> --cap member --env dev # reads and writes dev only
maruhi device approve <fp> --no-envs # a vote-only device: no environment keys at all--cap is owner (the default, no bound), admin, member or reader; --env <id> (repeatable), --all-envs (the default) and --no-envs set the environments. A device can only register devices bounded by its own cap, so a narrow device cannot create a wider one. Re-running maruhi device approve for a device that a project already has — after an interrupted approval, or a registry write that failed (below) — continues the same approval, so it must pass the same cap: with a different cap (the default owner included), it appends nothing, records nothing, leaves the request in place and prints the command to re-run with the cap the device already has.
Back on the new machine, the wait ends with “Approved: this device is registered on N projects (verified on each project’s chain)”. That is the completion signal: the new machine syncs each project and counts the chains that actually hold its key, rather than trusting the server. On those same chains it then checks that the keys reached it: for every environment in its cap, it fetches and verifies its keys exactly as maruhi pull does. If an epoch is missing, it warns with the message maruhi pull gives (“no DEK wraps for you exist at epochs …”, after the project and environment) and the command that fills it (below); if every key arrived, it adds nothing. A project it could not sync is reported as such (“could not sync this project … whether this key is registered there is unknown”), never counted as missing, and the completion signal then adds how many projects could not be checked, since N counts only the ones it verified. If it also lists projects that are “not registered yet”, the approving device skipped or failed on them — its output says which, and why: its cap does not cover them, you are not a member there, or the append failed there (the device limit below, for instance) — or you approved with --project. Once the cause is gone, a device of yours whose cap covers them registers the key on each missing project when it runs a keyed command on that project at a terminal (maruhi pull --project <id>, for instance) — the approving device itself if its cap was not the cause, another device otherwise, once it has synced a project that did register the key (that is how it learns the key). A device’s cap never changes, so a cap that was too narrow stays too narrow on that device. The note on the new machine says the same, and that the request is used up: once the approving device has listed the device in your registry (the completion signal), maruhi device approve cannot be re-run for it.
Approving runs only on a human interactive terminal (stdin and stdout must both be terminals; pipes, redirects, CI, and AI agent environments are refused) — the fingerprint comparison is the whole safeguard, so it is done by a person. maruhi device add itself has no such rule — a container can request, but a person approves.
If the approval fails on every project — the limit below, a cap that does not cover them, or a project you are not a member of — the approving device prints the cause, records nothing and leaves the request in place, and the new machine simply keeps waiting: it gets no signal and needs no restart, and five minutes after the request it prints a reminder to read the approving device’s output. Read the approving device’s output, fix what it names, and re-run maruhi device approve there. If some projects registered and others did not, the request is used up instead: the new machine’s wait ends with the “not registered yet” list above, and the missing projects are picked up as described there (maruhi pull --project <id> on a device whose cap covers them, for instance).
If the approving device could not list the device in your registry — the registry is full, or the write failed — the device is registered on the chains, but the new machine gets no completion signal. The approving device says so (“… will not see the completion signal. The request is left in place until …”) and does not use up the request. Before that time, remove old rows if the registry is full (maruhi device list, then maruhi device revoke) and re-run the maruhi device approve command that note prints there — it repeats the fingerprint, the cap and any --project: the projects that have the device report it as already registered, any that failed are tried again, the registry write is retried, and the new machine’s wait ends. After that time the device stays registered on the chains but has no row in your registry.
If the request expires before the new machine saw the completion signal, the new machine says so. Unless the approving device reports that it did register the device, the new machine’s key is registered nowhere. Run maruhi device add --replace there: it discards that never-registered key, generates a new one and prints a new fingerprint to approve. (Without --replace, maruhi device add refuses because the machine already holds a key.) If the approving device did register it but could not list it in your registry before the request expired (above), keep the key: it is registered on the projects that device lists, and maruhi device list on the new machine shows where; only its registry row is missing. If instead the approval was interrupted halfway, the request is still there: re-run maruhi device approve on the approving device with the same cap; it skips the projects that already have the device. The new machine also adds what the project chains show at that moment — “registered on … — keep it”, or on no project the server lists — but keeps the condition above: an approval that started just before the request expired may still be appending. Re-running maruhi device add there later checks the chains again without making a new request.
If you run maruhi device add on a machine that already has a key, it does not make a new request. If the key’s request is still pending, it resumes the wait. Otherwise it checks the key on the chain of every project the server lists for you, and decides from the chains alone — your device registry plays no part:
- Registered on at least one project: it prints “This key is registered on N projects” and checks that the keys reached the device, as after an approval. Projects where the key is revoked, missing or could not be checked get a note each. Nothing else to do; if the device has no row in your registry (an approval whose registry write failed), it says so, and that row only ever carried the label.
- Revoked, and registered on no project: a revoked key is never registered again, so add the machine again with
--replace. - On no project the server lists:
--replaceloses nothing on those projects. The message counts them, and lists any project this machine has local records of that the server did not list (those records are not separated by server or account, so check such a project withmaruhi project verify --project <id>if it is yours). - A project could not be checked — it did not sync, or the project list could not be read: nothing is decided from it, so the command stops without calling the key unused. A chain that fails verification is reported as a warning, as a sign of tampering rather than a network error.
If the keys did not all reach the new device — the approving device reports “backfill of environment … failed”, or the approval stopped after appending the device — the device is registered but cannot decrypt the older values of those environments. maruhi device add on it warns when its wait ends, and so does its maruhi pull (“no DEK wraps for you exist at epochs …”). Re-running maruhi device approve does not fill them: a project that already has the device is reported as already registered and left alone. maruhi pull does. When a registered device of yours pulls an environment, it checks which epochs the server holds for each of your other devices in that environment and wraps the missing ones it can open to them, saying so in a note. So run maruhi pull --project <id> --env <environment> on a device whose cap covers the environment — the approving device itself, once the cause it reported is fixed; the warnings print that command. This works in any terminal, CI and agent environments included, but needs an API token that can write. It covers your reserve key too. An epoch that none of your devices holds cannot be filled this way; maruhi env rotate gives every device the next epoch only.
A person can have at most 16 active devices per project. The limit is checked when the device is appended to a project’s chain, so it is the command that appends — usually maruhi device approve on the approving device — that is refused (“This project already has the maximum number of active devices for that member (16). Revoke a device first”), not maruhi device add on the new machine. It is counted per project, so the projects below the limit are still registered, and revoked devices do not count: revoking one frees a slot. The server accepts five device-add requests per hour and keeps at most 32 rows in your device registry.
See your devices
maruhi device list
maruhi device list --project <id>For each project, the CLI syncs and verifies the chain and lists your active devices with their cap, the entry that added them (added by <fingerprint>, or your first key on the chain) and whether the adding device is still active. Three sources appear on a line, and they are not the same thing:
- What the chain holds — the fingerprint, cap and sequence number. This is verified.
- The registry label, marked “(server-reported)” — the display name from
--label, and the API token the registry associates with the device. The registry is advisory: it helps you tell devices apart and is never used to decide anything. - This machine’s record, “recorded here as reserve / approved / observed” — how this machine came to know the key: it sealed it as the reserve key, it approved it, or it saw it on a verified chain. A device you did not approve from this machine is announced the first time it is observed (“observed your device … It was not approved from this machine; compare it with
maruhi device listand, if you do not recognise it, revoke it”).
maruhi member list and maruhi project verify show everyone’s device count and fingerprints (devices=2 fp=…), with a cap in parentheses when a device is bounded. Your own row also warns while no reserve key is registered.
Revoke a lost or retired device
Do this from another device of yours (or, for another member’s device, as an admin or owner with --user <id>):
maruhi device revoke "MacBook" # your own device, by registry label
maruhi device revoke 3f9a1c2d # any device, by fingerprint prefix (8+ hex characters)
maruhi device revoke 3f9a1c2d --user bob # another member's device (fingerprint only)A reference is a fingerprint prefix of at least 8 hex characters or, for your own devices, the registry label; several can be given. Because a label is server-reported, the CLI resolves it to a fingerprint and shows a confirmation table per project — the fingerprint and cap of every device to revoke, and the devices that remain — before asking for yes. Check the fingerprint against maruhi device list; the revocation is decided by the fingerprint, not the label. --yes skips the prompt (revoking is not a ceremony: no key material is shown), and --project <id> limits it to one project.
The table also warns about what remains: no remaining device with an owner cap, no remaining device that could open some environment in your scope, no remaining reserve key recorded on this machine, or that you are revoking the device you are running on. A member’s last device cannot be revoked (“last-device-protected”); to take someone out entirely, maruhi member remove is the command.
After yes, the CLI appends revoke_device to each project, and then rotates every environment the device could open — its effective scope — exactly as maruhi member remove does for a removed member. The rotation is not optional: the lost machine still holds the keys of the epochs it received, so every value in those environments is treated as read. The output says which environments were rotated. Environments your current device cannot rotate (they are outside its cap, or you are a reader) are left as a pending mandate, listed by maruhi project verify and maruhi rotation list (“member (device revoked)”), until any device of a member whose scope covers them runs maruhi env rotate <environment> --new-epoch --reason <text>. Then rotate the upstream credentials maruhi rotation list points at.
Revoking a device does not revoke its API token. The lost machine can still call the API until its token is gone — it cannot decrypt anything new, but the token is a credential of its own. maruhi device revoke ends by listing the tokens the registry associates with the revoked devices (“The revoked devices’ API tokens are still valid (the match is server-reported)”) and asks whether to revoke them; pass --revoke-token to do it in the same run without a prompt. Or do it separately:
maruhi token list # ids, names, scopes, expiry
maruhi token revoke <token-id>The dashboard’s API tokens and Devices pages revoke tokens too — that is the one thing you can do there when no CLI is at hand.
Add a revoked machine again
maruhi never registers a revoked key again, so a revoked machine comes back as a new device with a new key. On that machine:
maruhi device add --replace--replace generates a new key and requests its approval, and only then replaces the revoked key in the machine’s keychain and prints the new fingerprint (if the request fails — the hourly limit, a full registry — nothing is replaced). Before replacing, it notes where the old key stands on your projects. Approve the new key from a registered device with maruhi device approve <fingerprint>, choosing the cap again (--cap, --env). Without --replace, maruhi device add checks the old key on each project’s chain and tells you it was revoked. If the revocation also revoked the machine’s API token, sign in on it again first (maruhi login). This is also how a device gets a different cap: revoke it, then add it again.
If the key was revoked on some projects only (--project), it stays registered on the others, and after --replace no machine holds it any more: once the new key is approved, revoke the old one there too (maruhi device list shows where it is). maruhi device add without --replace says which projects revoked the key and gives the same steps, whether or not the machine’s row is still in your device registry (an admin revoked it, or removing the row failed): it decides from the chains, not the registry. On any other command, a machine whose key was revoked on the project gets “The key on this machine (…) was revoked on this project’s chain”, with the same steps.
The reserve key
maruhi key generate creates two keys the first time: this device’s key, and the reserve key, which it seals with a recovery code right away and never stores on the machine. The reserve key is registered on each of your projects at the next sync, as a device with your full access, so that maruhi key recover on a new machine can use it to register that machine. maruhi key show prints its fingerprint (“reserve key fingerprint: …”, or “not recorded on this machine”). Changing the ledger — reissuing the code, sealing to a passkey, designating guardians, rotating the reserve key — first opens the reserve key, so only someone who can open it can change it (the one exception is maruhi key recovery --replace, for when the code is lost). Which material each of those commands accepts is on Recover your key.
If you suspect the recovery code or the reserve key was exposed — for example, the machine you recovered on later turns out to have been compromised — replace it:
maruhi key reserve rotate # asks for the current code (or --passkey)It opens the ledger, creates a new reserve key, seals it with a new recovery code, registers it on every project and revokes the previous reserve key, with the same rotation as any device revocation. Passkey wraps and guardian groups sealed the old key, so they are deleted and the command tells you to seal the new key again (maruhi key seal passkey, maruhi guardian add). When the code itself is lost, maruhi key recovery --replace does the same without opening the ledger.
The reserve key being replaced must carry the reserve-key mark that maruhi writes into its sealed record when it creates one (the mark is inside the encryption, so the server can neither add nor remove it); a ledger key without it is not a reserve key, and maruhi key reserve rotate changes nothing and points you to maruhi key recovery, which seals a reserve key in its place. One limit: the previous reserve keys to revoke are the ones recorded on the machine you run it on. On a machine that never recorded them, the rotate cannot know about an older reserve key, and it stays registered on your projects. After a rotate or a --replace, run maruhi device list and compare the devices “recorded here as reserve” with those “recorded here as observed” that have your full cap (owner/all): a reserve device you do not recognise is revoked like any other, maruhi device revoke <fingerprint>.
In the dashboard
The dashboard shows devices in two places, both as reported by the server and read-only — the project chains are the source of truth, and maruhi device list verifies them:
- Members (on a project) has a Devices column: each member’s device count and one chip per device, with the fingerprint’s first characters and, when the device is bounded, its cap in the same form the CLI uses (
member/dev, staging). A chip that says “fingerprint not reported” is a device whose fingerprint the reported entries do not bind — a device that has not signed anything yet, or a reserve key, which never signs. The count is exact either way. The dashboard folds only the entries it can read; if some device entries in the reported chain could not be read, a line under the table says how many were left out, and the device sets may not match what those entries would have produced — verify withmaruhi project verify. - Devices (your account) is the device registry: labels, fingerprints, registration times and the API token linked to each row, with a Revoke token action. This is advisory information you registered from the CLI; it holds no verification. The Lost a device? note there gives the order: revoke the key from another device with
maruhi device revoke <fingerprint>, then revoke its token here.
A revocation’s rotation flag appears under Rotation as device revoked: <user> — it names the person, as maruhi rotation list does (“member (device revoked)”); the device’s fingerprint is in the Audit tab’s chain.device_revoked event. The dashboard never revokes a device key: that is a chain entry, and the dashboard holds no key.
What revoking a device does not do
- It does not undo what the lost device did before you revoked it. A device with your full cap can add devices; one added by the lost device stays registered until you revoke it too.
maruhi device listshowsadded by <fingerprint>for every device, and marks the adder as revoked — revoke everything that was added by the lost device in the samemaruhi device revokerun. A bounded device cannot create a wider one, so a stolendev-only device cannot register a device that reads production. - It does not verify labels. Registry labels are server-reported and can be changed by whoever controls the server or your account. The revocation is decided by the fingerprint, which is why the confirmation table shows it; compare it with
maruhi device listbefore typingyes. - It does not protect the reserve key from a compromised recovery. If the machine you ran
maruhi key recoveron was compromised at the time, the reserve key was in its memory. Revoke the device that machine registered, and replace the reserve key withmaruhi key reserve rotate. - It does not revoke API tokens. See above:
maruhi token revoke, or the dashboard.
What can go wrong
This machine's device key (…) is revoked on … and registered on …, and it has no pending device-add request …onmaruhi device add. Add the machine again with--replace.… has no pending device-add request and is on …, each chain synced and verified, so replacing it loses nothing there …onmaruhi device add. The key is not registered on any of the projects the server listed — typically a key whose request expired before anything registered it.--replacegenerates a new one to approve. The count is of the projects the server lists; check a project it may have left out before replacing (above).… maruhi could not check every project it may be registered on …onmaruhi device add. Some project did not sync, or your projects could not be listed, so nothing was decided. Re-run once they sync; replace the key only if you know it is revoked, a copy, or registered nowhere.this key was revoked on …, so it is not registered there again …at the end ofmaruhi device add. The key is still registered on other projects but was revoked on those. Add the machine again with a new key (Add a revoked machine again), then revoke the old key where it is still registered.The key on this machine (…) was revoked on this project's chain …on any keyed command. The same: a revoked key never comes back, so add the machine again with a new key;maruhi device listshows where the old key is still registered (“revoked” lines mark the projects that revoked it).The device reference must be the full 32-character fingerprint or its 12 words …onmaruhi device approve. Approval takes the whole fingerprint, never a prefix.No pending device-add request matches that fingerprint. Requests expire 15 minutes after maruhi device add …. Re-runmaruhi device add --replaceon the new machine and approve the fingerprint it prints now — unless this device already registered it and only its registry write failed, in which case the request has expired and the device is registered without a registry row (above).… backfill of environment … failed (…)onmaruhi device approve,maruhi key recoverormaruhi key reserve rotate, orno DEK wraps for you exist at epochs …on the new device’smaruhi device addormaruhi pull. The device is registered, but some of its keys were not distributed. Run themaruhi pull --project <id> --env <environment>the message prints on a registered device whose cap covers that environment (above); re-running the approval does not fill them.That request carries this machine's own key; approve it from another device. A device cannot approve itself.this machine's key is not one of your registered devices here, so it cannot register devices here …. The device you are on is not on this project’s chain — it was approved with--projectfor other projects, or the approval skipped or failed on this one — so it cannot sign here, and re-runningmaruhi device approveon it changes nothing for this project. A device of yours that is on this project registers both keys there when it runs a keyed command on this project at a terminal, if its cap covers them and it has synced a project that has them (above); while the request is still pending, approving it from such a device works too. If none of your devices on this project has a wide enough cap, no command can add them: a device can only register devices bounded by its own cap.the requested cap … exceeds this device's own cap …(device-cap-exceeded). Approve from a device with a wider cap; a device cannot register a device stronger than itself.Device … is already registered with cap …, and this approval asks for …: a device's cap is set when it is first approved and cannot be changed later, so this approval appended nothing, recorded nothing and left the request in place …on a re-run ofmaruhi device approve. Re-run the command it prints: it has the cap the device already has on those projects. If the device has different caps on different projects (an approval re-run with another cap, either before this check existed or with--projecton a subset of projects — the check compares only the projects a run visits), approve one project at a time with--project <id>and that project’s cap. To give a device another cap, revoke it and add it again.it would revoke the last device (last-device-protected — CRYPTO_SPEC §6.2). To remove the person, use maruhi member remove. A member always keeps one device. Add another first, or remove the member.Only an admin or owner can revoke another member's device …, orOnly an owner can revoke a device of an owner. Revoking someone else’s device follows the same rule as removing them.no reserve key is registered for you on this project (only this device's key) …on any keyed command. Runmaruhi key recoveryonce, on a human terminal: it creates your reserve key and seals it with a recovery code (key generation leaves this step out when it runs in an AI agent environment).… recorded on this machine (…) … not registered on project … yet. Registering a device key adds a signer … done only when a person runs maruhi at an interactive terminal. The reserve key (or a device you approved elsewhere) is waiting to be registered on a project this machine synced from a pipe or an agent. Run a keyed command on that project in a terminal (maruhi pull --project <id>, for instance) to register it.