Skip to content
Select theme

Protect branches and objects

AI agent getting started? Read Agents: start here first.

Protection controls how a change reaches a branch. Use branch rules for team review policies and object locks when a particular record needs additional protection. You still need write access to the affected projects.

NeedControl
Review changes before accepting themRequire a proposal and approvals on the target branch
Keep one project’s accepted data under reviewA project rule with extent rows on main
Protect the organisation trunkAn organisation rule with extent ref on main
Preserve a fixed snapshotA read-only baseline
Prevent changes to one objectAn object lock

Several rules can match a branch. Each applies unless you qualify for that rule’s bypass. Bypass does not grant project access or override a frozen object.

Open Admin, then Project branch rules for a project’s rules or Organisation branch rules for the organisation’s. Everyone who reads the project sees its rules; a person with administer projects can change them.

To add a rule, complete its three sections:

  1. Branches: choose the data covered and the branch pattern.
  2. Changes: choose the update rule, proposal requirement and required approvals. Set a minimum approver role or named approvers. Project rules covering entire branches can also restrict deletion.
  3. Who can skip this rule: choose the roles, people, service identities or apps that may bypass this rule.

Choose Edit on a row to change its settings in a dialog; the pattern and what the rule covers cannot change. When the host refuses a rule, the refusal appears in the field it names, such as the branch pattern or the approvals needed, and the form keeps your values. Adding a rule the project already has returns the existing rule.

For example, require review for one project’s rows on main, then require two approvals:

Terminal window
openeng rules add --project <id> --extent rows --pattern main --consequence merge-only
openeng rules list --project <id> --json
openeng rules update --project <id> --rule-id <rule-id> --required-approvals 2

Replace the identifiers with values from your instance. You need administer projects to change these rules. An agent-mode update waits for your browser confirmation.

See Branch rule reference for all flags, defaults, bypass entries and refusals.

A type can be direct (directly editable), immutable or owned (writable only by its designated connector). An immutable type can be set at first publication or tightened later, but never relaxed. Updates and deletes are refused. An owned type can only be written by its designated connector integration.

A person with the lock objects capability can set an object-level edit restriction (instance lock) to frozen or merge-only. A frozen object cannot be changed. These rules can result in immutable, owned or frozen refusals.

Merge changes into any writable branch. If a project branch needs an operator update to its database schema, the platform returns branch-needs-schema-update and asks you to update this branch’s schema.

The CLI commands for branch rules are openeng rules add, openeng rules update, openeng rules list and openeng rules remove. Organisation branches and baselines use openeng org-refs create, openeng org-refs list, openeng org-refs delete and openeng org-refs mark-read-only.

Set an object’s lock with openeng locks set --project <id> --ref <ref> --object <objectId> --lock <none|merge-only|frozen> --reason <text>. Use --lock none to lift the lock. The --reason flag is required: write it like a commit message, as Propose, compare and merge teaches. The platform writes it first in the commit message. The --ref flag takes a branch name.

  1. Request a branch schema update with openeng schema-update request --ref <ref>. This records a request for your platform operator; you cannot execute the update yourself as a customer. When the operator runs the update, it merges the organisation trunk into the branch only if the branch lacks the trunk’s latest schema change, bringing both the schema and rows saved on the trunk since the branch was cut.
  2. Read the request’s state with openeng schema-update show --ref <ref>. If the branch and trunk changed the same row, the request ends failed with merge-conflict, the branch stays unchanged, and the next update tries again.

The --ref flag of both commands takes a branch name.

Run openeng help <command> for exact flags. See Refusals for each refusal and its remedy.

See the exact patterns.

See the exact rule settings.

See the exact branch rules.

See the exact bypass lists.