Governance Policies

This guide explains how governance policies work, how to author them, and the syntax for rules and conditions. You will learn the difference between deploy-time and runtime enforcement, how to scope a policy, and how to require approval before a deployment proceeds.

Two Enforcement Points

Governance is enforced in two different places. Choosing the wrong one is the most common mistake.

Deploy-time gateRuntime / event-time
Governsthe change — promoting or deploying a data product or workflowthe data flowing through a product
Good forapproval and sign-off, classification and compliance, contract breaking-change review, release freezesdata quality, schema and contract conformance per record, PII handling
Not good fordata quality (you deploy to fix quality — don't block the fix)structural change approvals

Governance policies, described in this guide, are the deploy-time gate. They evaluate a deployment before it goes live and can block it or require approval.

Data quality belongs at runtime — enforce it with quality rules and data contracts, not a deploy policy. Blocking a deployment because quality is low is backwards: the deployment is usually the fix that improves quality.

Where Policies Live

Policies are stored on the platform and managed through Organization → Governance → Policies, the loxtep_define MCP tool, or the SDKs (client.governance.policies in Node and Python):

Operationloxtep_define operationSDK client.governance.policies
Listlist_governance_policies.list(filters)
Getget_governance_policy.get(policy_id)
Createcreate_governance_policy.create(policy)
Updateupdate_governance_policy.update(policy_id, changes)
Deletedelete_governance_policy.delete(policy_id)

For example, list every policy in your organization:

{
  "operation": "list_governance_policies"
}

Policy Schema

A policy is created with these fields:

{
  "name": "Require approval before deploy (Data Council)", // required
  "description": "Domain owner must sign off before any deploy.",
  "type": "data_governance", // categorization only — see below
  "status": "draft", // draft | active | approved | archived
  "is_active": true, // default true
  "requires_approval": true, // optional — turns on the approval gate
  "approval_threshold": 1, // optional — approvals required (default 1)
  "tags": ["compliance"],
  "rules": [
    // required, at least one
    { "condition": "<string>", "action": "deny", "resources": ["data-products"] },
  ],
  "scope": {
    // optional — who/what it applies to
    "domains": ["<domain_id>"],
    "data_products": ["<data_product_id>"],
    "users": ["<user_id>"],
  },
  "metadata": { "enforcement": "block" }, // optional — enforcement mode (see below)
}

type

One of data_governance, security, compliance, privacy, operational, custom, rbac, governance, or data_quality. This is used for categorization and reporting only — it does not change how the gate behaves.

Rules

Each entry in rules describes one check:

{
  "condition": "<non-empty string>", // required — see Condition Syntax
  "action": "deny", // allow | deny | require_approval
  "resources": ["data-products"], // required, at least one
}

The deploy gate acts on deny rules and on the policy-level requires_approval flag. allow rules are informational. A condition must always be a non-empty string — structured conditions are passed as a JSON string, not a JSON object.

Condition Syntax

The condition controls when a deny rule fires. Anything the platform doesn't recognize as a structured condition — an empty value, "{}", or a plain label like "freeze:release-window" — is treated as unconditional: an intentional freeze that blocks every data product in scope.

Intentcondition (a JSON string)Denies when…
Freeze / lock"freeze:release-window" or "{}"always — every data product in scope
Quality score{"metric":"quality_score","operator":"lt","value":95}a product's latest quality score is < 95
Classification{"metric":"classification","operator":"eq","value":"restricted"}a product is classified restricted
PII present{"metric":"pii","operator":"exists"}a product declares any PII fields
PII missing{"metric":"pii","operator":"not_exists"}a product declares no PII fields
  • Quality score operators: lt, lte, gt, gte, eq, neq (value is a number). Products that have never been measured are not treated as violations.
  • Classification operators: eq, neq, in, not_in (value is a string or array of strings; matching is case-insensitive).
  • A structured condition only denies the specific data products that violate it, not the whole deployment.

A quality_score condition is supported, but it is usually the wrong gate. Prefer runtime quality rules and data contracts — see Two Enforcement Points.

Enforcement & Status

metadata.enforcement controls what a finding does:

  • block — findings fail the deployment.
  • warn — findings are non-blocking warnings; the deployment proceeds.
  • audit — same gate behavior as warn (non-blocking); useful for trial runs and reporting.
  • Legacy strict is accepted and stored as block.

A policy is only evaluated when status is active or approved and is_active is true. Policies in draft or archived are inert — useful for staging a policy before enabling it.

To lift an active policy without deleting it, set status to draft/archived, or switch metadata.enforcement to audit.

The Approval Gate

The recommended use of a blocking policy is to require sign-off before a deployment:

{
  "name": "Require approval before deploy (Data Council)",
  "type": "data_governance",
  "status": "active",
  "requires_approval": true,
  "approval_threshold": 1,
  "rules": [
    {
      "condition": "requires-governance-approval",
      "action": "require_approval",
      "resources": ["data-products"],
    },
  ],
  "scope": { "domains": ["<domain_id>"] },
  "metadata": { "enforcement": "block" },
}

With requires_approval: true and enforcement: block, deployments in scope are blocked until the required number of approvals is recorded for the policy.

How the Gate Evaluates

When a workflow or project is deployed, the platform:

  1. Loads the active policies for your organization (status is active/approved and is_active is true).
  2. Checks each policy's scope. Organization-wide policies always apply; a domain-scoped policy applies when the deployment is in that domain; a data-product-scoped policy applies when one of the deployed products matches. A policy with no scope applies organization-wide.
  3. Records findings: block fails the deploy; warn/audit are non-blocking warnings.
  4. Evaluates each deny rule:
    • Unconditional rules record a violation (a freeze).
    • Structured rules load per-product signals (latest quality score, classification, PII fields) and deny only the products that actually violate the condition.
  5. If the policy requires approval and is blocking, records a violation unless the required approvals exist.
  6. Any violation blocks the deployment.

Domains and Inheritance

Scope can target a specific domain. The Data Council domain is your organization's root governance domain — a policy scoped there (or organization-wide) effectively gates everything beneath it. Moving a project into a governed domain subjects it to that domain's policies.

Worked Examples

Release freeze (unconditional):

{
  "name": "Release freeze — Finance close",
  "type": "operational",
  "status": "active",
  "rules": [
    { "condition": "freeze:close-window", "action": "deny", "resources": ["data-products"] },
  ],
  "scope": { "domains": ["<finance_domain_id>"] },
  "metadata": { "enforcement": "block" },
}

Block restricted data products without review:

{
  "name": "Block restricted data products",
  "type": "compliance",
  "status": "active",
  "rules": [
    {
      "condition": "{\"metric\":\"classification\",\"operator\":\"eq\",\"value\":\"restricted\"}",
      "action": "deny",
      "resources": ["data-products"],
    },
  ],
  "scope": { "domains": ["<domain_id>"] },
  "metadata": { "enforcement": "block" },
}

Lifecycle Cheatsheet

  • Create dormant — create with status: "draft": the policy exists but is not enforced.
  • Trial — status: "active" with metadata.enforcement: "audit": violations are logged, nothing is blocked.
  • Enforce — status: "active" with metadata.enforcement: "block".
  • Pause — set status: "draft" (or switch enforcement to audit).
  • Remove — loxtep_define → delete_governance_policy with the policy_id.

Common Gotchas

  • A deny rule with no structured condition denies everything in scope. That is a freeze by design — an empty or "{}" condition will block all deployments in its domain.
  • condition must be a JSON string, not a JSON object, in the policy.
  • Both status and is_active matter — a policy at status: active but is_active: false is not evaluated.
  • Quality at deploy time is an anti-pattern — gate quality at runtime with quality rules and contracts.
  • Scope governs evaluation — a policy's scope determines which deployments it applies to; an unscoped policy applies to the whole organization.