Skip to content
Docs
Request access

Accounts and roles

NuraMesh records who did what. A person signs in and acts under their own id. A program uses an API token and is recorded as that token. A token is never recorded as a person, and nothing in a request body or header can name the actor.

  • NuraMesh installed with the local extra, which carries the API server (Install).
  • A team folder, for example the my-team folder of the Quickstart.
  • A terminal on the machine that runs the server. The first owner is set up from there.
  1. Start the server from a terminal on your own machine. Sign-in is on unless you turn it off.

    Terminal window
    nuramesh serve my-team
  2. Open the one-time setup link the server prints, choose an email and a password, then sign in. That account is the first owner. Sign-in says what to do when no link is printed.

  3. As the owner, invite the other people by email as approver or viewer. Roles lists what each may do.

  4. For a program, make an API token instead of an account. It is shown once.

    Terminal window
    nuramesh auth tokens create --name ci-nightly --scope read --days 7 --team my-team

Why the server stays on loopback until sign-in is on

Section titled “Why the server stays on loopback until sign-in is on”

nuramesh serve starts with sign-in on. Only if you type --auth off does it answer loopback addresses only (127.0.0.1, ::1, localhost), with open reads and every write (stop a run, decide an approval, lift a budget block) refused with authentication_required, because nothing could say who is acting; it prints a banner in capitals saying so. A network address is accepted only with sign-in on, --trusted-proxy and at least one --allowed-host, behind a proxy that ends TLS. Without those, the server exits and says why.

  • The first owner. Started from a terminal on your own machine with no owner yet, nuramesh serve prints one setup link (.../setup#token=..., valid 15 minutes, works once). Open it, choose an email and a password, then sign in. Anywhere else (a container, behind a proxy, no terminal) it prints no link: run nuramesh auth new-setup-token --team <team> in a terminal, which shows a one-time token once (valid 24 hours), and paste it on the app’s setup page (or use POST /v1/auth/setup/redeem). If the link has expired, restart serve or make a new token.
  • More people. An owner invites people by email as approver or viewer. An owner is never made through the API.
  • Sessions. The browser gets cookies that are HttpOnly and SameSite=Strict; every change made with a cookie sends a CSRF token. A refresh token used twice ends the whole session.
  • Failures are limited. Repeated failed sign-ins lock the account for a while, and the answer to a bad email or a bad password is the same.

A person has one role. The role decides which permissions they have when they act in a signed-in session.

Role Permissions What that means
viewer read look at runs, the ledger and reports
approver read, run, decide, reveal also stop a run, answer approvals and lift budget blocks, and read the text behind a hash
builder read, run, build also change the team: the graph, roles and policies
admin everything except govern also manage people and API tokens
owner everything also the controls only an owner has

Today a person can be made an owner (the first one, from a setup token), an approver or a viewer. The builder and admin roles exist in the permission table, but nobody can be given them yet: assigning them is refused with invalid_request, and role_not_assignable answers a request to make an owner.

A token is for a program, such as a CI job that reads reports or stops a run.

  • Scopes. read and run. There is no scope for approving: no token can decide an approval, lift a budget block, read a person’s reason, change the team or manage people. Those routes answer human_required to a token.
  • A token never has more than its issuer. On every request a token’s rights are its scopes limited to what its issuer may do now. Demote the issuer and the token loses run at once; erase the issuer and the token fails with token_invalid.
  • Shown once. A token starts with nmt_, is shown once when it is made and is stored only as a hash. Send it in the Authorization: Bearer header, never in a URL.
  • Lifetime. 90 days by default through the API, 1 to 365 days. The command line makes short ones: nuramesh auth tokens create --name ci-nightly --scope read --days 7 --team <team> (default 7, at most 30).
  • Names. A name is a label for the program, not a person. It is unique for ever, so a revoked token keeps its name (token_name_taken).
  • Revoke. nuramesh auth tokens revoke <id or name> --team <team> or the app. It takes effect on the next request.

These need a signed-in person with the right role and are refused (human_required) for an API token:

  • answer an approval or a human gate, and lift a budget block
  • read the text behind a content hash
  • change the team, manage people and tokens, and the organization controls
  • resume the organization after a halt (see Kill switch)
  • issue or rotate an agent credential (see Agent credentials)

The command line can look and restrict (stop a run, revoke a token or a credential, halt the organization) but it cannot approve or widen anything. A typed --human there is a claim, not a sign-in.

The route-by-route rules, the cookie settings and the errors are in the API reference and Errors.

List the tokens. The one you made is there by name, and no secret is printed.

Terminal window
nuramesh auth tokens list --team my-team

Then sign in to the app as an invited viewer: the runs and reports are readable, and stopping a run is refused.

You see Do this
No setup link is printed The server is not on a terminal of your own machine (a container, a proxy). Run nuramesh auth new-setup-token --team my-team and paste the token on the setup page
The setup link has expired It is valid for 15 minutes and works once. Restart serve, or make a new token as above
authentication_required on a write The server runs with --auth off. It then refuses every write. Start it with sign-in on
human_required An API token tried something only a person may do, such as answering an approval. Sign in as a person with the right role
token_name_taken A token name is unique for ever, also after it is revoked. Choose another name
The server exits on a network address A network address needs sign-in on, --trusted-proxy and at least one --allowed-host, behind a proxy that ends TLS

Was this page helpful?