Write the rules / The caroline command
The caroline command
Pull an installation's rules into a folder, edit them in your own editor, check them the way the console does, and publish through Caroline's own save path. Read the decision log and verify the ledger from the same command.
Install
One file, Python standard library only. It runs on macOS's own /usr/bin/python3 and on Linux, against Caroline 0.48.17 or later.
install -m 755 caroline ~/.local/bin/caroline
~/.local/bin must be on your PATH. In VS Code, install the Red Hat YAML extension when the folder recommends it.
Sign in
caroline login https://app.example.com
It asks your author name, then your passphrase (never echoed, never stored). A session lasts 8 hours. For a script, --passphrase-stdin reads the passphrase from standard input.
Pull
mkdir rules && cd rules && caroline pull
code .
policies/policy.yaml the pack and the rules in order
policies/rules/<id>.yaml one rule per file; a Rego rule also has <id>.rego
.caroline/ the server, the revision pulled, the schema (git-ignored)
.vscode/ settings, tasks, the recommended extension
Write a rule
caroline new contractors-read
Makes policies/rules/contractors-read.yaml from a template and lists it in policy.yaml. VS Code completes and checks the fields as you type.
Preview, test, impact
| Command | Gives |
|---|---|
caroline preview | Caroline's checks, the changes, and the past decisions that would flip |
caroline test | the installation's tests, run on your copy |
caroline impact | who gains access and who loses it |
In VS Code the same commands are tasks (Terminal › Run Task › Caroline: Preview), and Caroline's problems land in the Problems panel on the rule's file. Nothing changes in Caroline until you publish.
Publish
caroline publish -m "Contractors may read documents"
The same checks as the console, a ledger record under your name, and the push to the engines. When someone published since your pull, the publish is refused as stale and your files are untouched: copy your edits aside, caroline pull --discard, put them back, preview again.
The comment on top of each rule is generated from the rule; comments of your own are not kept. Notes belong in the rule's description.
Read decisions
For policy authors only: the log holds a year of subject and resource ids.
| Command | Gives |
|---|---|
caroline decisions | the last hour, oldest first |
caroline decisions --since 24h --limit 500 | a duration back, or a time |
caroline decisions --follow | decisions as they arrive |
caroline decisions --id ID | one decision, every field |
Verify and export the ledger
| Command | Gives |
|---|---|
caroline ledger verify | recomputes the chain; a break is named by file and line |
caroline ledger export 2026-11-18 | one UTC day as NDJSON, what a SIEM ingests |
caroline ledger export --all | the whole ledger as one zip, with its own offline check |
Exit codes
| Code | Means |
|---|---|
0 | done |
1 | a check failed or a publish was refused |
2 | Caroline cannot be reached, or sign in |
3 | stale: pull first |
--json on preview, test, impact and publish prints Caroline's answer as it came.
Not yet
A key for CI to publish with, a merge when two people changed the same folder, Git as the source of truth, an offline check, a VS Code extension.