Skip to content
bricksentry

Open source · New in 0.1.33 → · Public beta

Know what a change does to your data before it ships.

Change-safety checks for Databricks pipelines and AI agents. Diff data, map Unity Catalog blast radius, and enforce policy verdicts before code lands.

$ pip install "bricksentry[databricks,mcp]"
Try it in your browser →
  • PySpark, Jobs, Lakeflow
  • MCP server for agents
  • Works in CI
Star

// change-safety gate

1 · A change arrives

  • CI · pull requestPySpark, Jobs, Lakeflow and SQL changes in GitHub Actions
  • AI agent · MCPGenie, Claude or Cursor previewing a write with preview_write

2 · bricksentry checks it

on a clone · never writes to production

  1. 01Data diff. Added, removed and changed rows, exact totals, schema, duplicate keys
  2. 02Blast radius. Unity Catalog lineage to certified tables, jobs and dashboards
  3. 03Policy. Your rules, or builtin:certified and pii, decide the verdict

3 · One verdict

  • passMerge, or the agent's write goes ahead
  • needs_humanOwners are asked to review
  • blockStopped, with the RESTORE ready

// See it in 21 seconds

Green pipeline. Wrong data.

01// The gap

A successful run can still ship wrong data.

No exception is raised. The job is green. But the change silently duplicates records, shifts a financial total, or breaks the report three hops downstream. Code review reads code; it can't see any of that.

72% vs 24%

of data teams prioritise AI-assisted coding; only 24% prioritise AI pipeline management.

Source: dbt Labs, State of Analytics Engineering 2026 ↗

53%

of data engineering capacity at large enterprises goes to pipeline maintenance.

Source: Fivetran 2026 Enterprise Data Infrastructure Benchmark ↗

2024

Datafold archived its open-source data-diff. The pull-request review tools that remain mostly target dbt projects or need a paid platform.

Source: Datafold open-source docs ↗

What bricksentry caught in the demo

The silent problemWhat bricksentry reported
Duplicate recordsBLOCK: 40 duplicate keys in candidate (base had 0), from a row count change of only +0.20%.
A financial total movedsum(amount) −2.67%, and 100% of affected rows are region = APAC.
Downstream reporting affectedBlast radius from Unity Catalog lineage: a certified revenue table, the Exec Revenue dashboard and a Genie space, with owners tagged for review.
Unsafe deployment--fail-on needs_human fails the CI check; agents get next_step: "Do not merge." Previews never touch production.

02// How it works

Four checks, in order, on every change.

Everything runs as SQL on your SQL warehouse. No Spark session, no data leaves your workspace, and it's cheap enough for an agent to call in a loop.

  1. 1 / Diff

    What changed in the data?

    Matches production and your change on key columns; counts added, removed and changed rows, schema changes, column totals and duplicate keys, then finds where the change is concentrated.

    2 rows changed · amount / total −6.7% · 100% APAC
  2. 2 / Blast radius

    Who depends on it?

    Walks Unity Catalog's runtime lineage, which sees PySpark notebooks, jobs, pipelines, dashboards and queries, and attaches owners and tags.

    → daily_revenue [certified] → Exec Revenue dashboard
  3. 3 / Policy

    Is it allowed?

    Your rules in policy.yml decide the verdict. The same change always gets the same answer, because no LLM is involved in the decision.

    certified downstream → needs_human / total moved > 5% → warn
  4. 4 / Rollback

    How do I undo it?

    Reads Delta history and hands you the exact restore command before anything is applied.

    RESTORE TABLE sales.orders TO VERSION AS OF 41
Production
order_idregionamount
1APAC100
2EMEA200
3APAC300
After 10% off APAC
order_idregionamount
1APAC90
2EMEA200
3APAC270

03// Works with Databricks

Built on what Databricks gives you, not instead of it.

Each Databricks feature answers a different question at a different time. bricksentry turns them into one decision before a change merges.

FeatureWhat it answersWhenWhat bricksentry adds
Unity Catalog lineageWhat depends on this table?Any timeUses it for the blast radius, with owners and tags, inside the merge decision.
Lakeflow expectationsIs each record valid?While the pipeline runsCompares the whole table before and after a change: row loss, duplicates, shifted totals. Every row can be valid and the change still wrong.
Data quality monitoringIs this table fresh and complete?After data lands, on a scheduleChecks a specific change before it merges, not after it ships.
Delta time travelWhat did the table look like before?After the factHands you the exact RESTORE command before the change is applied.

Down to the column: which columns a change touched, whether they're tagged pii or certified, and which downstream columns they feed.

On the roadmap: feeding Lakeflow expectation results and data quality monitoring health into the verdict.

04// Verdicts

One answer, four levels.

The worst matching rule wins. CI fails at the level you choose with --fail-on, and agents get a next_step they must follow.

  1. pass

    Ship it

    no rule fired. Merge or apply.

  2. warn

    Ship, with notes

    something moved within tolerance. The warnings go into the PR description.

  3. needs_human

    Ask an owner

    a certified table, PII or a big row loss is involved. Owners from Unity Catalog are tagged for review.

  4. block

    Stop and fix

    duplicate keys or another hard rule. Rebuild the candidate and check again.

05// For AI agents

A safety loop your coding agent can call.

Databricks' managed MCP servers let agents read data and run queries. bricksentry adds the step that tells an agent whether its change is safe.

MCP tools
ToolAccessWhat it returns
whats_downstreamreadDownstream assets with owners and tags. Called before editing.
rollback_planreadThe restore SQL, captured before anything changes.
preview_writesandboxRuns one write on a disposable shallow clone and returns the diff and verdict. Production is never touched.
assess_changereadProduction vs. the candidate your change built, plus lineage and policy.
explain_diffreadA plain-English summary of what moved and where.
safe_to_shipreadThe final gate: a boolean, the reasons, and the next step.
  • Verdicts come from rules, never from an LLM.
  • preview_write accepts one INSERT, MERGE, UPDATE or DELETE aimed at the clone, and refuses DROP, TRUNCATE, ALTER and GRANT.
  • Errors return as JSON, so the agent can recover instead of crashing.
  • Agents get counts, columns and verdicts, never production values.
  • Hash sampling and depth limits keep every call's cost bounded.
shell · register MCP server
claude mcp add bricksentry -- \
  bricksentry mcp --config ./bricksentry.yml
python · agent loop
from bricksentry import agent_tools as bs

plan = bs.rollback_plan("main.sales.orders")
a = bs.assess_change(["main.sales.orders"], pr="42")
gate = bs.safe_to_ship(a["id"])

if not gate["safe_to_ship"]:
    open_pr_with_report(gate["next_step"])

06// For data engineers

A data review on every pull request.

Build your branch's tables into a per-PR schema with your Asset Bundle, then add one step that posts a comment with the diff, blast radius, verdict and rollback.

github actions · step
- run: pip install "bricksentry[databricks]"
- run: >
    bricksentry assess --from-git origin/${{ github.base_ref }}
    --pr ${{ github.event.pull_request.number }}
    --comment --fail-on needs_human
bash · cli
bricksentry impact main.sales.orders
bricksentry preview main.sales.orders --sql "MERGE INTO {{target}} t USING updates u ON t.order_id = u.order_id WHEN MATCHED THEN UPDATE SET *"
bricksentry assess --from-git origin/main --pr 42 --format markdown --fail-on needs_human
bricksentry rollback main.sales.orders
bash · check last change
bricksentry check-last-change main.sales.orders                 # newest data change vs the version before
bricksentry check-last-change main.sales.orders --version 42    # a specific version
bricksentry check-last-change main.sales.orders --since 2026-11-11T09:00:00Z --fail-on needs_human

Checks a change that already landed, from the table's Delta history. OPTIMIZE and VACUUM are skipped. Keys come from bricksentry.yml, --key, or the table's PRIMARY KEY.

Check every pipeline run automatically (5 minutes)

Answer a few prompts (tables to watch, SQL warehouse, scratch schema, policy, optional Slack webhook secret) and deploy. You get a serverless job with a table update trigger: whenever a watched table changes, bricksentry checks the change, alerts Slack, and logs the RESTORE that undoes it. Add the same check as a task inside your pipeline job and a block verdict stops the tasks downstream.

bash · deploy job
databricks bundle init https://github.com/bricksentry/bricksentry --template-dir templates/job-check
cd bricksentry_check && databricks bundle deploy
databricks bundle run bricksentry_demo     # optional: see a block on a demo table in about 2 minutes

The optional demo job writes a known-bad MERGE to a demo table in your scratch schema and checks it, so your first run ends red with a block. Leave the tables prompt empty to try only the demo first.

Prefer a notebook? Import the quickstart into Databricks: Workspace → Import → URL

url
https://raw.githubusercontent.com/bricksentry/bricksentry/main/examples/databricks/bricksentry_quickstart.py

Check one of your tables →

07// Why it's different

Built for where Databricks work actually lives.

Not only dbt
covers PySpark notebooks, Jobs and Lakeflow pipelines, where most Databricks work lives.
Runtime lineage
uses what Unity Catalog recorded at runtime, instead of guessing from parsed SQL, so notebooks and dashboards show up.
Free and local to you
Apache-2.0 and pip-installable. No platform subscription, and queries run in your own workspace.

08// FAQ

Questions data engineers ask first.

Has it been tested on real Databricks?

Yes. Every release gets a live run on a Databricks serverless workspace before it ships, with production table histories compared before and after. Rounds have covered tables from 1 million to 1 billion rows, an AI agent attempting risky changes on a live pipeline, and hostile SQL. Every run, with its numbers and the bugs it found, is on the validation page. Run the quickstart notebook to check it on your own workspace.

Does it work without Databricks?

Yes for trying it: uvx --from "bricksentry[duckdb]" bricksentry demo, with nothing to install first, or pip install "bricksentry[duckdb]" then run bricksentry demo. It runs the full agent loop on a local 20,000-row example in about 30 seconds and ends with a bad pipeline commit found in table history, blocked and undone. Production use targets Databricks SQL warehouses.

Does my data leave my workspace?

No. All diffs run as SQL on your own warehouse; bricksentry only receives aggregate counts and a few sample rows.

Does an LLM decide the verdict?

No. Rules in policy.yml decide. An agent's LLM can read the explanation, but never changes the verdict.

Can an agent damage production with preview_write?

It only runs a single write statement against a disposable shallow clone and refuses DROP, TRUNCATE, ALTER, GRANT and multi-statement SQL.

Does it support dbt?

It works on any table, including dbt-built ones; its focus is the PySpark, Jobs and Lakeflow work that dbt-only tools don't cover.

AWS, Snowflake, BigQuery?

Databricks first (on any cloud, including AWS). Athena/Iceberg and an OpenLineage provider are next on the roadmap.

Why the name "bricksentry"?

Bricks plus entry. Your tables, pipelines and data are the bricks of the lakehouse, and every change to them is an entry. bricksentry checks each entry, reports what it does, and stands guard before it lands. Read it as "bricks entry" or "brick sentry"; both are right.

09// Roadmap

What ships next.

  1. v0.1 · nowData diff, Unity Catalog blast radius, policy verdicts, preview_write, rollback, CLI, CI step, MCP server
  2. v0.2AWS: Athena and Iceberg on the Glue Data Catalog, SageMaker / DataZone lineage
  3. v0.2OpenLineage provider for Airflow, dbt and Spark
  4. v0.2Lakeflow expectation results and data quality monitoring health as policy signals
  5. v0.3Aggregate diff for tables without a stable key
  6. LaterAsset Bundle parsing, Redshift, scheduled drift checks, a Databricks App UI

10// Help it grow

If bricksentry would have caught a bug for you, star it on GitHub.

Stars help other data engineers find it. Issues from real pipelines help even more.

Star the repo

Star on GitHub

Try it in 30 seconds

uvx --from "bricksentry[duckdb]" bricksentry demo

Tell us what broke

Open an issue · Bugs, false alarms or a check you wish it had.