Arquitectura de Datos

Data Mesh: Federated Computational Governance, How to Combine Autonomy and Data Governance Through Automated Policies

Learn how to design and implement a federated computational governance model in Data Mesh, combining cross-domain global standards with automated declarative policies enforced by the data platform.

Content explored 0%
18px

The indicator keeps the furthest percentage explored; marking the article complete is your choice.

Three weeks after launching the self-serve data platform at CommerceFlow, the time required to publish a new data product dropped from weeks to under an hour. The Sales, Payments, and Inventory teams began deploying their own analytical datasets using standardized templates. However, during a quarterly security and compliance review, three simultaneous incidents surfaced and triggered immediate concern across engineering leadership.

First, a developer in the Payments domain added the customer_billing_email field to an analytical settlements table to facilitate a one-off support lookup, exposing personally identifiable information (PII) to any analyst with general catalog access. Second, the Inventory team published a stockout view without specifying which team owned its maintenance, what three abbreviated columns meant, or what retention policy applied. Third, at the opposite extreme, when the Finance team requested read-only access to aggregated bank fee metrics, their request sat blocked for eleven business days waiting for manual sign-off from a central security committee that met biweekly to review spreadsheets.

This scenario captures the core tension of any distributed data architecture: if security, privacy, and quality depend on centralized manual reviews, the organization rebuilds the very bottleneck it sought to eliminate; yet if every domain publishes data under its own ad-hoc criteria without shared rules, autonomy rapidly degenerates into fragmentation, privacy breaches, and eroded trust.

The fourth principle of Data Mesh, Federated Computational Governance, introduced by Zhamak Dehghani in Data Mesh: Delivering Data-Driven Value at Scale, resolves this tension by combining two complementary mechanisms: a federated decision-making model, where domain representatives and cross-cutting specialists agree on a minimal set of global rules, and computational execution, where the self-serve data platform automatically verifies and enforces those rules that can be expressed as code.


Centralized, Uncoordinated Decentralized, and Federated Governance

To understand what federated computational governance brings to the table, it helps to contrast it with the two most common failure modes in data organizations.

1. Traditional Centralized Governance (Manual bottleneck)
[Domains: Sales / Payments / Inventory]
           │ (Manual tickets and approval queues)
           ▼
[Central Governance / Security Committee] ──► Case-by-case manual review

2. Uncoordinated Decentralization (Fragmentation and risk)
[Sales: Rules A]      [Payments: Rules B]      [Inventory: No rules]
       │                       │                         │
       ▼                       ▼                         ▼
 (Incompatible privacy criteria, missing docs, and inconsistent access)

3. Federated Computational Governance (Platform-aligned autonomy)
[Federated Forum: Domain Product Owners + Platform + Security/Legal]
           │ Defines minimal risk-proportional global policies
           ▼
[Policy Engine in the Self-Serve Data Platform (CI/CD + Runtime)]
           │ Automatically validates and enforces controls
           ▼
[Sales Data Products]   [Payments Data Products]   [Inventory Data Products]

The diagram above illustrates how authority and enforcement flow across the three models:

DimensionTraditional Centralized GovernanceUncoordinated DecentralizationFederated Computational Governance
Who defines the rulesA central team isolated from daily domain operations.Each domain independently decides which controls to apply.A federated group composed of domain representatives, platform engineers, and security/compliance specialists.
How controls are enforcedManual reviews, document checklists, and ticket approvals.Disparate or nonexistent controls depending on each team's maturity.Automated validations in the publication pipeline and declarative access controls at runtime.
Impact on delivery speedSlow: every schema change or access request requires central human intervention.Fast to publish initially, but very slow to integrate or audit data across domains.Fast for any change that meets standard policies; only exceptions require human review.
Primary riskBureaucracy, shadow data pipelines built to bypass controls, and lack of business context.Exposure of sensitive data, incomplete metadata, and incompatible contracts.Over-specifying global rules if the federation turns into a bureaucratic committee.

What "Federated" Actually Means in Data Mesh

A frequent misconception is interpreting federated governance as "every team freely invents its own security and quality rules." An equally damaging misconception is believing that federation requires a parliamentary committee meeting for hours every week to vote on every column change across the company.

In a well-designed Data Mesh architecture, the federation operates through clear tiers of accountability:

  1. Minimal global standards (agreed upon in the federation): Rules governing corporate security, regulatory compliance (such as GDPR, CCPA, or financial regulations), sensitivity classification, minimum catalog metadata structure, and the baseline authorization model. No domain may unilaterally disable these rules.
  2. Local domain decisions (team autonomy): The refresh frequency of a data product, the semantic design of its internal entities, the domain-specific business logic used to compute a metric (for example, how Sales classifies a promotional order), or which additional internal quality tests a team runs prior to publishing.

What Makes Governance "Computational": From Written Policy to Verified Control

One of the most dangerous mistakes when adopting Policy as Code is confusing the existence of a YAML file or a policy document with an actual security control. To avoid a false sense of compliance, we must clearly distinguish three separate layers:

  1. Documented policy (organizational agreement): The formal definition of a rule and its business or legal rationale. For example: "No data product with general classification may expose personally identifiable information (PII) without prior masking or tokenization." This policy is essential because it establishes intent and accountability, but by itself it does not stop any deployment.
  2. Automatable policy (machine-evaluatable specification): The translation of a verifiable portion of the documented policy into a formal rule (in YAML, JSON Schema, Open Policy Agent Rego, or Python) capable of inspecting a manifest, schema, or infrastructure plan and returning a deterministic decision (pass or fail). Not every organizational policy is 100% automatable: a syntax validator cannot know on its own whether a column named reference_code actually contains mislabeled national ID numbers without relying on prior classification or data sampling.
  3. Implemented and verified control (effective enforcement and traceability): The technical mechanism that actively blocks an unauthorized action in the CI/CD pipeline or in the storage and query engine (for instance, a permissions policy in AWS Lake Formation or AWS IAM), paired with automated tests and audit logs proving that the control is active and has not been bypassed.

Preventive Controls, Detective Controls, and Exception Management

Within computational execution, the platform combines two categories of controls:

  • Preventive controls (pre-publish gates): Executed before a data product reaches production or before an access grant takes effect. If an Inventory manifest lacks an owner or declares a column with restricted_pii classification in a standard analytical access port without protection, the pipeline rejects the deployment with an actionable diagnostic message.
  • Detective controls (runtime monitoring & auditing): Executed continuously across already published products. They verify, for example, whether promised freshness metrics hold in production, whether orphaned permissions exist, or whether statistical sampling detects email or credit card patterns inside columns classified as public_internal.

Furthermore, no real-world policy system survives without an explicit mechanism for justified exceptions. If the fraud prevention team temporarily needs access to a pseudonymized identifier from Payments to investigate an incident, the solution is neither disabling the global validator nor emailing a CSV file, but recording a time-bounded exception (with a mandatory expiration timestamp, business justification, security approver, and full audit log traceability).


Responsibilities in the Federated Governance Model

Building upon the domain ownership and platform engineering roles established in previous installments, the following matrix defines who owns each responsibility across the governance lifecycle at CommerceFlow:

Governance ActivityData Product Owner (Domain)Domain Engineering TeamSelf-Serve Data Platform TeamSecurity / Governance Specialists
Define global security and privacy policiesParticipates and validates operational feasibility for their domain.Provides technical context regarding schema impact.Evaluates which parts of the policy can be automated in the platform.Leads regulatory definition and risk thresholds.
Classify columns and document each Data ProductAccountable for the accuracy of classification and semantics.Declares metadata and rules in the repository manifest.Provides the declarative schema and validation tooling.Audits via sampling and advises on ambiguous cases.
Implement validators (Policy as Code) and automationConsumes validation reports.Runs validations locally before opening a Pull Request.Builds and maintains CI/CD validators and provisioning modules.Reviews validator logic to ensure it faithfully reflects the policy.
Approve data access or exceptionsApproves or rejects functional usage of their domain's data.Does not manually manage permissions in the cloud console.Automates IAM / Lake Formation grants after declarative approval.Approves access to restricted_pii data and time-bounded exceptions.

End-to-End Walkthrough: Automated Governance at CommerceFlow

Let's examine how to turn CommerceFlow's rules into concrete controls across the Sales, Payments, and Inventory domains.

Step 1: Declarative Definition of Global Policies

The federated forum at CommerceFlow agrees on a global standard (commerceflow-global-governance-v1) that every data product must satisfy before being published to the corporate catalog:

  1. Ownership identification: Every product must include an owning team email (owner_email), an on-call or support channel (oncall_channel), and belong to a registered domain (sales, payments, inventory).
  2. Sensitivity classification: Both the product and every column in its schema must declare a valid classification (public_internal, confidential, restricted_pii).
  3. Sensitive data protection: Output ports of type analytical_sql may not expose columns classified as restricted_pii unless they declare an approved protection transformation (sha256_salted_token or redacted_mask).
  4. Minimum documentation and quality: Every column must include a functional description of at least 15 characters, and the product must declare both a freshness threshold (max_staleness_minutes) and a completeness check on its primary key.

Below is the declarative governance-policies.yaml file maintained in the platform's policy repository:

# File: governance-policies.yaml
# Purpose: Declarative specification of CommerceFlow's global governance rules.
# Note: This file defines the parameters enforced by the validation engine in CI/CD.
policy_suite: "commerceflow-global-governance"
version: "1.2.0"

allowed_domains:
  - "sales"
  - "payments"
  - "inventory"

allowed_classifications:
  - "public_internal"
  - "confidential"
  - "restricted_pii"

rules:
  ownership:
    require_owner_email_suffix: "@commerceflow.internal"
    require_oncall_channel_prefix: "#"

  documentation:
    min_product_description_length: 30
    min_column_description_length: 15

  privacy_and_security:
    forbid_raw_pii_in_port_types:
      - "analytical_sql"
    allowed_pii_protection_strategies:
      - "sha256_salted_token"
      - "redacted_mask"
    require_explicit_consumer_principals: true
    forbid_wildcard_principals: true

  quality_baseline:
    max_allowed_staleness_minutes: 1440
    require_primary_key_not_null_check: true

Step 2: Declaring a Data Product Manifest in Payments

When the Payments team prepares the publication of its payments.settlements_reconciled data product, it includes data-product-manifest.yaml in its repository. Notice how the team declares column-level classifications and applies tokenization to the billing email following the audit finding:

# File: data-product-manifest.yaml
# Domain: Payments | Product: settlements_reconciled
product_id: "payments.settlements_reconciled"
domain: "payments"
version: "2.1.0"
description: "Reconciled bank settlements per payment order with fee status and currency."

ownership:
  team: "payments-core-team"
  owner_email: "payments-data-owners@commerceflow.internal"
  oncall_channel: "#payments-data-alerts"

classification: "confidential"

output_port:
  port_name: "settlements_reconciled_iceberg"
  port_type: "analytical_sql"
  storage_engine: "aws_glue_iceberg"
  schema:
    - name: "settlement_id"
      data_type: "string"
      primary_key: true
      classification: "public_internal"
      description: "Immutable unique identifier of the reconciled bank settlement."
    - name: "order_id"
      data_type: "string"
      primary_key: false
      classification: "public_internal"
      description: "Identifier of the Sales order associated with the transaction."
    - name: "net_settled_amount_cents"
      data_type: "bigint"
      primary_key: false
      classification: "confidential"
      description: "Net settled amount in cents after deducting payment gateway fees."
    - name: "customer_billing_token"
      data_type: "string"
      primary_key: false
      classification: "restricted_pii"
      pii_protection_strategy: "sha256_salted_token"
      description: "Irreversible salted SHA-256 token of the billing email for fraud joins."

quality_guarantees:
  max_staleness_minutes: 60
  primary_key_not_null_check: true

access_control:
  authorized_consumers:
    - consumer_domain: "finance"
      iam_role_arn: "arn:aws:iam::111122223333:role/cf-finance-reporting-reader"
      allowed_classifications:
        - "public_internal"
        - "confidential"
    - consumer_domain: "fraud_analytics"
      iam_role_arn: "arn:aws:iam::111122223333:role/cf-fraud-analytics-reader"
      allowed_classifications:
        - "public_internal"
        - "confidential"
        - "restricted_pii"
      exception_reference:
        exception_id: "EXC-2026-042"
        approved_by: "security-governance@commerceflow.internal"
        expires_at: "2026-12-31T23:59:59Z"
        reason: "Chargeback recidivism linkage using salted billing token."

Step 3: Automated Python Policy Validator (Preventive Control in CI/CD)

So that the rules in governance-policies.yaml do not remain passive text, the platform team embeds an executable validator into the publication pipeline. The following Python script is self-contained (relying solely on the Python 3.10+ standard library so you can run it without external dependencies) and verifies the manifest before allowing any catalog update or cloud permission change:

# File: validate_governance_policy.py
# Purpose: Deterministically evaluate whether a Data Product manifest complies
# with global governance policies prior to platform deployment.

from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Any


@dataclass(frozen=True)
class PolicyViolation:
    rule_id: str
    field_path: str
    message: str


def validate_data_product_manifest(
    manifest: dict[str, Any],
    policy: dict[str, Any],
    evaluation_time: datetime,
) -> list[PolicyViolation]:
    violations: list[PolicyViolation] = []
    rules = policy["rules"]

    # 1. Registered domain and ownership validation
    domain = manifest.get("domain", "")
    if domain not in policy["allowed_domains"]:
        violations.append(
            PolicyViolation(
                rule_id="GOV-OWN-001",
                field_path="domain",
                message=f"Unrecognized domain '{domain}'. Allowed: {policy['allowed_domains']}.",
            )
        )

    ownership = manifest.get("ownership", {})
    owner_email = ownership.get("owner_email", "")
    required_suffix = rules["ownership"]["require_owner_email_suffix"]
    if not owner_email.endswith(required_suffix):
        violations.append(
            PolicyViolation(
                rule_id="GOV-OWN-002",
                field_path="ownership.owner_email",
                message=f"Owner email must end with '{required_suffix}'.",
            )
        )

    oncall = ownership.get("oncall_channel", "")
    required_prefix = rules["ownership"]["require_oncall_channel_prefix"]
    if not oncall.startswith(required_prefix) or len(oncall) < 4:
        violations.append(
            PolicyViolation(
                rule_id="GOV-OWN-003",
                field_path="ownership.oncall_channel",
                message="A valid alert channel starting with '#' must be specified.",
            )
        )

    # 2. Product documentation and classification validation
    description = manifest.get("description", "").strip()
    min_desc_len = rules["documentation"]["min_product_description_length"]
    if len(description) < min_desc_len:
        violations.append(
            PolicyViolation(
                rule_id="GOV-DOC-001",
                field_path="description",
                message=f"Product description must be at least {min_desc_len} characters long.",
            )
        )

    prod_classification = manifest.get("classification", "")
    if prod_classification not in policy["allowed_classifications"]:
        violations.append(
            PolicyViolation(
                rule_id="GOV-SEC-001",
                field_path="classification",
                message=f"Invalid product classification '{prod_classification}'.",
            )
        )

    # 3. Column validation: documentation and mandatory PII protection
    port = manifest.get("output_port", {})
    port_type = port.get("port_type", "")
    schema_columns = port.get("schema", [])
    has_primary_key = False

    for idx, col in enumerate(schema_columns):
        col_name = col.get("name", f"column_{idx}")
        col_path = f"output_port.schema[{col_name}]"

        if col.get("primary_key") is True:
            has_primary_key = True

        col_desc = col.get("description", "").strip()
        min_col_len = rules["documentation"]["min_column_description_length"]
        if len(col_desc) < min_col_len:
            violations.append(
                PolicyViolation(
                    rule_id="GOV-DOC-002",
                    field_path=f"{col_path}.description",
                    message=f"Column '{col_name}' requires a description of at least {min_col_len} characters.",
                )
            )

        col_class = col.get("classification", "")
        if col_class not in policy["allowed_classifications"]:
            violations.append(
                PolicyViolation(
                    rule_id="GOV-SEC-002",
                    field_path=f"{col_path}.classification",
                    message=f"Column '{col_name}' has an invalid classification: '{col_class}'.",
                )
            )

        if (
            col_class == "restricted_pii"
            and port_type in rules["privacy_and_security"]["forbid_raw_pii_in_port_types"]
        ):
            strategy = col.get("pii_protection_strategy")
            allowed_strategies = rules["privacy_and_security"]["allowed_pii_protection_strategies"]
            if strategy not in allowed_strategies:
                violations.append(
                    PolicyViolation(
                        rule_id="GOV-PRIV-001",
                        field_path=f"{col_path}.pii_protection_strategy",
                        message=(
                            f"Column '{col_name}' is classified as 'restricted_pii' in port "
                            f"'{port_type}' and must declare a strategy in {allowed_strategies}."
                        ),
                    )
                )

    # 4. Quality baseline validation
    quality = manifest.get("quality_guarantees", {})
    staleness = quality.get("max_staleness_minutes")
    max_allowed_staleness = rules["quality_baseline"]["max_allowed_staleness_minutes"]
    if not isinstance(staleness, int) or staleness <= 0 or staleness > max_allowed_staleness:
        violations.append(
            PolicyViolation(
                rule_id="GOV-QUAL-001",
                field_path="quality_guarantees.max_staleness_minutes",
                message=f"A valid max_staleness_minutes between 1 and {max_allowed_staleness} is required.",
            )
        )

    if rules["quality_baseline"]["require_primary_key_not_null_check"]:
        if not has_primary_key or quality.get("primary_key_not_null_check") is not True:
            violations.append(
                PolicyViolation(
                    rule_id="GOV-QUAL-002",
                    field_path="quality_guarantees.primary_key_not_null_check",
                    message="Schema must define a primary key and enable primary_key_not_null_check.",
                )
            )

    # 5. Access control and exception expiration validation
    consumers = manifest.get("access_control", {}).get("authorized_consumers", [])
    for idx, consumer in enumerate(consumers):
        c_path = f"access_control.authorized_consumers[{idx}]"
        role_arn = consumer.get("iam_role_arn", "")
        if "*" in role_arn or not role_arn.startswith("arn:aws:iam::"):
            violations.append(
                PolicyViolation(
                    rule_id="GOV-ACC-001",
                    field_path=f"{c_path}.iam_role_arn",
                    message="Wildcards ('*') are forbidden; an explicit IAM role ARN is required.",
                )
            )

        allowed_classes = consumer.get("allowed_classifications", [])
        if "restricted_pii" in allowed_classes:
            exc = consumer.get("exception_reference")
            if not exc or not exc.get("exception_id") or not exc.get("expires_at"):
                violations.append(
                    PolicyViolation(
                        rule_id="GOV-ACC-002",
                        field_path=f"{c_path}.exception_reference",
                        message="Access to 'restricted_pii' requires an approved exception with an expiration date.",
                    )
                )
            else:
                expires_at = datetime.fromisoformat(exc["expires_at"].replace("Z", "+00:00"))
                if expires_at <= evaluation_time:
                    violations.append(
                        PolicyViolation(
                            rule_id="GOV-ACC-003",
                            field_path=f"{c_path}.exception_reference.expires_at",
                            message=f"Exception '{exc['exception_id']}' expired at {exc['expires_at']}.",
                        )
                    )

    return violations


# --- Verification assertions for validator behavior ---
if __name__ == "__main__":
    sample_policy = {
        "allowed_domains": ["sales", "payments", "inventory"],
        "allowed_classifications": ["public_internal", "confidential", "restricted_pii"],
        "rules": {
            "ownership": {
                "require_owner_email_suffix": "@commerceflow.internal",
                "require_oncall_channel_prefix": "#",
            },
            "documentation": {
                "min_product_description_length": 30,
                "min_column_description_length": 15,
            },
            "privacy_and_security": {
                "forbid_raw_pii_in_port_types": ["analytical_sql"],
                "allowed_pii_protection_strategies": ["sha256_salted_token", "redacted_mask"],
            },
            "quality_baseline": {
                "max_allowed_staleness_minutes": 1440,
                "require_primary_key_not_null_check": True,
            },
        },
    }

    now = datetime(2026, 11, 7, 18, 0, tzinfo=timezone.utc)

    # Case 1: Valid Payments manifest (with tokenization and active exception)
    valid_manifest = {
        "product_id": "payments.settlements_reconciled",
        "domain": "payments",
        "description": "Reconciled bank settlements per payment order with fee status.",
        "ownership": {
            "owner_email": "payments-data-owners@commerceflow.internal",
            "oncall_channel": "#payments-data-alerts",
        },
        "classification": "confidential",
        "output_port": {
            "port_type": "analytical_sql",
            "schema": [
                {
                    "name": "settlement_id",
                    "primary_key": True,
                    "classification": "public_internal",
                    "description": "Immutable unique identifier of the bank settlement.",
                },
                {
                    "name": "customer_billing_token",
                    "primary_key": False,
                    "classification": "restricted_pii",
                    "pii_protection_strategy": "sha256_salted_token",
                    "description": "Irreversible salted SHA-256 token of the billing email.",
                },
            ],
        },
        "quality_guarantees": {
            "max_staleness_minutes": 60,
            "primary_key_not_null_check": True,
        },
        "access_control": {
            "authorized_consumers": [
                {
                    "consumer_domain": "fraud_analytics",
                    "iam_role_arn": "arn:aws:iam::111122223333:role/cf-fraud-analytics-reader",
                    "allowed_classifications": ["public_internal", "confidential", "restricted_pii"],
                    "exception_reference": {
                        "exception_id": "EXC-2026-042",
                        "expires_at": "2026-12-31T23:59:59Z",
                    },
                }
            ]
        },
    }

    assert validate_data_product_manifest(valid_manifest, sample_policy, now) == []

    # Case 2: Invalid manifest (unmasked PII and wildcard '*' IAM role)
    invalid_manifest = {
        **valid_manifest,
        "output_port": {
            "port_type": "analytical_sql",
            "schema": [
                {
                    "name": "settlement_id",
                    "primary_key": True,
                    "classification": "public_internal",
                    "description": "Immutable unique identifier of the bank settlement.",
                },
                {
                    "name": "customer_billing_email",
                    "primary_key": False,
                    "classification": "restricted_pii",
                    # Missing pii_protection_strategy
                    "description": "Plaintext customer billing email address.",
                },
            ],
        },
        "access_control": {
            "authorized_consumers": [
                {
                    "consumer_domain": "any",
                    "iam_role_arn": "arn:aws:iam::111122223333:role/*",
                    "allowed_classifications": ["public_internal"],
                }
            ]
        },
    }

    detected = validate_data_product_manifest(invalid_manifest, sample_policy, now)
    detected_ids = {v.rule_id for v in detected}
    assert "GOV-PRIV-001" in detected_ids
    assert "GOV-ACC-001" in detected_ids
    print(f"Validation passed. Violations detected in invalid manifest: {detected_ids}")

The assertions at the bottom protect three critical governance invariants: no analytical SQL port may declare a restricted_pii column without an approved protection strategy (GOV-PRIV-001), no consumer may be granted permissions via wildcards * (GOV-ACC-001), and no exception granting access to sensitive data remains valid past its expiration timestamp (GOV-ACC-003).

Step 4: From CI/CD Validation to Cloud Access Enforcement (AWS)

Validating the YAML file in the pipeline prevents an non-compliant manifest from being merged, but the control is only complete when the platform translates that declaration into real technical restrictions over stored and queried data.

In an AWS-based environment like CommerceFlow, managed services fulfill complementary roles within the governance plane:

  • Amazon S3: Stores the physical objects (for example, Apache Parquet files backing Apache Iceberg tables) encrypted at rest with AWS KMS while blocking direct end-user bucket reads so that all queries pass through the authorization layer.
  • AWS Glue Data Catalog: Acts as the technical registry of schemas, partitions, versions, and table/column properties published by each domain.
  • AWS IAM: Manages authentication and identity for producer domain execution roles and consumer team roles (enforcing least privilege through dedicated roles such as cf-finance-reporting-reader).
  • AWS Lake Formation: Enforces tag-based access control (TBAC / LF-Tags) at the database, table, column, and row levels across the Glue catalog and underlying S3 buckets.

The following conceptual pipeline flow illustrates how preventive validation connects to technical control enforcement:

# Conceptual publication pipeline snippet (Self-Serve Data Platform CI/CD)
stages:
  - name: "1. Preventive Policy Check (Policy as Code)"
    run: |
      python3 platform_governance/validate_governance_policy.py \
        --policy platform_governance/governance-policies.yaml \
        --manifest domain_product/data-product-manifest.yaml

  - name: "2. Schema & Physical Content Scan"
    run: |
      # Verifies that columns declared in the manifest match the physical table
      # and runs statistical sampling to detect undeclared PII patterns.
      python3 platform_governance/verify_schema_alignment.py \
        --manifest domain_product/data-product-manifest.yaml

  - name: "3. Catalog Registration & LF-Tag Enforcement"
    run: |
      # Synchronizes descriptions, owner, and sensitivity tags (LF-Tags)
      # in AWS Glue Data Catalog and applies grants in AWS Lake Formation.
      python3 platform_governance/apply_catalog_and_access_controls.py \
        --manifest domain_product/data-product-manifest.yaml

When Stage 3 runs for payments.settlements_reconciled, the platform attaches sensitivity=public_internal to settlement_id and order_id, sensitivity=confidential to net_settled_amount_cents, and sensitivity=restricted_pii to customer_billing_token. Because the Finance role (cf-finance-reporting-reader) is only granted read access to sensitivity IN ('public_internal', 'confidential'), when a financial analyst runs a standard SQL query in Amazon Athena, the following occurs:

-- Query executed by role: cf-finance-reporting-reader
-- The consumer selects only the columns authorized by its LF-Tag grant:
SELECT
    settlement_id,
    order_id,
    net_settled_amount_cents
FROM payments_prod.settlements_reconciled_iceberg
WHERE settlement_date = DATE '2026-11-07';
-- Result: Query succeeds. If the same role attempts to include the
-- customer_billing_token column (tagged as restricted_pii), Lake Formation rejects
-- the query with a column-level permission error (AccessDeniedException).

Crucial distinction between cloud tooling and organizational governance: AWS Lake Formation, AWS IAM, and AWS Glue Data Catalog are technical policy enforcement points, but they do not decide which data is sensitive for your business, who is accountable for fixing an accounting discrepancy, or whether an access exception for the fraud team is justified. Those decisions belong to the organization's federated governance model.


Three Practical Scenarios with Different Decisions

Federated computational governance does not apply identical rules across every context. Let's examine three real-world scenarios with distinct requirements and architectural choices.

Scenario 1: E-Commerce and Financial Reconciliation (CommerceFlow)

  • Situation: The Sales domain publishes sales.orders_completed_daily, Payments publishes payments.settlements_reconciled, and Inventory publishes inventory.stock_availability_hourly. The Data Science team requests access to all three products to train a stockout-driven order cancellation prediction model.
  • Governance decision: Because none of the columns needed for training contain restricted_pii (only order identifiers, stock availability, and settlement states classified as public_internal and confidential), the request is fulfilled without a human security committee meeting. The team adds the training pipeline's IAM role to the authorized consumers list for public_internal and confidential classifications via a Pull Request reviewed by the respective Data Product Owners, and the platform pipeline automatically provisions the read permissions.

Scenario 2: University Educational Platform and Academic Research

  • Situation: A university manages three data domains: Enrollment, Academic Assessments, and Student Counseling & Wellness. An institutional research group needs to analyze course dropout rates, but student privacy regulations strictly forbid researchers from accessing medical or psychological records in the Student Counseling & Wellness domain or students' national identification numbers.
  • Governance decision: The federated forum defines an additional sensitivity classification (special_category_health) that is strictly forbidden from exposure on any cross-domain analytical port, with no standard pipeline exception path allowed. Additionally, the platform enforces a computational policy requiring a minimum aggregation threshold ($k \ge 10$ students per cohort) before publishing combined metrics between Enrollment and Academic Assessments.

Scenario 3: When a Simpler Alternative Is Sufficient (12-Person B2B SaaS Startup)

  • Situation: A B2B startup has a single product engineering team of 10 developers, 2 data engineers, and one centralized analytical warehouse in PostgreSQL / BigQuery with fewer than 30 tables.
  • Governance decision: Building a formal federated governance body, a custom YAML manifest validation engine, and dynamic column-level tag provisioning across multiple cloud accounts would be premature over-engineering. At this scale, three simple and effective controls suffice:
    1. Separate operational tables containing PII (raw_restricted) and clean analytical views (analytics_clean) into two distinct database schemas.
    2. Manage permissions through three standard database roles (loader_role, analyst_readonly, security_admin) defined in a Git-versioned SQL file.
    3. Add a lightweight CI test verifying that no view in the analytics_clean schema selects columns listed in an explicit deny-list of sensitive fields (email, phone, tax_id).

Using Artificial Intelligence to Support Governance Without Delegating Judgment

Large language models are useful for drafting initial declarative policies or auditing manifests for semantic inconsistencies (for example, a column whose description mentions customer email addresses while its classification is set to public_internal), provided their output passes through deterministic validators and human review.

Prompt 1: Semantic Sensitivity Classification Audit on a Manifest

Act as a data security and governance specialist.
Context: In our Data Mesh architecture (CommerceFlow) we use three column classification levels:
- public_internal: technical system identifiers, catalog codes, non-financial aggregated quantities.
- confidential: financial amounts, margins, fees, inventory costs.
- restricted_pii: direct or indirect personally identifiable information (emails, phone numbers, addresses, government IDs, identity tokens).

Constraints:
- Analyze the following YAML schema of a Data Product.
- Identify any column whose declared classification contradicts its name or semantic description.
- Do not assume a field ceases to be restricted_pii merely because it is hashed or tokenized: it must retain the restricted_pii classification alongside its protection strategy.

Expected output:
Return a table with: Column Name | Declared Classification | Recommended Classification | Risk Justification.

[PASTE THE output_port.schema SECTION OF THE YAML MANIFEST HERE]

What a human must verify: Check whether columns marked as public_internal could be joined with other tables in the domain to re-identify an individual user (quasi-identifiers), and confirm with the domain's Data Product Owner the actual contents of physical data samples in storage before approving the schema.

Prompt 2: Generating Negative Test Cases for a Policy as Code Validator

Act as a data platform engineer specializing in software testing.
Context: We have a Python function `validate_data_product_manifest(manifest, policy, evaluation_time)` that validates data product manifests against our global governance rules.

Constraints:
- Generate 5 unit test cases using `pytest` focused on edge cases and common bypass attempts:
  1. An access exception whose expiration timestamp is exactly equal to `evaluation_time`.
  2. A column description padded solely with whitespace characters to pass the minimum length check.
  3. An IAM role attempting to use a partial wildcard at the end of the role name.
  4. A `restricted_pii` column in an `analytical_sql` port declaring an unapproved protection strategy (`base64_encoded`).
  5. A product declaring `primary_key_not_null_check: true` when no column in the schema has `primary_key: true`.
- Use clean Python code and explicit assertions checking both `rule_id` and `field_path`.

What a human must verify: Run the test suite in the continuous integration pipeline and confirm that the returned rule codes (rule_id) match the organization's official policy catalog.


Practical Application Exercises

Exercise 1: Detecting Governance Failures in a New Inventory Product

The Inventory team attempts to publish the inventory.supplier_shipments product using the following manifest snippet:

product_id: "inventory.supplier_shipments"
domain: "inventory"
description: "Supplier shipments."
ownership:
  owner_email: "logistics-external@gmail.com"
  oncall_channel: "#inventory-alerts"
classification: "confidential"
output_port:
  port_type: "analytical_sql"
  schema:
    - name: "shipment_id"
      primary_key: true
      classification: "public_internal"
      description: "Shipment ID."
    - name: "driver_phone_number"
      primary_key: false
      classification: "restricted_pii"
      description: "Direct mobile phone number of the transport driver for delivery incidents."

Question: According to CommerceFlow's global rules defined in this article, which four specific violations will the automated validator block, and how should the Inventory team fix them?

Exercise 2: Designing a Temporary Exception vs. a Permanent Modification

The External Audit team needs to query settlements from the Payments domain for 15 days, including the customer_billing_token (restricted_pii) column, to verify an annual regulatory sample. An engineer proposes changing the classification of customer_billing_token from restricted_pii to confidential for those two weeks so the existing audit role can read it without additional paperwork.

Question: Why is this proposal dangerous, and how should it be resolved properly within the federated computational governance model?

Exercise 3: Separating Global Policy from Local Domain Decisions

The federated forum at CommerceFlow is debating three new proposals to include as mandatory global rules in the company-wide validator:

  • Proposal A: Require every data product to declare an explicit retention policy (retention_days) aligned with its legal classification.
  • Proposal B: Require all domains (Sales, Payments, and Inventory) to refresh their data products every 15 minutes.
  • Proposal C: Forbid granting read permissions to IAM principals from external AWS accounts without a recorded security approval.

Question: Which of these proposals belong as global federation policies, and which should remain a local decision owned by each domain? Justify your answer.


Reasoned Solutions to the Exercises

Solution to Exercise 1

The validator will reject the manifest with four specific violations:

  1. GOV-DOC-001 (description): The product description ("Supplier shipments.", 19 characters) falls below the 30-character minimum required to explain the purpose and scope of the dataset in the catalog.
  2. GOV-OWN-002 (ownership.owner_email): It uses an external consumer email (@gmail.com) instead of the internal corporate domain (@commerceflow.internal), making it impossible to bind ownership to an authenticated organizational team.
  3. GOV-DOC-002 (output_port.schema[shipment_id].description): The description "Shipment ID." is only 12 characters long and fails to explain the origin or granularity of the primary key.
  4. GOV-PRIV-001 (output_port.schema[driver_phone_number].pii_protection_strategy): It exposes a personal phone number (restricted_pii) in plaintext inside an analytical_sql port. If shipment analytics does not require the driver's phone number, the column should be removed from the analytical port; if analysts need to count unique drivers without contacting them, sha256_salted_token must be applied.

Solution to Exercise 2

Downgrading the column's classification from restricted_pii to confidential breaks security isolation: every other consumer that already holds permission to read confidential columns (such as the Finance team or commercial reporting pipelines) would automatically gain access to the billing token without authorization, and security would depend on someone remembering to manually revert the change after 15 days.

The proper solution is to keep the restricted_pii classification intact on the column and add an entry for the dedicated audit role (arn:aws:iam::111122223333:role/cf-external-audit-2026) containing an exception_reference block with expires_at set to exactly 15 days out. Once that timestamp passes, the automated control revokes the permission or blocks unapproved renewals while preserving a complete audit trail in Git and cloud logs.

Solution to Exercise 3

  • Proposals A and C should be global policies: Legal data retention (Proposal A) and preventing data exfiltration to unauthorized external accounts (Proposal C) address regulatory and security risks that cut across the entire enterprise. No individual domain has the authority to unilaterally assume the legal liability of retaining personal data indefinitely or exposing corporate data to third parties without verification.
  • Proposal B should remain a local domain decision: Enforcing a 15-minute refresh cycle across all products ignores business reality and needlessly multiplies compute costs. While warehouse stock availability may benefit from hourly or near-real-time updates, a daily or monthly accounting settlement in Payments only makes business sense once the bank reconciliation window closes. Global policy should only require each domain to declare and honor its freshness threshold (max_staleness_minutes), leaving each Data Product Owner to set the appropriate cadence alongside its consumers.

When to Apply Federated Computational Governance and Final Summary

Adopting Federated Computational Governance pays off when your organization meets these conditions:

  • Multiple domains produce and consume data on independent delivery schedules.
  • Manual security, privacy, or cataloging reviews have become a recurring bottleneck, or the lack of uniform controls has already caused sensitive data exposure or orphaned tables without clear owners.
  • You operate a shared data platform (or common CI/CD pipeline) where you can intercept data product publication and automate catalog registration and permission enforcement.

Conversely, avoid designing dozens of global rules on day one: start by automating the highest-impact, lowest-ambiguity invariants—mandatory ownership, explicit sensitivity classification, blocking unprotected PII, and least-privilege access without wildcards—and evolve the policy suite iteratively as the federation observes real operational risks across domains.

Loading conversation…

Keep learning