Governance rules
The four types
| TYPE | CHECKS | TAKES A SCOPE |
|---|---|---|
| required_tag | A tag key is present on the targeted surfaces, and optionally that its value is acceptable. | Yes |
| naming_convention | Resource names match a pattern, and optionally a maximum length. | Yes |
| required_compute_policy | Every cluster references a Databricks compute policy rather than an ad-hoc configuration. | No |
| serverless_usage_policy_required | Serverless workloads reference a usage policy, for organizations that group serverless spend by domain or cost centre. | No |
job_clusters wholesale, so the guard checks what is actually being deployed rather than the base declaration.Scopes
A scope names where the rule looks. Five surfaces, and one result is produced per scoped surface — a rule with scope: [job, warehouse] produces two results.
| SCOPE | READS | TAG FIELD |
|---|---|---|
| job | Each job's own tags | tags |
| pipeline | Each pipeline's own tags | tags |
| warehouse | Each warehouse's tags | tags |
| job_cluster | Every cluster of every job — shared and inline | custom_tags |
| pipeline_cluster | Every cluster of every pipeline | custom_tags |
job proves nothing about the infrastructure spend that job generates — for cost attribution the scope has to be job_cluster or pipeline_cluster.required_tag
The most-used type. A missing key is always a violation, in every enforcement mode.
| FIELD | REQUIRED | MEANING |
|---|---|---|
| key | yes | The tag key that must be present. |
| scope | yes | Which surfaces to check. |
| enforcement | no | How the value is constrained. Defaults to unlimited. |
| value | fixed only | The exact value required. |
| allowed_values | allowlist only | The accepted values. |
| blocked_values | blocklist only | The rejected values. |
| pattern | regex only | A pattern the whole value must match. Validated when the rule is saved. |
Only the companion field for the chosen mode may be set. Supplying allowed_values on a fixed rule is a validation error rather than a silently ignored field.
The five enforcement modes
| MODE | PASSES WHEN THE VALUE… |
|---|---|
| unlimited | exists at all, whatever it is |
| fixed | equals value exactly |
| allowlist | is one of allowed_values |
| blocklist | is not one of blocked_values |
| regex | matches pattern in full |
Examples
- name: Owner tag
type: required_tag
action: warn
key: owner
scope: [job, pipeline, warehouse]
enforcement: unlimited- name: Team tag on compute
type: required_tag
action: block
key: team
scope: [job_cluster, pipeline_cluster]
enforcement: allowlist
allowed_values: [data-engineering, ml, platform, analytics]- name: Cost centre format
type: required_tag
action: block
key: cost_center
scope: [job_cluster, pipeline_cluster]
enforcement: regex
pattern: "^CC-[0-9]{4}$"- name: No prod warehouses
type: required_tag
action: warn
key: environment
scope: [warehouse]
enforcement: blocklist
blocked_values: [prod, production]naming_convention
Resource names must match a pattern in full, and optionally stay within a maximum length. The pattern is validated when the rule is saved, so an invalid regex is a configuration error rather than a run-time surprise in somebody's pipeline.
- name: Resource naming
type: naming_convention
action: warn
scope: [job, pipeline, warehouse]
pattern: "^(dev|staging|prod)-[a-z0-9-]+$"
max_length: 128Naming is a cost rule in disguise. A resource nobody can attribute is a resource nobody turns off, and the fastest way to make a workspace unattributable is to let every team name things its own way.
required_compute_policy
Checks that every compute cluster references a Databricks compute policy — job shared clusters, per-task inline clusters and pipeline clusters. Takes no fields beyond a name and a severity, and covers all compute surfaces automatically.
- name: Compute policy required
type: required_compute_policy
action: blockClusters that have a policy are listed in the audit output; clusters without one are reported as violations. This is the rule that stops instance-type sprawl at the source rather than reporting it afterwards.
serverless_usage_policy_required
Requires every serverless job and pipeline to reference a usage policy. Usage policies stamp their tags onto every billing record of the workloads that use them, which is how an organization groups serverless spend by its own dimensions: domain, execution mode, cost centre.
- name: Serverless usage policy
type: serverless_usage_policy_required
action: blockIt is not needed to attribute cost to a data product. That comes from the identity tag on the job or pipeline itself; see Actual cost. This rule is optional, and no organization receives it by default.
Reading the results
Rule Scope Result Resources
Team tag on compute job_cluster PASS 3 checked
Team tag on compute pipeline_cluster FAIL customer_scd/default
Resource naming job WARN daily-ingest-v2
Compute policy required — PASS 5 checkedPASS— every resource in that scope satisfied the rule.WARN— violated, but the rule's action iswarn. The build passes.FAIL— violated withaction: block.finowl guardexits1.
Every result names the resources that produced it, so a failure points at a file rather than at a policy.
Rolling out a rule
Governance rules touch every resource in every bundle, which makes them the easiest kind to introduce badly. A tag rule created as block on a Friday fails every pipeline in the organization on Monday.
- Create it as
warn, targeted at every environment. - Read a fortnight of runs. The violations tell you how much remediation the rule implies.
- Fix the bundles, then promote to
block— production first if the remediation is large.