Caroline

Rules

Write the rules, check them, publish them

Rules are data: small files an author writes in words the business uses, checked before they go live, proven when you ask, and live within about a second.

The lifecycle

From a draft to a decision

  1. Write
    • in the console, as a card or from blocks
    • in Rego or Cedar when the model cannot say it
    • from a pack, a suggestion, or Draft with AI
    • in your own editor, with the caroline command
  2. Check
    • the review: every change in words
    • the pack's scenarios and real past requests, replayed
    • tests: examples and never-rules
    • impact: who gains, who loses
    • proofs, for every possible request
  3. Publish
    • one commit, under your name
    • a stale save is refused, not merged
    • a change from a suggestion waits for a second person, by default
  4. Live
    • OPAL brings it to the engine within about a second
    • a shadow rule runs and is measured before it decides
  5. History
    • each change in words, with its author
    • who gained, who lost
    • any earlier version, put back

Rules are data

A rule is a small file

An effect (allow or deny), the subjects it is about, the actions, the records, and conditions that compare their attributes. One evaluator, written once, reads every rule, so every rule is checked against the same schema when it is saved and reads back as a sentence. RBAC, ABAC and PBAC are one shape.

# Any AI agent whose role is finance agent may prepare payment orders, provided their department
# matches the resource's department and the resource's gateway is one of their gateways.
id: agent-prepare-payment
effect: allow
subjects:
  kind: [agent]
  role: [finance_agent]
actions: [prepare]
resources:
  type: [payment_order]
conditions:
  - {attr: department, op: subject_eq_resource}
  - {attr: gateways, op: resource_in_subject_list, resource_attr: gateway}
owner: finance-operations
review_by: '2027-03-31'

The comment on top is Caroline's sentence for the rule, written on every save. The fields decide.

Three languages, one decider

The model, Rego or Cedar

Most rules fit the model. When one does not, write it in Rego or in Cedar: it keeps its owner, review date and scope in YAML, says only whether it matches, and is checked when it is saved. OPA stays the one decider.

Three languages, one decider Your rules, written in the YAML model, in Rego in its own fenced module, or in Cedar as one policy checked at save, all go to one evaluator in OPA, which applies default deny, a deny wins, and an agent never beyond its person, and gives the answer, allow or deny, with the rule that decided. Rules in the model and in Cedar also read as Cedar and export as one bundle for AWS Verified Permissions; Rego stays in OPA. YOUR RULES Model (YAML) fields and conditions; most rules Rego its own module, fenced at save Cedar one policy, checked at save One evaluator in OPA default deny; a deny wins; an agent never beyond its person The answer allow deny with the rule that decided Rules in Cedar, and Export for AWS model and Cedar rules as one bundle for AWS Verified Permissions; Rego stays in OPA
A rule in Cedar is answered with Cedar first, and the evaluator folds the answer into allow or deny within the scope its YAML declares. A rule in Rego lives in its own module and cannot reach outside its inputs. Cedar on the Policies page shows the rules in the model and in Cedar as Cedar, read-only, lists what is not in Cedar, and offers Export for AWS.

Before anything goes live

Check before you publish

The review

Review & publish opens a read-only review before anything is saved, whoever or whatever wrote the change: each added, removed or changed rule in words, the pack's example requests before and after, and the engine's recent real requests replayed against the change.

Tests

Examples say who, does what, on what, and the answer expected. Never-rules say what must never be allowed. Coverage shows which rules no example reaches, and Fill the gaps looks in your directory for a real case for each; a rule nobody there meets gets none.

Impact: who gains, who loses

Impact compares a change with the published rules on today's directory and names the people and agents who gain or lose access. It asks only the requests a changed rule could match, so the answer is exact, up to 4,000 requests from the console; past that it stops and says so.

Proofs

A proof says what a change can do for any request the rules' types allow, not only for today's directory:

  • Proven: it removes access only, or no request changes its answer.
  • Can add access: with a request the engine allows only after the change.
  • Not proven: with why.

Shadow rules

Publish a rule in shadow and it runs on every real call without deciding. Decisions shows every call where it would have answered differently. Turn shadow off when the differences are the ones you meant.

Help with writing

Draft with AI, and packs to start from

Describe a rule in your own words. A model drafts it in the rule model, Caroline checks it and shows what it would change, and a person decides whether to publish. The model proposes; it never applies, and it never answers an access question. Drafting uses Anthropic's Claude or a local model in your own cluster, whichever the installation turns on; it is off until one is.

A new installation can start from one of seven packs (AI Agents, Coding Agents, Banking, Hospital, Aviation, Retail and Neutral): rules, the vocabulary they use, sample records and tests, all data.

Write your first rule, in the docs