Skip to content
bricksentry

Docs · 03

Policy

Rules in policy.yml decide the verdict. No LLM is involved.

Verdict order

pass < warn < needs_human < block. The worst matching rule wins.

  • All conditions inside one when must hold (AND).
  • For OR, write several rules with the same then.
  • Unknown conditions are rejected when the policy loads, so a typo can't silently pass a change.

Conditions

  • table (glob)
  • tag
  • downstream_tag
  • downstream_kind
  • downstream_count_gt
  • removed_pct_gt
  • added_pct_gt
  • changed_pct_gt
  • row_count_change_pct_gt
  • row_count_drop_pct_gt
  • column_removed
  • column_added
  • column_type_changed
  • duplicate_keys
  • sum_change_pct_gt (optionally with column)
  • null_increase_gt (optionally with column)
  • any_change
  • diff_error

Example

policy.yml
default: pass
notify_owners_on: needs_human
rules:
  - {name: duplicate-keys, when: {duplicate_keys: true}, then: block}
  - {name: certified, when: {downstream_tag: certified}, then: needs_human}
  - {name: revenue-moved, when: {column: amount, sum_change_pct_gt: 2}, then: needs_human}
  - {name: gold-layer, when: {table: "*.gold.*", any_change: true}, then: needs_human}