Skip to content

Rules

Rules are behavioral constraints — guardrails that apply regardless of persona.

Terminal window
brainjar rules create no-delete --description "Never delete files without asking"

This creates a rule on the server with a template — a title, your description, and a Constraints section with bullet points to fill in. Let your AI agent populate it (see Authoring with AI).

Here’s what a filled-in rule looks like:

# No Delete
## Constraints
- Never delete files without explicit user confirmation
- Before removing any file, list what will be deleted and why
- If multiple files are affected, present them as a checklist
Terminal window
brainjar rules add security # Workspace scope (or project if auto-detected)
brainjar rules add no-delete --project # Explicitly force project scope
brainjar rules drop security # Deactivate
brainjar rules delete security # Permanently delete

Project scope is auto-detected when your working directory contains a .brainjar/ directory.

Rules bundled with a persona activate automatically — you don’t need to add them manually.

Terminal window
brainjar rules list # See all rules with status
brainjar rules show security # View a rule's content
brainjar rules history security # List version history
brainjar rules show security --rev 2 # View a previous version
brainjar rules revert security --to 2 # Restore a previous version

When you see scope labels in status and rules list output:

LabelMeaning
(workspace)Set at workspace scope on the server
(project)Overridden at project scope
(+project)Added by project override
(-project)Removed by project override
(env)Overridden by BRAINJAR_* env var
(+env)Added by env var
(-env)Removed by env var