CarolineDocs

Start / How a decision is made

How a decision is made

One question per action: may this subject do this action on this resource? Caroline answers yes or no, names the rule that decided, and records the answer.

1 · AskYour gateway or appbuilds the question from facts the caller cannot choose
2 · Look upCaroline's directoryadds what it holds about the subject and the resource
3 · DecideThe engine (OPA)runs the rules; a deny wins over any allow
4 · RecordThe ledgerkeeps the question, the answer and the rule

The question

Every question has the four parts of an AuthZEN 1.0 evaluation:

PartExampleMeans
subject{"type": "agent", "id": "a_supply_agent"}who asks: a person or an AI agent
action{"name": "read"}what they want to do
resource{"type": "inventory", "id": "r_stock_azure_prod"}what they want to do it to
context{"on_behalf_of": "u_plan_mia"}the circumstances: the person an agent acts for, the gateway it came through

The ids are enough. Caroline looks the subject and the resource up in its own directory, so a caller cannot make itself a manager by saying so: attributes sent inline for a held record are not trusted.

The answer

{
  "decision": true,
  "context": { "reason": "..." }
}

Only "decision": true, exactly, allows. Anything else (a false, an error, a timeout, an answer that is not JSON) is a refusal, and the caller does nothing. The reason names the rule and is for your operators, never for the end user or the model.

Rules are data

A rule is a small YAML file: an effect (allow or deny), the subjects it is about, the actions, the resources, and conditions that compare their attributes. One evaluator, written once in Rego, reads every rule, so every rule is checked against the same schema at save and reads back as a sentence. This one is from the AI Agents pack:

# 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. The rule model lists every field and operator.

When the model cannot say it, a rule may be written in Rego instead (language: rego). It lives in its own module, says only whether it matches, and is fenced at save: it cannot reach outside its inputs. The evaluator folds it into allow or deny like any other rule.

Deny overrides

Who decides, who enforces

Caroline decides. It never sits in the data path and never sees the data itself, only the question.

Your gateway enforces. It asks before it acts and acts only on an exact yes. Caroline ships a reference MCP gateway; any AuthZEN client can ask the same endpoint.

No model is on the decision path. AI can draft a rule for a person to publish; it never answers a question.

The ledger

Every decision and every change to the rules, keys, agents or directory lands in a retained ledger. Each record carries the hash of the one before it, so a removed or edited record breaks the chain and caroline ledger verify names where.

Words we use

RuleOne allow or deny, in one file. A policy is all of an installation's rules together.
PackA starting set of rules, vocabulary and sample records for one industry or use.
VocabularyThe attributes and actions your rules may name, with their types and allowed values.
DirectoryCaroline's own store of people, agents and records: what the engine looks an id up in.
EngineOPA, running the one evaluator over your rules. Called the PDP in the standard.
GatewayWhatever asks Caroline and enforces the answer. Called the PEP in the standard.
BindingWhat one gateway may ask about: which agents, which actions, which kinds of record.
Shadow ruleA rule that runs and is measured but does not decide, until you switch it on.
LedgerThe retained, hash-chained record of every decision and every change.
AuthorA person signed in to change rules, keys or records. A viewer can look, not change.
Caroline DocsAuthZEN 1.0 · OPA