CarolineDocs

Write the rules / Check before you publish

Check before you publish

Four ways to know what a change will do before it does it: the review every save opens, the tests, who gains and who loses, and shadow mode for running a rule on real traffic without letting it decide.

The review

Review & publish opens a read-only review before anything is saved, whoever or whatever wrote the change:

SectionAnswers
What the policy will sayeach added, removed or changed rule, in words
The scenariosthe pack's own example requests, before and after, the ones that flip first
Requests this platform really answeredthe PDP's recent real requests, replayed against the change
If the shadow rules were promotedwhat turning shadow rules on would change

Commit & publish stays off until the change passes the checks. If someone published since your review, the save is refused (409 stale) rather than quietly undoing their change: review again.

The replay sees the recent past

It replays the PDP's last 100 requests, held in memory. It is a strong signal, not a sample of the year: replaying a period from the ledger is not built.

Tests

The Policy Tester's Tests runs your suites on the published rules and, with unsaved changes, on your working copy beside them.

# policies/tests/stock-reads.yaml, shortened from the AI Agents pack's own
- suite: stock-reads
  owner: supply-operations
  about: Supply agents read stock only through their own gateways.
  given: directory
  examples:
    - name: Supply agent reads Azure stock for Mia
      who: a_supply_agent
      for: u_plan_mia
      does: read
      on: r_stock_azure_prod
      expect: allow
      by: agent-read-stock-on-its-gateways
    - name: Supply agent reads IBM Cloud stock
      who: a_supply_agent
      for: u_plan_mia
      does: read
      on: r_stock_ibm_prod
      expect: no match

A Directory edit that grants access and breaks a test is held until you confirm it, too.

Impact: who gains, who loses

Impact compares your unsaved changes with the published rules, or any saved change with the rules before it, on today's directory. It asks only the requests a changed rule could match, so the answer is exact: these people and agents gain this access, these lose it. History's Who gained, who lost opens it on any past change.

Shadow rules

Set shadow: true on a rule and it runs on every real call but does not decide: each request gets the answer it would get without the rule, and what the rule would have done is recorded beside it.

  1. Deploy in shadowPublish the rule with shadow on.
  2. MeasureOn Decisions, filter Shadow differs: every real call where the rule would have answered differently.
  3. PromoteWhen the differences are the ones you meant, turn shadow off. The review shows what promoting changes first.

Ask a single question

Ask in the Policy Tester asks one question of the published rules, your working copy, or the live engine. Only Live is a real decision on the record; the other two are recorded nowhere. What if changes one attribute for the next questions only.

Caroline DocsAuthZEN 1.0 · OPA