People, agents and pipelines
Choose what people, AI agents, and pipelines can do in each project. A token is a secret that identifies the person, agent, or pipeline using it. An instance admin holds the admin permission on every project and can issue tokens. People can also create their own command-line tokens.
A project admin can accept policy changes on one project. A grant lists the permissions a person, AI agent, or pipeline holds. Only a person who administers the instance can change it. To issue a token for an existing person under Tokens, you must also be that person or the owner.
Kinds of actor #
An actor is anyone who acts in Mainworthy. Every change names the actor who made it.
- A person can read, write, and answer questions. The web app and its queue of open questions are designed for people.
- An agent is an AI tool that reviews changes, proposes edits, and reports results. See let an agent in.
- A pipeline is a continuous integration job that reports test results and reads the gate to find out whether a change can ship.
- The project's policy says who answers each kind of question and which answers count. When nobody needs to answer, the policy answers automatically. Mainworthy records the policy as the actor. It needs no grant, token, or setup.
An actor has a name and a kind. Mainworthy has no per-actor seat charge. A token is a secret that identifies the caller. A person can also sign in as themselves through the instance's identity provider. An actor's name starts with a letter or digit and can contain up to 64 characters. It can include letters, digits, ., _, @, and -.
Capabilities #
A capability gives permission to use a group of operations. A grant lists an actor's capabilities for one project or for every project.
readlets you see cases, results, questions, and the gate.recordlets you report results and attachments, mark a change as ended, and read the commit's gate. A pipeline withrecordcan also announce a deployment. It covers a pipeline's reporting work.producelets you write and edit cases, review changes, and send answers. It includesrecord.answermakes your answer count when the policy asks a project member.planlets you start planned runs.adminlets a person accept policy changes on the project. On every project, it also lets a person invite people, issue tokens, and change grants.
The table lists the operations each capability allows.
| Capability | Operations it allows | Held by default by |
|---|---|---|
read | attachment, tracker (also requires produce), inbox, get, find, impact, since, gate, history, timeline, check, stats, command, tracker-status, handoff-status | a person, an agent |
record | attach, report, change, announce, work, gate | a person, a pipeline |
produce | propose, import-csv, claim, tracker (also requires read), decide | a person, an agent |
answer | handoff | a person |
plan | plan | a person |
admin | audit, admin, org, invitation, billing, subscribe | a person |
A pipeline holds read and record at most, whatever its grant lists.
You need produce to send an answer. The clause, or line of the policy that applies to the question, determines whose answer counts. A member clause requires answer. An admin clause requires admin on the project. If a clause asks the proposal's author, either the author or a person with admin on the project can answer, subject to the clause's other conditions.
With just read and record, you can claim and release slots in a planned run in the web cockpit. For each slot, you can record Pass, Fail, Blocked, or Skip and attach evidence to your result. While the run is open, you can correct your last result. To reopen a closed run, you must be able to withdraw the answer that closed it. That takes the same permissions as giving the answer.
A new person gets every capability, a new agent gets read and produce, and a new pipeline gets record. These defaults apply only when you make a token for a name that does not exist yet and give no --can.
Grants #
In mainworthy actor list, * means a grant covers every project. If an actor has that grant and one for a specific project, their permissions add up. The actor kind rule identifies the policy when it answers automatically.
$ mainworthy actor list
rule policy no grant
human robin * read, record, produce, answer, plan, admin
agent reviewer scratch read, record, produce, answer
ci github-actions scratch read, record
To change a grant, use grant. The command replaces the actor's capabilities for that scope, so list every capability you want the actor to keep.
$ mainworthy actor grant reviewer --can read,produce --project checkout
reviewer on checkout: read, produce
$ mainworthy actor ungrant reviewer --project checkout
reviewer holds no grant on checkout any more
Leave out --project to change the grant on every project. Only a person who administers the instance can change a grant. To avoid locking yourself out, have another instance admin change your own grant. Nobody changes the owner's grant. Mainworthy writes that grant again at every start.
Named roles #
A personal grant can also list named roles. Team grants provide capabilities only and reject role assignments. Preset policies do not require named roles.
A role does not give capabilities. The actor still needs produce to send an answer and answer for a role clause to count it.
Team permissions can supply produce and answer for a personal role. Team membership alone gives no named role.
Roles on every project and roles on one project add up. A role on another project gives nothing here.
$ mainworthy actor grant reviewer --can read,produce,answer --roles approver --project checkout
reviewer on checkout: read, produce, answer; roles: approver
Role names use lowercase letters, digits and -, start with a letter, and have at most 32 characters.
--roles accepts commas or repeated flags. To keep the grant's roles, omit --roles. To clear the roles, use --roles=.
Removing a grant removes its roles. A new token or invitation for an existing actor keeps their roles.
Settings, People and mainworthy actor list show the roles with their grants. Assign them through the command above or the admin operation's grant.set action.
Only a person who administers the instance can change roles. You cannot change your own roles or the owner's roles.
The owner has no implicit named role and cannot be assigned one through grant.set. Use separate people as approvers.
Changing roles affects later answers and withdrawals. It leaves recorded decisions in place.
An agent can hold a role and give a counted answer if the clause permits agent answers.
Grant and role changes do not yet have an attributed change history.
Organisations #
Every project, actor, team, and token belongs to one organisation. When you use a token or a browser session, Mainworthy looks up names only in that actor's organisation. Two organisations on the same instance can each have a project called web and a person called robin. Neither can see the other's people or projects. A self-hosted instance has one organisation.
An organisation's owner can do everything in it, regardless of grants. An instance admin cannot remove the owner's permissions. To transfer ownership to another person in the organisation, the owner runs this command.
$ mainworthy admin --do org.transfer --to dana
The new owner may do everything from then on, and the former owner keeps their grants and nothing more. actor list
marks the owner with owner: true.
The operator runs the instance. This is the person named by MAINWORTHY_OWNER in the first organisation. See configuration. Only the operator can list organisations with mainworthy org --do list, suspend one with --do suspend --org 2, or resume it with --do resume --org 2. While an organisation is suspended, Mainworthy refuses its tokens and sessions and keeps its data.
An organisation made by signup waits for the operator's approval. Mainworthy
sends no mail: the server's log names each one, with the command that approves it. org --do list shows each
organisation's approved and approvedAt, and the operator approves one with mainworthy org --do approve --org 2.
The organisation's name and its owner's name are whatever the applicant typed, so, for each organisation that waits,
ownerIdentities in org --do list also says who its owner signs in as: for each identity at
the provider, its email (the email the provider verified when the person last signed in with it, or null: match on this), its label (the provider's name with the verified email, else "no verified email" and the name it gave, since a name is whatever the person typed; a label stored by an earlier build keeps its wording until its person signs in again) and its handle (the
provider's issuer and the person's subject there, joined by #). The log line leaves them out and points to that list,
since a server's log is often read by more people than the operator. Match those to a person before approving.
Approving an organisation that is approved changes nothing, and approval is not taken back. The operator's own
organisation, which every start approves, and every organisation that existed before approvals were added are
approved. An archive carries each organisation's approval. Restored from an archive
taken before approvals were added, every organisation is approved.
Only the operator can act on the operator's identity. Even the first organisation's owner cannot issue a token or invitation for the operator, forget the operator, end their sessions, revoke their tokens, or change their grants.
One account, several organisations #
A person who signs in through the identity provider has one account. The account holds the identities they sign in with at the provider, and it has one person in each organisation they joined. Joining another organisation adds a person there and changes nothing in the others. The person in each organisation has their own name, grants, sessions and tokens there.
A browser is in one organisation at a time. After you sign in through the provider:
- With one organisation, the app opens in it.
- With several, the page "Choose an organisation" lists them, with your name in each. Pick one with the mouse or the keys: the first has the focus, Tab moves to the next, ↵ opens it.
- With none, the page says your account is in no organisation yet. Where the instance takes signups, it offers to make one. To join an existing organisation, open its instance admin's invitation in the same browser.
In the app, the sidebar names your organisation above the project. With another to go to it is a button, and g w opens the same list. Choosing one moves this browser's session there, ends the old one and opens that organisation's first project. A suspended organisation is marked and cannot be opened.
One organisation per browser is a known limit for now. Every tab shares the browser's session, so switching in one tab signs the other tabs out of the organisation they showed. To work in two organisations at once, use two browsers or a private window.
A token identifies one actor in one organisation. If you sign in with a token, the browser cannot list or switch organisations.
Sign up and make an organisation #
An instance whose operator set MAINWORTHY_SIGNUP=open takes new
organisations, sometimes called workspaces, from anybody who signs in through its identity provider. The sign-in page
says "No account yet?" when it does. Elsewhere, people come in by invitation only, and nothing here applies.
- Press Sign in with the provider, and sign in or sign up there. Mainworthy makes your account the first time. While the database holds 85% of the size the operator set for it, or has not been measured for five minutes (see limits of an organisation), it makes no new account, makes no organisation and links no identity, and says it can't take signups right now; an account that exists still signs in.
- The page "No organisation yet" asks for the organisation's name, the key of its first project (
webunless you change it) and your name there. Your name starts as the name the provider gives, or the part of your email before the@, with spaces and other characters a name cannot hold made into-. Change it before you press Make the organisation. - The browser moves into the new organisation and opens the empty first project. Under the empty list, Next steps says the organisation is waiting for approval from whoever runs the instance, and that inviting a coworker and connecting an agent work once it is approved.
- Once the operator approves it, Next steps links to inviting a coworker (Settings, People) and connecting Cursor or another agent (Settings, Connect). On an instance that sells subscriptions it also links to Billing; on one that does not, it says no subscription is offered yet.
Until the operator approves it, the organisation only reads. Its people can read its projects, list its people, tokens and invitations, export it, sign in and out and switch to another organisation. Every write is refused with a 403 that says the organisation is waiting for approval: a report, an attachment, a change to a case, an invitation, a token of any kind, a project and a subscription alike. Leaving the organisation and deleting your account also wait until it is approved; until then, ask whoever runs the instance. A few things are allowed while it waits: revoking a token or an invitation and ending a session, which only take access away, and linking another identity at the provider to your account, which adds only identities you already hold there.
You own the organisation and may do everything in it. Next time you sign in, the app opens in it. To make another, press the organisation in the sidebar or g w and choose Make another organisation, or press it on the page that lists your organisations. An account makes at most five organisations a day, and none while one it made waits for approval; the whole instance makes at most 50, whichever accounts make them. An account links at most ten identities at the provider, and links none after removing ten in a day. A coworker you invite joins with an account they have already, or one the provider makes for them.
Mainworthy creates the organisation, its owner, its first project, and your membership together. If any part fails, it creates none of them. If the reply gets lost, the page retries with the same request id. The server returns the organisation it already created.
From a browser signed in through the provider, the account operation's org.create action creates an organisation. Its signup action tells you whether the instance accepts new organisations and what name it suggests. A token identifies an actor in an existing organisation and cannot create another.
Limits of an organisation #
Each organisation but the operator's own has limits, which the operator raises for one organisation:
| Limit | First value |
|---|---|
| Projects | 25 |
| Members: people, agents and pipelines not forgotten | 100 |
| Attachments its results carry, added up | 250 MiB |
| Results its projects hold | 1,000,000 |
| Requests its tokens and sessions send in a minute, reads included | 1,200 |
If a new project, member, attachment or report would exceed a limit, Mainworthy refuses it and names the limit. A report that would take the organisation past its results is refused whole, before any of it is stored; a report already stored, sent again, is still answered. Every result a report sends counts, including any that Mainworthy then rejects, so a report right at the limit may be refused although fewer of its results would be kept. A report is checked when it arrives and again when its results are stored. One that was accepted and then held back, for example because its attachments passed their limit, is refused when it is sent again if other reports filled the organisation in the meantime. Such a report stays accepted, and Mainworthy tries it again each minute until it fits. If you exceed the request limit, the server returns 429 and tells you how many seconds to wait.
Every organisation shares the instance's database and attachment disk. Once the database holds 85% of the size the
operator set for it (MAINWORTHY_DATABASE_CAPACITY in configuration), or the attachment disk is
85% full, Mainworthy refuses new reports and attachments from every organisation but the operator's, and says which. The
database's size is what PostgreSQL counts for this database alone, so the size set is a budget below its disk, with
room for the write-ahead log and other files; without one, the database never counts as full. A report accepted before
then and not yet stored waits until there is room, however long that takes. Everything else goes on working.
Mainworthy measures both once a minute, the database on a connection of its own, so once the operator makes room or sets a larger size, writes are taken again within a minute or so, and a waiting report is retried each minute until it is stored. If a reading fails or does not end within ten seconds, Mainworthy logs a warning and keeps the last reading, so a full database or disk stays full. If the database has a size set, its use is unknown from each start until its first good reading, and once its last good reading is five minutes old; so is the attachment disk's while its readings fail. Meanwhile Mainworthy refuses the same reports and attachments, saying so, until a reading succeeds, and the operator looks at why. A file system that reports no size, as an unbounded tmpfs does, is never full.
Every request with a token or session cookie counts. This includes signing out, switching organisations, and the provider's reply when you link an identity or confirm who you are. Signing in with a token or provider and accepting an invitation count toward the organisation you enter. If your browser is signed in without an organisation, the limit is 120 requests per minute for the identity you used. These initial limits apply until pilot usage has been measured.
The operator reads and changes them with the org operation:
$ mainworthy org --do limits --org 2
$ mainworthy org --json '{"do":"limits.set","org":2,"projects":50,"results":2000000}'
A limit is set with --json, because it also takes null. A number replaces a limit and null puts the first value
back. A change reaches the minute's count of requests within ten seconds.
While the organisation is writing what a limit counts, limits.set is refused with a 409 that says it is writing now,
so that the operator's other writes never wait behind it. For an organisation that keeps writing, suspend it, set its
limits and resume it:
$ mainworthy org --do suspend --org 2
$ mainworthy org --json '{"do":"limits.set","org":2,"results":2000000}'
$ mainworthy org --do resume --org 2
Suspending waits for the organisation's writes already under way to finish, and refuses its tokens and sessions until it is resumed, so its pipelines' reports fail meanwhile and need sending again. Keep it short: a report it sent before the suspension and that is stored while the suspension lasts may be refused too.
Make your own command-line token #
Sign in through the instance's identity provider, then open Settings, Your sign-in, Your command-line tokens. To create a personal token or issue a token under Tokens, you need recent proof of your identity in that browser session. If Settings asks you to confirm who you are, confirm and then create the token again. This browser check does not affect token issuance through the local CLI or with a bearer token.
Anyone signed in through the provider can make their own command-line token, whatever their grants. The local owner can also make one without signing in.
To create a personal token, follow these steps:
- Enter a Token label that says where you use it.
- Choose a Token lifetime. The default is 30 days, and the longest is one year.
- Choose Create personal token.
- Choose Copy personal token.
- Store the token in your shell or script's secret store.
- When you have stored the token, choose Dismiss personal token. Leaving the section also clears the secret from the page.
Set MAINWORTHY_URL to your instance's address and MAINWORTHY_TOKEN to the token, then run the CLI:
$ mainworthy find --json '{"in":"cases","limit":10}'
The token acts as you, with your current personal and team grants on each project. Making it changes no grants. If you lose a permission, all your tokens lose it too. If the instance admin forgets your identity in this organisation, all your tokens here stop working. Unlinking an identity does not revoke tokens. Do not give a personal token to an agent or a pipeline that needs its own identity.
The list shows only your tokens, including any an instance admin made for you, with their ids, labels, creation and last-use times, expiry, and revocation. Choose Revoke beside a token to stop it immediately. Your browser session stays signed in. In Settings, Tokens, r lists the tokens that still work, the newest first and chosen: ↵ picks it, and ↵ again on its row's Revoke token confirms. The owner's last working token stays until another is made. A missing creation reply may mean a token was made but its secret was lost. Check the list, revoke that token, and make another.
The same list and revocation work from the CLI:
$ mainworthy credential --json '{"do":"token.list"}'
$ mainworthy credential --json '{"do":"token.revoke","id":2}'
The credential operation accepts token.create with label, optional expires such as 12h or 30d, and optional cmd.
The reply holds id, actor, token, and expiresAt, a Unix timestamp in milliseconds.
An expiry is required internally, defaults to 30d, and cannot exceed 365d.
A command id prevents a repeated creation. Its secret reply is never saved, and a retry receives conflict.
Creation accepts no actor, project, or grants. It requires a browser session opened through the identity provider, plus recent proof, or local-owner access.
A bearer token and a browser signed in with a token cannot make a personal token.
There is no instance setting to disable personal tokens. An instance admin who is a person can revoke another person's token by id, as with other credentials.
Teams #
A team is a named set of grants. Your permissions are the sum of your personal grants and the grants of all your teams. Grants for one project and grants for every project add up. Removing you from a team takes away its permissions immediately, even for requests waiting to run. Permissions you also have personally or through another team still apply.
If a personal or team grant includes admin, setting it from a browser requires recent proof of your identity. The same check applies if you add someone to a team with admin on any project. Settings asks for confirmation when needed. This check does not change who can manage grants and membership through the local CLI or with a bearer token. Grants without admin and removal operations keep their existing requirements.
To create a team and assign its permissions, open Settings, People, and follow these steps:
- Enter a name in New team name.
- Press Create team.
- Choose the team under Team to manage.
- Choose the project scope under Grant on.
- Tick Team permissions. The new grant replaces the team's grant in that scope, so tick every permission to keep.
- Press Set team grant.
- Select Person to add.
- Press Add team member.
Remove grant removes just the chosen project grant. Remove member takes a person out of the team in one step. Each person's row shows their own grants and a separate line for each team's grants.
Only a person who administers the instance manages teams. Agents, pipelines and the policy cannot join. Another instance admin changes your membership or the grants of a team you belong to. The owner keeps every capability independently and cannot join a team. A team with admin on every project lets every member administer the instance.
The API uses the existing admin operation, at POST /api/admin. The same actions are available through the generated command line:
$ mainworthy admin --do team.create --name Quality
$ mainworthy admin --do team.grant.set --team Quality --project checkout --can read,produce
$ mainworthy admin --do team.member.add --team Quality --person sam
$ mainworthy admin --do team.list
$ mainworthy admin --do team.history --team Quality
$ mainworthy admin --do team.member.remove --team Quality --person sam
$ mainworthy admin --do team.grant.remove --team Quality --project checkout
Leave out --project for a grant on every project. mainworthy actor list labels grants received from a team. With an older API-version-1 server that omits team membership or roles, the CLI and People still show personal grants. Missing roles mean an empty role list. team.history lists creation, membership changes and grant changes with the person who made each change, its time, and the affected person or project. Repeating an action with the same cmd returns its original reply without adding another event. Forgetting a person removes their memberships and shows their pseudonym in team history. Teams, grants, memberships and this history travel in an archive.
Make a token #
A token is a secret that stands for one actor. An agent or a pipeline sends it with each request, and a person types it to sign in.
To create an admin-issued token in Settings, follow these steps:
- Open Settings with g ,.
- Open Tokens. Use j to move down the sections.
- Press n to enter "Token actor".
- Fill in the actor's name.
- Pick Agent, Pipeline or Person under "Producer" to match the actor's kind.
- For a new actor, tick the "Permissions". For an existing actor, these controls are disabled and its grants stay unchanged.
- Choose "Create token".
The new secret appears once, with "Copy token" and "Dismiss secret". A token carries its actor's current grants on every project. A new actor starts with the selected permissions on the project you are in. For an existing actor, the form shows their personal and team grants, including project names and roles, and sends no new permissions when it makes the token. An actor with no personal grants, or only team grants, can still get a token.
Change personal grants with mainworthy actor grant (grant.set), and manage team grants in Settings, People. While actor access is loading, creation waits. If the form cannot read actor access, it says so. A forgotten actor cannot get a token, and the form says so before submission.
From the command line:
$ mainworthy token new --agent reviewer --can read,produce
token for agent "reviewer" (read, record, produce)
<token>
Shown once. It will not be shown again.
Use --human for a person and --ci for a pipeline. For a new actor, add --project <key> to give its initial grant on one project. Without it the initial grant covers every project. For an existing actor, --project does not limit the token's access. Use mainworthy actor list to check its grants before making a token.
Mainworthy shows a token once and keeps only a hash, so it cannot show it again. If you lose one, revoke it and make another.
You need admin on every project to use Tokens or token new. To create your own token without that capability, use Your sign-in. Which tokens you can issue as an instance admin depends on who will use them.
- Any instance admin can make a token for an agent or a pipeline.
- To add a new person, the instance admin must be a person.
- To issue a token for an existing person, the instance admin must also be that person or the owner.
- Only the owner can issue an owner token.
Whoever holds a person's token acts under that person's name. Mainworthy refuses a name that starts with forgotten-.
Making a token for a name that exists adds a token to that actor and does not change its grants. Naming a different --can for an existing actor is refused. Use actor grant for that.
Give a token an end #
An admin-issued token works until you revoke it, unless you give it an expiry. A personal token always expires. --expires takes a whole number and h, d or w:
$ mainworthy token new --ci github-actions --project scratch --expires 90d
In Settings, Tokens, choose "Expires" before you create the token: never, 30 days, 90 days or 1 year. A token past its end is refused exactly as a revoked one is. A browser that signed in with the expired token is also refused.
To replace a token without a gap, follow these steps:
- Make a second token for the same actor.
- Replace the first token wherever you use it.
- Revoke the first token.
Two tokens of one actor work side by side. Each start of the server names every token that ends within 14 days, by its id, actor and label.
See and revoke tokens #
Settings, Tokens, and Settings, People, show "Issued tokens". The list includes each token's number, label, actor, issuer, creation time, last-use time and address, and expiry. A token with no recorded use says "never used". Forgetting a person reads this list again, so their tokens show the forgotten name and revoked state. The actor field identifies the token's actor. If people shared the token, the list cannot tell who used it.
"Revoke" next to a token asks once more on its row, since a revoked token cannot be given back: "Revoke token N" stops it at once, and Cancel or Esc leaves it working. The status line then names the token revoked. With a keyboard, r lists the tokens that still work: choose one, then press ↵ to revoke it. In server mode the last token the owner can sign in with is not revoked. Make the owner another one first.
$ mainworthy token list
1 agent reviewer agent token active made by robin last used from 203.0.113.9
2 ci github-actions ci token active, expires in 90 days made by robin
$ mainworthy token revoke 2
token 2 revoked
When an operation starts, Mainworthy checks your token or session, your identity, and your current grants together. If you lose a grant while waiting for a database connection, the read uses your new permissions. Before returning data, the server checks the project and your permissions again. If someone replaced the project, the server reads from the replacement.
The server accepts a report before it applies the results. Before applying them, it checks the credentials and permissions again. It cancels the report if the token expired or someone revoked it, the session ended, or the actor lost permission to record. Revoking a token after the results arrive leaves those results in place.
A token with no end works until somebody revokes it, so revoke one you no longer use. Revoking a token leaves the actor and its grants in place. To stop an actor on one project, use actor ungrant. To remove who a person was, forget the actor. Only a person who administers the instance can forget an actor, and the owner is not forgotten. The name becomes a pseudonym made from forgotten- and the actor's number. If an archive imported from an older build already holds that name, Mainworthy adds -2, -3 or a later suffix. The tokens stop working, their sessions in this organisation end, and Mainworthy revokes their open invitations. The person's account, with its identities at the provider and any other organisations, is theirs and stays. The history keeps what the actor did.
Forgetting also clears the person's token labels, including labels on revoked rows. Question evidence, saved command replies and report receipts use the pseudonym for attribution. New questions keep actor ids and resolve names when read. Forgetting rewrites display names saved by older builds. This leaves the evidence hash unchanged because it covers the decision's material basis and target, not display attribution. Command ids still name the same requests, so retrying a command does not repeat the write. Replies that held secrets remain unavailable. Text in cases and notes stays as written.
$ mainworthy admin --json '{"do":"actor.forget","name":"dana"}'
{"forgotten":"forgotten-5","tokensRevoked":0}
The raw operation remains available. The page and shorter command are described in Forget a person.
Forget a person #
In Settings, open People and find Forget a person below the list of people.
To forget a person, follow these steps:
- Choose the person in Person to forget. The current owner's name is unavailable, with the reason beside it. You may choose yourself: confirming signs you out of this organisation.
- Press Forget this person.
- Read what forgetting erases and what stays.
- To confirm, press Forget followed by the person's name.
The confirmation takes the keyboard focus. Cancel or Esc closes it without changing anything and returns focus to Forget this person.
The warning says what forgetting erases: the labels of the person's tokens and the network addresses those tokens were used from. It says the person leaves their teams and this organisation, and that their account stays theirs, with the identities they sign in with and any other organisations. History, attachments and the text they typed in cases and notes stay. Some records of their sign-ins and requests stay too. Privacy describes those retained records.
The page shows the pseudonym and the number of tokens revoked. It reads the people and invitations again and removes any invitation link it was showing for that person. If no reply comes back, it reads the lists again. If the person is no longer listed, the page says so and clears the confirmation. Otherwise, retrying the same confirmation uses the same command id.
From the command line, mainworthy actor forget dana prints the warning and makes no change. After reading it, repeat the name to confirm:
$ mainworthy actor forget dana --confirm dana
Forgotten as forgotten-5. 0 tokens revoked. History and typed text stay.
Add --json for the pseudonym and the number of revoked tokens as JSON. Both the page and the command use the same admin operation. actor list --json identifies the current owner with owner: true. If an older server does not identify the owner, the page keeps forgetting unavailable. You must be a person who administers the organisation. You may forget yourself, unless you own the organisation. Nobody forgets the current owner: they first hand the organisation to somebody else. Nobody but the operator acts on the operator's actor, and the operator is not forgotten while they run the instance. Forgetting a person rewrites their name in your organisation only: a person of the same name in another organisation is somebody else, and the person's account and other organisations stay.
If you do not administer the instance, ask an instance admin in your organisation to forget you. Settings lists them under Your sign-in, Leaving this organisation.
Delete your account #
Your account holds the identities you use to sign in through the provider across all your organisations. Once every organisation has forgotten you, you can delete the account. If you still belong to an organisation, Mainworthy names it when you try to delete the account. If you created an organisation, wait at least one day after creating the last one. This keeps account deletion and signup from bypassing the daily limit.
- Sign in through the identity provider. With no organisation, the page says so.
- Press Delete your account, then Delete your account for good.
- If the page asks you to confirm it is you, press Confirm it is you, sign in at the provider again, and repeat step 2 within ten minutes.
Deleting removes every identity of the account, revoked ones and their labels too, and every session they opened, and signs this browser out. The same identity at the provider then signs nobody in: an invitation is the way back. Over the API it is the account operation's delete, from a browser signed in through the provider. An account no organisation has is also deleted by the minute job once 30 days have passed with no activity on it, such as a sign-in, a session in use or leaving an organisation.
The org operation's account.delete lets an operator delete an account at once, naming the organisation and the person's name there, or, for an account no organisation has any more, the person's subject at the identity provider. The person is forgotten in every organisation and the account is deleted. It is refused while the account owns an organisation, and for the operator's own. On mainworthy.com the operator does not use it on a person's request, since an email cannot prove who signs in; delete your own account as above, or ask each organisation's admins to forget you. See Privacy for retained records and typed text.
Sign in as yourself #
A person signs in through the instance's OpenID Connect identity provider, such as Google, Microsoft Entra ID,
Okta, Keycloak or Authentik, and needs no token for it. On mainworthy.com the provider is Clerk, whose page asks
for an email address and password. Mainworthy keeps no password, passkey or second factor
and sends no mail: the provider owns those, and account recovery at the provider too. Whoever runs the instance
sets the provider up. An instance has one provider.
A person gets their first way in through an invitation link, which an instance admin gives them. The owner is the exception: the owner signs in first with the owner token, under Use a token, and then links their identity at the provider in Your sign-in.
An instance with no provider has one person, the owner, who signs in with the owner token, plus agents and
pipelines. It makes no invitation, because nobody could accept one: mainworthy invite new and Make invitation
link are refused and say to configure a provider first.
Manage invitations in Settings, People, and your identities in Settings, Your sign-in. The sections below also list the commands and API requests for scripts.
Invite a person #
Making any invitation from a browser requires your recent proof, even for a read-only invite. If Settings asks for confirmation, confirm and repeat the change. Bearer-token and local CLI invitations keep their existing authority.
In Settings, open People. This section is visible to a person who holds admin on every project. To invite a person, follow these steps:
- Type the person's name. n puts the caret in the field.
- Tick what they may do. The form starts with
read,record,produce,answerandplan.adminstarts unticked. Tick it for somebody who should administer the project. On every project,adminalso lets them invite people, issue tokens, create projects and change grants. - Choose one project, or every project.
- Choose how long the link works, from 12 hours to 30 days. Three days is the start.
- Press "Make invitation link".
The link appears once, masked, with "Copy link". Copy it and hand it to the person. "Dismiss link" takes it off the page, and so does leaving the section. Nothing shows it again. If no answer comes back when you make a link, the page says so and reads its lists again. A person who is in the lists was invited, but the invitation link is lost. A recovery link is then their way in.
"Open invitations" lists the links nobody has accepted yet: who each is for, what that person may do, who made it and when it runs out. "Revoke" withdraws one.
To create an invitation from the command line, run mainworthy invite new:
$ mainworthy invite new dana --can read,produce,answer --project checkout
invitation 1 for "dana" (may read, record, produce, answer on checkout), until 2026-10-16 09:57 UTC
https://mainworthy.example/invite#<code>
This link is shown once. Hand it to dana: it works once, when they sign in at the identity provider.
An invitation for a name nobody has in this organisation is a join: accepting it adds the person. An invitation for a person who is here already is a recovery, which only the organisation's owner makes. See a lost identity.
Command-line invitations follow these rules:
- The link is printed once. Mainworthy keeps only a hash of the code in it, so it cannot print the link again. If it is lost, make another.
- The link works once, for three days.
--expirestakes a whole number andh,dorw, up to30d. A new invitation for the same person replaces the one before it. --canand--projectsay what a new person may do, as they do for a token. Without--cana new person may do everything.- The link starts with the address in
MAINWORTHY_PUBLIC_URL. With that variable unset, the command prints/invite#<code>and tells you to put the address of the instance before it. See configuration. - Only a person who administers the instance can invite someone.
mainworthy invite list shows every invitation, who made it, whether it is open, used, revoked or expired, and what its person may do on which project. It never shows a link. mainworthy invite revoke <id> withdraws one that nobody has accepted.
Accept an invitation #
Open the link. The page says "You are invited as dana" and until when the link works. Press "Accept with" and the provider's name. Sign in as yourself at the provider. When you return, the app opens in the organisation that invited you, where your name is dana.
If the identity you sign in with is already your account's, accepting adds dana to that account: you keep your other organisations, and can switch between them. If it is nobody's yet, it starts a new account. An account that already has a person in the link's organisation is refused, and the link stays open for whoever it was meant for.
The page takes the code out of the address bar as soon as it has read it. The address you see, and the one Back returns to, has no code. Copying that address does not copy the invitation. The browser's own record of the address first opened still holds the whole link. The code is the part after the #. The browser does not send that part of the address to the server. If you reload the page, open the original link again.
If the browser is signed in as somebody else, the page names them and asks before signing them out. When it turns out to be your own account, in another organisation, the server moves the session to the new organisation and signs nobody out. The button stays disabled until the page knows who is signed in and you answer. If the request fails or takes more than twenty seconds, the page says so and keeps the button disabled. Try again checks once more and keeps the invitation.
Your confirmation applies to the person the page named. If the request carries a different person's cookie, the server accepts nothing and the page asks about that person instead. Stay signed in leaves the invitation unchanged.
If two sign-ins overlap, the browser uses the cookie from whichever reply arrives last. The other session can stay open on the server because its cookie was unavailable when the other sign-in began. To end that session, sign in as that person and end it in Your sessions. Otherwise it expires after 14 days without use by default. Sessions on other devices stay open.
An identity that is linked to somebody else on this instance accepts nothing, and the invitation stays open. Sign in at the provider with another account.
A link that was used, was revoked or has run out says "This invitation does not work any more." So does one that was cut short when it was copied. Ask whoever sent it for a new one.
A script reads an invitation with POST /api/login/invitation and accepts it through the provider with
POST /api/login/oidc. API has the requests.
Through the identity provider #
On the sign-in page, press "Sign in with" and the provider's name. The browser goes to the provider and comes back signed in.
The provider says who signed in. Mainworthy decides which person that is here, and it never decides by an email address or a name the provider sends. An identity reaches a person in one of two ways:
- An invitation. On the invitation's page, choose "Accept with" and the provider's name. The identity's account becomes the person's. A recovery invitation accepted this way moves the person to the accepting account and ends their tokens and sessions in that organisation.
- Linking. A person who is signed in opens Settings, Your sign-in, and chooses "Link" with the provider's name. The browser goes to the provider and comes back to that section. This is how the owner, signed in with the owner token, gets an identity.
An identity belongs to one account across all its organisations. If another account has already linked the identity, Mainworthy refuses the link. No instance admin in any of those organisations can see or remove the account's identities.
If you signed in through the provider, Your sign-in lists your identities with the provider's name and the email it supplied. If you signed in with a token, you see only how many identities you have. You can link more than one, including a second account at the same provider. You can remove an identity and link it again later. To remove your last identity, link another first. Forgetting a person in one organisation leaves the account's identities in place.
Linking an identity, your first included, and removing one need recent proof. Signing in with a token gives a first link that proof.
An identity the provider vouches for that nobody here has linked does not sign in. The page says "That did not sign you in." An instance admin invites the person, or the person links the provider from a session they have.
An identity belongs to the provider it was linked at. If the instance's provider changes, identities linked at the old one sign nobody in. The owner signs in with the owner token and links again, and everybody else gets a new invitation.
Failed attempts are counted by address and by token prefix, as for a token: a wrong token, a wrong invitation code and a provider answer that is refused each count. The fifth failure from one address within 15 minutes blocks it for one second, and each further failure doubles the wait, up to 15 minutes. A blocked sign-in is answered limited. Troubleshooting says what to do.
Starting a provider sign-in has a separate limit of 300 successful starts per public IPv4 address or IPv6 /56 in one minute.
People sharing that address or network share its allowance too.
A blocked start says how long to wait, with 429 limited and Retry-After seconds in the API.
The wait never escalates, and retries do not extend it. No instance-wide start allowance lets another network block your first attempt.
An unreachable provider does not spend the allowance. Signed-in provider linking and a working invitation bypass it.
Ordinary starts never add to failed-attempt counts. Valid answers to pending provider sign-ins can still finish during a start limit. A working invitation opens its page and can be accepted during an address block.
Pending sign-ins still have a memory limit. At capacity, the source holding the most live ones loses its oldest entry, so a large flood does not discard a small unrelated source's pending sign-in. If sources hold equal shares, an oldest entry can still be displaced. Mainworthy counts independent IPv4 addresses or /56 networks as separate sources, even when one client controls several of them. The address follows the instance's proxy configuration. Unknown and private addresses are not subject to a start allowance and share one retention bucket. A full store makes room from a source with the most stored records, as troubleshooting describes, so a flood from these addresses loses its own records once its bucket is the largest. Configure the proxy to distinguish visitors.
Confirm it is you #
Some changes need recent proof in the browser session that asks: linking a second identity or removing one,
creating a token from a browser, making an invitation or recovery link from a browser, granting admin, team
changes that give admin, and importing an archive. Proof lasts ten minutes.
- A session opened by typing a token has proof for ten minutes from sign-in. After that, sign out and sign in with the token again.
- A session opened through the provider gets proof with Confirm with and the provider's name. When Settings asks for confirmation, choose that button. After you return to the same screen, repeat the change. The browser goes to the provider, which asks you to sign in again rather than reuse its own session. The provider must sign in the same person: another identity is refused.
Mainworthy requests max_age=0, an essential auth_time claim and prompt=login for confirmation.
Google requests omit prompt=login, which Google does not document as supported.
The provider must say when you signed in there (the ID token's auth_time), and that must be after you pressed
Confirm with. The proof lasts ten minutes from that sign-in. A provider that does not say gives no proof: whoever runs the instance enables the claim at the provider
(for Google, see Google accounts). A session opened with a token proves by
signing in with the token again.
Another browser's proof does not count for this session. A bearer token cannot provide session proof, so use a signed-in browser for these changes, or the local CLI. The local-mode owner and accepting an invitation need no prior proof. The last identity a person has stays even after proof. Removing an identity that this session rests on ends the session.
On an instance you run yourself, if you lost every identity, you can still issue a recovery link in your own organisation with your owner token or the local CLI.
When you cannot sign in #
The identity provider holds your password and second factor, so it recovers them, and nobody in your organisation can:
- A forgotten password: the provider's sign-in page resets it, as its own help says.
- A lost second factor and every backup code: Mainworthy cannot reset it; follow the provider's recovery. On
mainworthy.comnobody resets it, not even whoever runs the instance. Where the provider will not recover it, make a new account and ask your organisation's owner for a recovery link, which brings you back as the same person; an admin can only add you under a new name. An organisation has one owner, so as owner keep your backup codes, a second linked identity or an unexpired personal token, or hand the organisation on before you need to. - "Nobody on this instance signs in with that identity": the provider signed you in, and no account here has that identity. Where the instance takes no signups, an instance admin in your organisation sends you an invitation link.
- The identity itself is gone: see a lost identity.
A lost identity #
Mainworthy has no password to reset. If you cannot sign in at the provider, recover your account there, as its own help says. If the provider account is gone, or you need a different one, ask for a recovery link.
In Settings, People, "People who sign in" lists each person. The organisation's owner sees "Recovery link" beside every person. If you need a recovery link, the section tells you to ask the owner. Only the owner sees the button. Press it, read what it does, and press "Make the recovery link". The link is shown once, as an invitation's is.
Opening the confirmation moves focus to Make the recovery link. Cancel or Esc closes the confirmation and returns focus to that person's Recovery link button.
From the command line, invite the person again. For a person who exists, the link is a recovery:
$ mainworthy invite new dana
invitation 2 for "dana" (a recovery: whoever accepts it is dana here, and dana's tokens and sessions here end), until 2026-10-16 09:57 UTC
https://mainworthy.example/invite#<code>
This link is shown once. Hand it to dana: it works once, when they sign in at the identity provider. When it is accepted, whoever accepts it is dana in this organisation, and every token and session dana had here ends. Their account elsewhere is not touched.
Until someone accepts the recovery link, the person can still sign in as before. Accepting the link moves the person in this organisation to the account that accepted it. The old account keeps its identities and its other organisations.
Only the organisation's owner can issue a recovery link, even if an instance admin needs one for their own name. Only the operator can make one for the operator. An account that already has a person in the organisation cannot accept the link.
Accepting recovery revokes every token belonging to that person in this organisation, including personal CLI tokens and tokens issued by an instance admin, and ends their sessions here. Scripts using those tokens stop working and need new tokens. Tokens belonging to other people, agents and pipelines stay as they are.
Instance admins in the organisation can see whose access each recovery restored and who issued the link with mainworthy invitation --do recoveries.
Recovering the owner also revokes their configured MAINWORTHY_OWNER_TOKEN, even if it was their last token. The identity they accepted with still signs them in. To restore a configured owner token, set the variable to a new value and restart. Restarting with the revoked value does not revive it. CI jobs that use that owner token also fail authentication until their configured secret is updated to the new value. CI using a separate pipeline actor's token is unaffected.
Your sessions and your ways of signing in #
A session is one browser that is signed in. Settings, "Your sessions" lists your sessions. Each row shows the sign-in method, initial address, browser name, last-use time and address, and maximum expiry. "this browser" marks your current session. "End" signs the selected browser out. Ending your current session is the same as signing out.
An account keeps at most 20 sessions open through the provider. Signing in a 21st time ends the oldest, which then asks to sign in again, and of the sessions that ended Mainworthy keeps the 20 that ended last.
A person who administers the instance can inspect another person in Settings, People. Beside their name, open Sign-in details. It lists their sessions with the same details and End button as your own sessions. For another person, End asks you to confirm with End this session or Cancel. Ending this browser's session opens the sign-out dialog.
Identities belong to the person's account. An instance admin cannot see or remove another person's identities through Sign-in details.
The confirmation moves focus to End this session when it opens. Cancel or Esc closes it and returns focus to the original End button. Cancel has a target of at least 44 by 44 pixels on a phone, as it does for a recovery link.
A script lists them and ends one:
$ mainworthy session --do list
[
{
"id": 2,
"openedWith": "oidc",
"label": "[email protected]",
"userAgent": "Mozilla/5.0 ...",
"createdAt": 1791885461648,
"createdFrom": "203.0.113.9",
"lastUsedAt": 1791885461648,
"lastUsedFrom": "203.0.113.9",
"expiresAt": 1799661461648,
"current": false
}
]
$ mainworthy session --do end --id 2
{
"ended": true,
"current": false
}
openedWith is token or oidc. current is true for the session that sent the request. The command line uses a token, so current is always false for command-line requests.
Manage your identities in Your sign-in. Only a browser signed in through the provider can act on your account. A token or a browser session opened with one cannot use the account operation.
orgslists your organisations.identity.listlists your identities. With recent proof,identity.removeremoves one. Your last identity stays.session.listlists your sessions in every organisation. Usesession.endto end one.
POST /api/login/switch with { "org": 2 } moves the browser session to another organisation on your account. See API for the requests.
The credential operation lists, makes and revokes your personal tokens in this organisation with token.list, token.create and token.revoke.
These two commands need no capability. A person who is signed in runs them for what is their own. An agent can list and end its own sessions. The credential operation refuses an agent with forbidden because only a person signs in through the provider. A pipeline is refused by both.
What an admin can do for somebody else #
A person who holds admin on every project can:
- List somebody's sessions with
mainworthy session --do list --actor danaand end any session by its id. - Invite a new person, list and revoke invitations, and read the recoveries (
mainworthy invitation --do recoveries).
An instance admin never sees, links or removes somebody else's identities. Only the organisation's owner makes a recovery link. An agent that holds admin can do none of this. Settings, People, offers the sessions under each person's Sign-in details.
Sign in to the web UI #
In local mode you sign in as the owner, with no step. An operation waiting across an archive import still runs as the configured local owner. See configuration for what local mode means.
In server mode, an instance with an identity provider offers only "Sign in with" and the provider's name. See through the identity provider.
To use the owner token or a personal token, open /signin/token on your instance. Paste the token under "Sign in with your token" and press "Sign in with the token". This page works during a provider outage and has no link on the main sign-in page. With no provider configured, the main sign-in page keeps this token form.
Tab goes down the page, and ↵ sends the form the caret is in. The server opens a session for that browser, and the browser keeps a cookie that names the session. The cookie identifies the session. After sign-in, the browser does not hold the token.
A page's operation requests and signed-in account changes carry the actor id the page loaded, so a shared cookie cannot record your text as somebody else. If another tab signs in as a different person, the server refuses the stale page's request and asks you to sign in again. This also applies when the new person has the same name as a forgotten person.
For HTTP clients that send X-Mainworthy-As, its value is the exact decimal actorId from /api/session, such as 3. Names, percent-encoded values and other number formats such as 03 are refused. Clients that omit the header continue to act as their credentials identify them.
An expired session returns HTTP 401 unauthenticated, including when it expires while an account read or live-update connection request is being authorized. Sign in again to continue.
To sign out, press Sign out at the bottom of the sidebar, or g x. Ending this browser's session in Settings, Your sessions, opens the same dialog. It offers three choices:
- Sign out and keep drafts starts with the focus. It keeps your browser data so your drafts are there when you sign in again.
- Sign out and clear browser data removes your name, case drafts, queue answers, and run notes from this browser. The warning explains that unsaved text in every open tab will be lost and cannot be recovered.
- Stay signed in, or Esc, closes the dialog without signing out or clearing data.
Tab moves among the choices, and ↵ or Space presses the focused button. Signing out ends the session on the server, so a copy of the cookie stops working too. If no answer comes back, the page checks whether the browser is still signed in. If the first check gets no answer, the page checks a second time. If either check confirms that the session ended, the page applies your choice and shows the sign-in page.
If a check finds you still signed in, the attempt ends and keeps your browser data. If neither check answers, the page says it cannot tell whether you are signed out and that your browser data was kept. In both cases, the choice to clear ends with that attempt. Press Sign out again to choose and retry. Before leaving a shared computer when Mainworthy cannot answer, clear the site's data in your browser settings. A pending choice stays only in the tab making the attempt and does not survive a reload. A later expiry or sign-out in another tab does not apply that old choice. A session that expires keeps your drafts. In local mode there is nothing to sign out of, and no button.
A session ends after 14 days without use and after 90 days in any case. It also ends in these cases:
- The token you signed in with is revoked or reaches its end.
- The identity you signed in with is unlinked.
- A recovery link for your person in that organisation is accepted by another account.
- You switch the browser to another organisation.
- Your actor is forgotten.
Each of these sends you back to the sign-in page. Configuration says how to change the two lifetimes.
After a tab processes a successful sign-in, it discards replies to earlier session checks and signed-in requests. If you sign in again as the same person and the site can use browser storage, other open tabs also discard those replies. They keep your drafts, run notes, and pending attachments. If you sign in as someone else, the other tab returns to the sign-in page. If repeated sign-ins interrupt both startup session checks, choose Reconnect to check the session again.
The browser may replace the session cookie before the tab processes the sign-in reply. Other tabs get protection only after that reply and only if browser storage is available. Without storage, each tab protects its own requests. For overlapping sign-ins, the browser uses the last cookie it receives. The server may have completed a request even if the tab discards its reply. Before you repeat a write, check what the server recorded.
The owner's token comes from the server. If you set MAINWORTHY_OWNER_TOKEN, that value is the token. If you did not, the server prints one on its first start:
Mainworthy 0.1.0 · server · data in /data · http://localhost:7357
project "scratch" · owner robin · sign in with a token or through Google · policy: loose
owner token (shown once): <token>
The second line says who the owner is and how people sign in: with a token, and through the provider when the instance has one. Server mode signs nobody in on its own. In local mode the line reads you are robin@this-machine, because there you are the owner; with a proxy named it says to sign in with a token, as server mode does.
Copy the owner token when it appears. If you miss the token, set MAINWORTHY_OWNER_TOKEN to a new value of 20 to 512 visible ASCII characters without spaces. openssl rand -hex 32 makes a suitable value. Startup refuses whitespace, control characters and non-ASCII characters before changing any token or session. Restart the server to add a valid value as a token. A new value also revokes every token previously issued through that variable. At startup, the server names those tokens in one log line. The server refuses a value that matches a revoked or expired token, or somebody else's token. At startup, it names the reason in one line and leaves the token unchanged. If no value is set and the owner holds no working token, the server prints a new token at startup, as on its first start. In the container, docker compose logs has the line.
The command line needs no token in local mode on the same machine, unless a proxy is named. In server mode, give it one with MAINWORTHY_TOKEN, or --token-file for a token in a file. --token works too, but an argument appears in the process list and the shell's history. Prefer the variable. If the command is about to send a token to plain http:// on another machine, it warns once on standard error. Use an https:// address.
What a pipeline can never do #
A pipeline can hold read and record, and nothing more, under every grant and every policy. It reports results and their attachments, can append files to its own results, says when a change ended, and reads a commit's gate. It cannot answer a question, edit a case, plan a run or administer the instance. A grant for a pipeline that lists more is refused:
$ mainworthy actor grant github-actions --can produce --project scratch
invalid: a pipeline may hold read and record, not produce; give an agent or a person the rest
A pipeline with only record cannot read cases or the queue either. Add read if its job needs them. The token for a pipeline is in report results.
Where it is in Settings #
These Settings sections manage policy, access and sign-in:
- Policy shows who answers under the current policy. See policy.
- Tokens makes, lists and revokes tokens. An instance admin sees the form. Everyone else sees "An admin creates and revokes tokens."
- People invites a person, lists and revokes open invitations, makes a recovery link (the organisation's owner only), manages teams and their grants, and forgets a person after confirmation. Sign-in details lists and ends each person's sessions. Issued tokens lists token use and revokes tokens. Only a person who holds
adminon every project has this section. - Projects lists the projects you can reach and creates a new one.
- Connect shows the pipeline and agent connection lines, with the address of this instance.
- Your sign-in lists, links and unlinks your account's identities at the provider, confirms it is you with the provider, and creates your personal command-line tokens. Only a person has this section.
- Your sessions lists the browsers you are signed in on and ends any of them.
People shows personal grants with their roles and the permissions received from each team. Use mainworthy actor grant to edit personal grants.
See also #
- Let an agent in for an agent's token and what its work counts for.
- Policy for who answers each question.
- Command line for every
token,actorandinviteflag.