Inspiration
Data engineering teams face a silent, high-stakes crisis: as raw tables and staging data pipelines rapidly proliferate, sensitive Personally Identifiable Information (PII) like emails, phone numbers, and SSNs quietly slip into data platforms without documentation or masking policies. Manual audits are slow, error-prone, and reactive.
We were inspired by a simple question: What if an AI agent possessed full structural awareness of an organization’s data stack via DataHub, detected compliance risks on day zero, generated production-ready masking code, and updated the governance graph autonomously?
What it does
DataGuard is an end-to-end, metadata-driven governance agent that bridges the gap between context awareness and automated remediation:
Reads Context: Queries DataHub via the MCP Server / Python SDK to continuously inspect newly ingested dataset schemas and column metadata.
Detects & Analyzes: Evaluates column fields against privacy rules (GDPR, CCPA) to pinpoint untagged sensitive attributes.
Generates Remediation Code: Automatically compiles production-grade, anonymized dbt SQL models using secure hashing (SHA256) and masking (CONCAT/RIGHT) transformations.
Writes Back to DataHub: Crucially, DataGuard mutates the DataHub Context Graph by emitting Metadata Change Proposals (MCPs) to apply #PII-Sensitive tags and attach audit Assertions directly onto the dataset URN.
How we built it
Context Engine: Built on DataHub's Open Context Platform, utilizing the acryl-datahub Python SDK to interact with DataHub entities and schemas.
Agent Core: Developed in Python, combining rule-based schema inspection with metadata pattern extraction.
Code Generator: Built an automated code generation module that constructs dbt transformation models adhering to standard SQL data transformation specs.
Graph Writer: Implemented DataHub REST emitters to issue Metadata Change Proposals (MetadataChangeProposalWrapper), writing tags and data quality assertions directly back to the graph.
Challenges we ran into
Schema Mutability & Rest Emitters: Ensuring smooth Metadata Change Proposal (MCP) emissions to local DataHub GMS instances required deep dives into DataHub's aspect model specs (globalTags and assertionInfo).
Environment Configuration: Resolving pre-compiled Python binary wheel conflicts on local Windows Git Bash environments during automated build setups.
Accomplishments that we're proud of
Two-Way DataHub Integration: We didn't just read metadata from DataHub—we successfully closed the loop by writing back state updates (tags and assertions) to enrich the graph for future agents and human engineers.
Turnkey Outputs: Generated sample, testable dbt transformation artifacts in an /examples directory so judges and platform teams can verify code quality immediately.
Production-Ready Architecture: Clean, modular repository layout with 100% open-source compliance (Apache 2.0 License).
What we learned
The immense power of the Model Context Protocol (MCP) and DataHub's unified graph—having standard, queryable access to schemas and lineage fundamentally transforms how AI agents reason about data infrastructure.
How writing back execution results into a shared context platform prevents duplicate agent work and keeps human platform teams in the loop.
What's next for DataGuard: Autonomous PII Agent
Slack / Teams Integration: Sending human-in-the-loop notification prompts to dataset owners before auto-merging masking PRs into GitHub/GitLab.
Lineage-Aware Downstream Blocking: Leveraging DataHub’s column-level lineage graph to trace downstream BI dashboards or ML feature stores affected by newly flagged PII columns and automatically pausing untrusted pipelines.
Log in or sign up for Devpost to join the conversation.