Skip to content

Effective policy computation and provenance

Effective policy is computed by merging everything attached, and the merge is most-restrictive-wins rather than nearest-wins. This page is the exact algorithm, because it is what decides which value a run is actually governed by, and the provenance record that says where each value came from.

The order values are visited in

organization policy
flow policy
reusable capability block policy

Later layers are visited later, and visiting later does not mean winning. A layer contributes a candidate, and the stricter of the candidate and what is already held survives.

How "stricter" is decided, by type

Booleans. A field named allow_* is stricter when false. Every other flag, the enabling and blocking kind, is stricter when true.

Numbers. A field named min, min_* or *_min takes the higher value. A field named max, max* or *_max takes the lower value. Any other number takes the higher value.

Strings. Two fields are ordered, and everything else keeps the value already held:

enforcement     warn < block
recovery_mode   none < human_approval

An unknown string field preserves the baseline rather than being overwritten by a later layer, so an unrecognised value cannot loosen anything by arriving last.

Lists. Values are unioned, preserving the existing order and appending what is new. A list therefore grows across layers rather than being replaced.

Absent values. A layer that says nothing contributes nothing. An absent value yields to a present one in either direction.

Worked, as an example

Field Organization Flow Effective
allow_external_egress true false false, because allow_* is stricter when false
max_retries 5 8 5, because a max field takes the lower value
min_reviewers 1 2 2, because a min field takes the higher value
enforcement warn block block, because block outranks warn
required_evidence_kinds ["attestation"] ["sbom"] ["attestation", "sbom"], because lists union

The values above are an example, not a schema.

Loosening is structurally impossible here

Every direction through this algorithm tightens. A flow cannot raise a cap its tenant set, because a max field takes the lower value regardless of which layer supplied it.

That is why loosening requires a separate artifact rather than a policy edit. See Exemptions.

Provenance records where each value came from

The merge has a provenance variant that records, per value, which layer supplied it and why it won. The result is the same document plus an account of how it was reached.

flowchart LR
  AB[("Collected bundles<br/>from every enclosing level")]
  M{{"Most-restrictive merge"}}
  subgraph EP["EFFECTIVE POLICY"]
    direction TB
    SN[("Snapshot")]
    DG["Digest over the snapshot"]
    PV[("Provenance<br/>per value: source level, reason")]
  end
  AS["Assignment<br/>snapshot and digest"]
  AB --> M --> EP
  SN --> AS
  DG --> AS

The merge produces one box with three parts. Two of them travel on the assignment, and provenance stays in the control plane, where an unexpected value is diagnosed field by field.

Provenance is what an unexpected effective value is diagnosed from. The question is never "which bundle is this from" in the abstract; it is answered per field.

The snapshot and its digest travel together

The effective snapshot is digested, and the digest travels on the assignment alongside the snapshot itself. A node verifies that the digest matches before acting, so it cannot be handed a snapshot the control plane did not compute.

Every policy decision then records the bundle, the version and the attachment level that contributed the rule. See Assignment authoring.