Inspiration

AI agents can modify data pipelines, schemas, and governance metadata faster than people can assess the consequences. However, agents often act without knowing who owns the affected asset, whether it contains sensitive data, or how many downstream systems depend on it. A technically valid change can still break dashboards, models, and business processes.

What it does

OME ContextGuard is a human-in-the-loop safety gate for data-aware AI agents.

Before an agent executes a proposed data change, ContextGuard retrieves ownership, tags, schema, and downstream lineage through the official DataHub MCP server. It then calculates a deterministic 0–100 risk score and provides evidence for every risk factor.

Low-risk actions can proceed. Medium- and high-risk actions pause for approval from a named human reviewer. Critical actions remain blocked. After approval, ContextGuard writes a linked Decision document back to DataHub and creates a tamper-evident JSON audit record.

Ollama runs locally and converts the structured findings into a clear explanation. The language model cannot change the risk score or authorize execution.

How we built it

The project uses:

  • Python for the workflow and deterministic risk engine
  • DataHub OSS as the source of organizational context
  • The official DataHub MCP server for entity, lineage, and write-back operations
  • Ollama with llama3.2:1b for local explanations
  • A human-approval state machine
  • SHA-256 fingerprints for audit-record integrity
  • Offline fixtures and automated tests for reproducible validation

Challenges we ran into

DataHub responses vary between entity types, so we had to normalize ownership, tags, schema fields, and lineage without weakening the policy logic.

Another challenge was separating explanation from authority. Ollama improves usability, but deterministic rules and the named human reviewer must remain in control even when the model is unavailable or produces an incorrect explanation.

Accomplishments that we're proud of

  • Validated the workflow against a local DataHub graph
  • Detected 24 downstream assets
  • Identified PII and a missing recorded owner
  • Produced a deterministic 70/100 high-risk score
  • Required explicit human approval
  • Wrote the approved decision back to DataHub
  • Generated a tamper-evident audit record
  • Created 11 automated dependency-free tests

What we learned

Safe AI-agent execution is not only an LLM problem. Agents need reliable organizational context, deterministic policy, explicit authority boundaries, and an auditable record of every important decision.

What's next for OME ContextGuard

Next, we plan to add signed approvals, DataHub assertion and incident signals, domain-specific policy profiles, and enforcement adapters for orchestration platforms such as Airflow and Dagster.

Built With

  • agents
  • ai
  • context
  • data
  • datahub
  • governance
  • human-in-the-loop
  • json
  • lineage
  • management
  • model
  • ollama
  • powershell
  • protocol
  • python
  • risk
  • sha-256
Share this project:

Updates