Risk levels
Rules that score each change at its gate, so a risky change asks more people and a safe one can pass by policy.
Every gate waits for a person. Risk levels let a gate ask for as much as the change needs: more approvals for a change that touches sign-in or the database, and — only where you allow it — none for a change that only edits documentation.
Nothing changes until a project has a rule. A project that has written none and picked none has the gates it always had.
Four levels
A change is low, normal, high or critical risk. A change no rule matches is normal, which is the gate exactly as it was. You don't define levels; you write rules that say which level a change is.
Rules
Write rules in Settings → Risk rules, in the project they're for. To use the same rules in many projects, keep them in one project the others use: each of them sees its rules on that page and ticks the ones its gates should check, the way it picks that project's workflows and instructions. A rule is one of four kinds:
- A question about the change, such as "Does this change alter how people sign in?". Peractor asks a model, with the diff and nothing else — never the agent's own summary — and the answer decides whether the rule matches.
- Files: the change touches any of some paths
(
**/migrations/**), or only touches some (docs/**). - A command run in the phase's workspace, whose exit code is the answer.
- Size: the change is bigger than a number of lines or files.
The highest level any rule matched wins. Try on recent runs in the rule's editor shows what it would have said about your last gated runs before you save it.
There are no built-in rules: a project has only the rules it writes or picks. The Risk starter pack in the Marketplace has ready ones, among them a secrets file as critical and text in the change addressed to its reviewer as high.
As the list grows, search it — by a rule's name, its reason, what it checks or its category — and file rules in categories: make one with the folder button, then drag a rule into it, or use Change category on a phone. A linked project's rules show under that project's own categories.
A rule's menu has Duplicate, and a linked project's rule has Copy to project, which makes it this project's own to change. Both start on trial. Two rules in one category can't have the same name; the editor says so as you type.
Trial first
A new rule starts on trial. It is checked on every gate and shown under "Trial rules — they don't count yet", but it changes nothing. Its row in Settings shows how often it matched, how often people agreed with it and how many of those changes were reverted. Turn it on when the numbers say it is right.
What a gate asks
At a gate, the risk shows above Approve in the level's colour, with
the rules that set it. By default a high or critical change needs two
approvals, and at critical the change's author can't be one of them.
A project can change that ladder in its policy, on Settings → Risk
rules — the Policy row on the dashboard and the desktop app,
the foot of the page in the apps — and a workflow can say what each of its gates asks with a
risk: block on the phase:
gate: true
risk:
low: { auto: true }
high: { min: 2 }
critical: { min: 2, approvers: [{ role: admin }] }
An approver can raise a gate's level from its menu, and an organization admin can lower it with a note. Either holds until the next commit.
Passing by policy
A low-risk change passes on its own only when all of these hold:
- the workflow's gate says
low: { auto: true }; - the rule that lowered it is on, not on trial;
- no rule raised the level;
- the phase's checks passed;
- the change is under the project's size cap (200 lines unless you change it).
The gate is never skipped: it is approved by Peractor, on the record, and shows "Passed by policy" with the rules that let it. A share of these (10% unless you change it) goes to people anyway as a spot check, so the policy itself is reviewed. The size cap, the spot checks and the model that answers question rules are set in the same policy.
A phase that holds a message, an event, a post or files to keep always waits for a person, whatever its level: those go out as whoever approves them, and a policy is nobody.
If one shouldn't have passed, press This should not have passed on its gate. The rules that let it through go back on trial and the project's admins are told. Reverting the change on the base branch does the same.
To stop passing by policy, take low: { auto: true } off
the workflow's gate; its gates keep their levels and wait for
people.