Write the rules / Draft with AI
Draft with AI
Describe a rule in your own words. A model drafts it, 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.
What it does
What it never does
- Decide. Every access decision is the engine running the rules. With drafting on or off, no model is on the decision path.
- Publish. A draft is a proposal. Only a signed-in author's Commit & publish saves it, and the ledger names that author.
- Write Rego. Drafts are in the rule model only, so every draft is checked by the same schema as a hand-written rule.
Providers
The model is a component: you pick it per draft, and everything after the draft (the check, the one repair try, the preview, the publish) is the same code whichever wrote it.
| Provider | Runs | On when |
|---|---|---|
| Anthropic Claude | Anthropic's API, outbound | the installation holds an Anthropic API key; the list shows the models that key can use |
| Local model | an Ollama server in your cluster | it answers and holds the configured model; checked live, no restart |
It does not by itself mean private: your intent is logged (shortened) by Caroline, and Ollama's own API has no authentication. Keep the local model inside a network only Caroline can reach.
Turn it on
Drafting is off until your installation's operator turns a provider on. For Claude, the operator puts the API key in the installation's secret store; Caroline never shows or logs it. For the local model, the operator runs the Ollama overlay and pulls the model once.
Draft a rule
- Start a new policyOn Policies, + New policy. The box under the parts says which model the AI agent drafts with.
- Describe the policyUse the words of your business; the draft takes the attribute and action names from your pack's vocabulary.
- Check the draftThe draft fills the card's parts, marked AI draft: check it. Change any part. Then Review & publish shows the rule as a sentence, and the past decisions it would change, allowed to refused and refused to allowed.
- Commit & publish, or discardPublishing is a save like any other: checked, recorded, pushed to the engines within seconds.
Limits
- One rule per draft.
- A draft that fails the schema gets one repair try, then it is shown as failed with the problem named.
- A small local model can skip optional fields; read the preview before you publish.
- Drafting needs a signed-in author, as publishing does.