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 gate | Runtime / event-time | |
|---|---|---|
| Governs | the change — promoting or deploying a data product or workflow | the data flowing through a product |
| Good for | approval and sign-off, classification and compliance, contract breaking-change review, release freezes | data quality, schema and contract conformance per record, PII handling |
| Not good for | data 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):
| Operation | loxtep_define operation | SDK client.governance.policies |
|---|---|---|
| List | list_governance_policies | .list(filters) |
| Get | get_governance_policy | .get(policy_id) |
| Create | create_governance_policy | .create(policy) |
| Update | update_governance_policy | .update(policy_id, changes) |
| Delete | delete_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.
| Intent | condition (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_scorecondition 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 aswarn(non-blocking); useful for trial runs and reporting.- Legacy
strictis accepted and stored asblock.
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:
- Loads the active policies for your organization (
statusisactive/approvedandis_activeistrue). - 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.
- Records findings:
blockfails the deploy;warn/auditare non-blocking warnings. - Evaluates each
denyrule:- 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.
- If the policy requires approval and is blocking, records a violation unless the required approvals exist.
- 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"withmetadata.enforcement: "audit": violations are logged, nothing is blocked. - Enforce —
status: "active"withmetadata.enforcement: "block". - Pause — set
status: "draft"(or switch enforcement toaudit). - Remove —
loxtep_define→delete_governance_policywith thepolicy_id.
Common Gotchas
- A
denyrule 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. conditionmust be a JSON string, not a JSON object, in the policy.- Both
statusandis_activematter — a policy atstatus: activebutis_active: falseis 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.