Data contracts: startup guide
How to add a data contract to FiduLock and how to configure it, from first draft to ACTIVE.
1. What a contract is
A data contract is the written terms a data product is delivered under, in the Open Data Contract Standard (ODCS, version 3.2). It holds the schema, the quality rules, the service levels (SLAs), the Statement of Intent (SoI) it serves, and regulatory tags. It has three layers of definition:
- Plain-language description (purpose, usage, limitations). This is the only layer an Agent reads. It is scored for clarity.
- Technical contract: schema, quality rules, SLAs.
- Regulatory annex: the legal wording, never shown to an Agent.
A contract starts as a DRAFT. It serves nothing until it is ACTIVE. A live contract that changes in a breaking way never overwrites itself; it forks a new DRAFT.
2. Before you start
- A role. To create or activate a contract you need
DATA_STEWARD,GOVERNANCE_LEAD,ODCS-AuthororSUPER_ADMINISTRATOR. Only the first, second and last may add a SQL quality rule. - A registered data product. You need its ID. Register it in the Data Catalog first and describe its fields.
- A named Business Owner on the product, by user ID. With
CONTRACT_OWNER_CHECKatenforce, activation is refused without one. - A Statement of Intent for the purpose the contract serves. It must be ACTIVE and signed by the Business Owner before the entry gate passes.
- Know your sensitivity. If any field is CONFIDENTIAL or RESTRICTED you must declare how it is masked (section 6).
3. Add a contract in the UI

- Open Contracts and choose New Contract. A live ODCS JSON preview on the right updates as you type.
- Basic information. Contract name (lowercase, hyphen-separated), version (semantic, start at
1.0.0), producer team, consumer team (they cannot be the same team), and the Data Product ID. - Schema fields. Pick the data product and choose Populate Data Elements to copy its fields, or add them one by one with a type and whether each is required.
- Quality rules. Add the checks to run on the real data (see section 5).
- Service level agreements. Add the promises and what happens on breach.
- Statement of Intent. Link the purpose the contract serves.
- Compliance and regulatory tags. For example
GDPRorEU_AI_ACT. - Choose Create Contract. You get a DRAFT.

4. Add a contract through the API
The UI calls the same endpoint. Send POST /contracts to contract-engine (port 8005; through the API gateway on port 8000 in a full stack) with your identity headers or token.
{
"data_product_id": "<product uuid>",
"contract_name": "northwind-orders",
"version": "1.0.0",
"producer": "sales-engineering",
"consumer": "finance-analytics",
"schema_name": "orders",
"schema_definition": {
"type": "object",
"properties": {
"order_id": { "type": "string" },
"customer_id": { "type": "string" },
"amount": { "type": "number" }
},
"required": ["order_id"]
},
"quality_rules": [
{ "field": "order_id", "rule_type": "completeness", "min_population_pct": 99 },
{ "field": "amount", "rule_type": "range", "min_threshold": 0 }
],
"slas": [
{ "metric": "freshness_hours", "threshold": 24, "breach_action": "alert" }
],
"regulatory_tags": ["GDPR"],
"description": {
"purpose": "Shows every customer order so finance can report monthly revenue."
}
}
The response is the DRAFT, with its id. Keep it for the next steps.
5. Import an ODCS file
If you already have an ODCS v3.2 YAML or JSON file:
POST /contracts/odcs/validatechecks it against the official schema and reports problems without saving.POST /contracts/odcs/importcreates a DRAFT from it. A draft may be imported without runnable rules.
tdk, trustBadge, blastRadius and passportHash with a warning. The platform computes these itself; do not try to set them in the file.Library checks such as missingValues and invalidValues that must be 0 import as runnable rules.
6. Configure the contract
Quality rules
| Rule type | Use it to | Key settings |
|---|---|---|
completeness | Require a field to be filled in. | min_population_pct (your own line, 0 to 100); when makes it conditional ({field, op: equals|in|not_null, value}). |
range | Bound a number. | min_threshold, threshold (maximum). |
regex | Match a pattern. | pattern. |
in_list | Allow only listed values. | allowed_values. |
no_placeholder | Reject test data such as 999-99-9999, test@email.com, n/a. | denied_values adds your own. |
tolerance | Keep a value within a percentage of another column. | reference_field, tolerance_pct. |
sql | One read-only SELECT returning one number. | operator, expected, severity (warn or error), business_impact. Checked when written: single SELECT, no writes, at most 2000 characters. Runs read-only with a 5 second timeout. Steward, Governance Lead or Super Administrator only. |
Mark a column that matters most with criticalDataElement. The platform then watches its mean and raises a drift alert or an anomaly when it moves.
Service levels (SLAs)
Every ACTIVE contract's SLAs are checked every 15 minutes. Each SLA has a metric, a threshold and a breach_action of alert, revoke or quarantine.
| Metric | Threshold means |
|---|---|
freshness_hours | The oldest the data may be. |
completeness_pct, accuracy_pct | The lowest acceptable pass rate. |
validity_pct | The data-quality floor: the weakest checkable rule. |
volume_variance_pct | Largest allowed % gap to a source table named in element (same PostgreSQL database). |
volume_history_pct | Largest allowed % gap from the median of the last 30 snapshots. |
arrival_minutes | The most minutes between deliveries. Producers must call POST /monitor/{id}/heartbeat on data-product-monitor. |
availability_pct | Share of governed reads over 30 days that the platform answered. |
revoke and quarantine SUSPEND the contract, and every child contract with it, until the SLAs hold again. Start with alert and tighten later.GET /contracts/{id}/sla-coverage lists the freshness, volume and validity promises your contract is missing.
Masking for sensitive fields
Any property classified confidential or restricted must declare an obfuscationMethod, or activation is refused with 422 obfuscation-method-missing.
| obfuscationMethod | Result |
|---|---|
one_way_hash | HASH |
partial_redact | PARTIAL |
dynamic_masking | FULL, unless maskingByIntent loosens it for a stated purpose, e.g. { "FRAUD_REVIEW": "PARTIAL" }. Only PARTIAL, HASH and FULL are allowed, never the raw value. |
A contract can only add masking. It can never loosen what the data catalog already masks.
Governance settings
| Field | What it does |
|---|---|
hitl_floor | Optional trust-score line (above 0, up to 100). It can only raise the platform floor. Below it, an Agent's request goes to a human. |
data_class | REGULATED, OPERATIONAL or EXPLORATORY. |
step_floors | Trust needed per action step (recommend, draft, approve, execute, transfer). Never falls as the step gets riskier. |
environment | Including NON_PRODUCTION, which serves no unmasked confidential data when NON_PROD_MASKING is enforced. |
lineage_upstream | Upstream products and the logic that feeds this one. Written once when the contract goes live. |
row_filters, join_keys, write_scope | What rows may be read, how products join, and what an Agent may write. |
description | Plain-language purpose, usage, limitations. Keep sentences short and say only what is true of the contract. |
7. Policy blocks
Blocks live in odcs_extras (or as an ODCS custom property of the same name). CONTRACT_BLOCKS_CHECK is shadow by default: a faulty block is logged and the contract still activates. At enforce, activation is refused with 422 contract-blocks-invalid.
"odcs_extras": {
"columnMasking": [
{ "column": "email", "mode": "PARTIAL", "exceptionRoles": ["DATA_STEWARD"] }
],
"maxRecordAge": { "field": "created_at", "hours": 720 },
"serviceTier": "GOLD",
"schemaEvolution": { "allowed": "MINOR" },
"consentFilter": { "column": "ai_consent", "permittedValues": ["YES"] }
}
Check the exact shape of each block in GET /contracts/{id}/declarations after saving. The full list (columnMasking, maxRecordAge, serviceTier, utilityThreshold, thresholdOverrides, schemaEvolution, entityIdMapping, failurePosture, relaxedGates, consentFilter, destinationZone) is in the user manual, Volume 3 chapter 9.
Declarations checked before activation
| Setting | Checks | Refusal at enforce |
|---|---|---|
CONTRACT_GLOSSARY_CHECK | REGULATED contracts: every field maps to an approved glossary term. | 422 contract-glossary-unmapped |
CONTRACT_STANDARD_TYPES | Date, time, currency and country fields declare a standard type or format. | 422 contract-standard-type-missing |
CONTRACT_SCHEMA_CONFORMANCE | Schema matches the approved schema of the same name. | 409 schema-differs-from-approved |
CONTRACT_TEXT_GATE | The contract's own descriptions pass the plain-language check (Impact Class C or D by default). | 422 contract-text-unclear |
Each is shadow (log only) by default, enforce to refuse, off to skip. Start in shadow, read the logs, then enforce.
8. Activate
- Check what is missing.
GET /contracts/{id}/declarationsandGET /contracts/{id}/sla-coverage.GET /contracts/{id}/text-checkpreviews the clarity score. - Activate:
POST /contracts/{id}/activate(or the Activate button). Roles: Data Steward, Governance Lead, ODCS Author, Super Administrator. - If this replaces an earlier version, the old one is superseded and starts a 30 to 90 day countdown set by the product's strictest Impact Class.
EU_AI_ACT contract needs a competent person's oversight sign-off (POST /contracts/{id}/oversight-signoff) when CONTRACT_OVERSIGHT_CHECK is enforced, and a contract with the tag must carry a complete regulatory_compliance block.9. After activation

- Run the entry gate on the product (Gate tab, Run Gate Check). It runs about fourteen checks and names every failing step in one run.
- Build and score the product, so it earns a trust badge.
- Read the summary card:
GET /contracts/{id}/summary-cardshows purpose, owners, risk, trust floor, SLAs and consumers on one page. - Export:
GET /contracts/{id}/odcsreturns the contract as ODCS. - Change it safely. Use
POST /contracts/{id}/change-previewfirst. A PATCH (an adjustment) applies in place; a MINOR (an addition) bumps the version and reaches child contracts; a MAJOR (dropped or renamed column, changed type) forks a DRAFT 2.0.0 and waits for every affected Business Owner to acknowledge it. - Children. Another team can create a child contract (
POST /contracts/{id}/children) that inherits yours and may only tighten SLAs and floors. - Pausing SLAs for planned work needs a Governance Lead, Ops administrator or Super Administrator:
POST /contracts/{id}/sla-suspensions, at most 24 hours with a written reason.



10. Troubleshooting
| You see | Why | Do this |
|---|---|---|
| 403 on create or activate | Your role is not allowed. | Ask for a Data Steward, Governance Lead or ODCS Author role. |
422 obfuscation-method-missing | A confidential or restricted field has no masking method. | Add obfuscationMethod to that property. |
422 contract-owner-missing | The product has no Business Owner by user ID. | Set the owners on the product, then activate again. |
422 contract-text-unclear | The description fails the clarity check. | Shorten sentences, define acronyms, name only real columns. Check with text-check. |
422 contract-blocks-invalid | A policy block is malformed (enforce only). | Read the list in /declarations. |
409 change-not-acknowledged | A breaking version waits for owners. | Ask each affected Business Owner to acknowledge it. |
409 schema-differs-from-approved | Your schema differs from the approved one of that name. | Propose a new schema version in the glossary and have a second person approve it. |
Reads refused with CONTRACT_SUSPENDED | An SLA breach (revoke or quarantine) or a person suspended it. | Fix the cause. The 15-minute sweep resumes platform-suspended contracts; or resume it with POST /contracts/{id}/resume. |
| Gate fails on freshness | The contract promises freshness but nothing measures it. | Run the content monitor on the product. |

FiduLock