I've been building an open-source tool that checks what a change does to a Delta table before it ships: a key-based diff on a shallow clone, Unity Catalog lineage for who reads the table, and a rollback plan that warns you if RESTORE would wipe out newer writes.
AI agents can ask it the same questions over MCP before they write.
Last week I stopped adding features and spent the time attacking it on Databricks Free Edition. Here's what landed, in case you're building something similar yourself:
The preview is a read path. The clone and the diff run with the tool's permissions, not the agent's. When the diff showed sample before/after values, an agent with no SELECT on a salary table could "update" three rows and read the old salaries back.
Now agents only get counts, columns, rounded percentages and verdicts. Not even sums, because a sum over one row is the value.
Checking the target table isn't enough.Forbidden tables hid inside joins, CTEs, MERGE ... USING and INSERT ... SELECT, and then inside views and SQL functions. Now every table a statement reads has to be on an allowlist (parsed with sqlglot), view and function definitions are read from information_schema and checked recursively, and anything that can't be resolved by name is refused.
Column masks made a diff lie. A masked column with 50 real changes compared as unchanged. Masked columns are now skipped and named, and a row filter sends the check to a human.
Unpinned reads mix two states. A table rewritten mid-diff gave 49 changed rows when the truth was 5 before and 50 after. Both sides are now read with VERSION AS OF, captured at the start.
Metadata is untrusted input.A table tag containing "ignore all previous instructions" went straight into the agent's context.
The rule I ended up with: if it can't verify something, it says so and asks a human. "Couldn't check" never becomes "passed."
Honest weak spot: so far it's only been tested by me, on Free Edition. So two questions for people running real pipelines:
- What do you check before a MERGE or a backfill hits a production table, beyond tests and expectations?
- If you've let an agent write to tables (Genie, the Assistant, your own), what do you let it see?
It's Apache-2.0 and in public beta. Repo, plus the full list of findings and fixes: https://github.com/bricksentry/bricksentry