Skip to content
bricksentry

Blog · Essay

Build your pipelines with AI. Validate with bricksentry.

By Brahma ·

ShareLinkedInX

Last night I asked an AI assistant to build a data pipeline. Bronze, Silver and Gold Delta tables for HR data: fifty raw employee records with duplicates and broken salaries, cleaned down to forty-four, summarised into headcount and average salary by department. It took minutes. Then I asked it to change one rule in the Gold table: count employees on leave as active.

That second request is the one that matters. Building a pipeline from nothing is impressive. Changing a pipeline that people already depend on is where things go wrong.

So before writing anything, the assistant asked bricksentry four questions:

  • Who depends on this table? whats_downstream came back empty: nothing reads it yet.
  • How do I undo it? rollback_plan returned the exact RESTORE command, matching the table's real history.
  • What will this change actually do? preview_write ran the statement on a disposable copy of the table and compared it with the real one: 3 departments change, 2 don't, total headcount up 11.76%. Verdict: warn.
  • May I ship it? safe_to_ship said yes, with the warnings attached.

Only then did it make the change, and it checked the result against the Silver table on its own. The numbers matched exactly.

It also found a bug. One of its previews, a CREATE OR REPLACE TABLE, failed on serverless compute. bricksentry refused cleanly, touched nothing and cleaned up after itself. The fix was released the same evening as 0.1.30. That is what I want this whole thing to feel like: AI moves fast, and every step it takes leaves evidence behind.

Code review was built for people writing code

For twenty years we've reviewed data pipelines by reading code. A reviewer looks at a diff of SQL or PySpark and imagines what it will do to millions of rows and to everything that reads them. That was already hard when people wrote every line.

Now an assistant can open ten pull requests before lunch, each one clean, each one passing its tests. The code is not the risk anymore. The data is. A join that quietly duplicates rows, a filter that drops a region, a MERGE that "looks right": none of these fail a build. They show up on Monday as a dashboard that's off by a few percent, and nobody can say which change did it.

The answer isn't to slow the AI down. It's to give every change, human or AI, a check that reads the data instead of the code.

Build with AI, validate with bricksentry

The loop is simple, and it's the same whether a person or an agent is driving:

  • Look before you touch. Ask what depends on the table, from Unity Catalog lineage: tables, jobs, notebooks, dashboards, Genie spaces, with owners and tags.
  • Keep the undo button. Get the RESTORE command before anything changes.
  • Rehearse the change. Run it on a shallow clone, or build it into a candidate table in CI, and compare row by row with production: rows added, removed and changed, column by column, duplicate keys, totals.
  • Let rules decide. Your policy file turns the evidence into pass, warn, needs a human, or block. The same change gets the same answer every time.

The AI does the building. bricksentry does the checking. Neither has to trust the other.

What we decided an AI-era safety check must do

Evidence, not opinions. A model can't look at a statement and tell you it duplicates 4% of rows. A diff can. Every verdict rests on counts you could reproduce yourself.

Rules, not a language model. It would have been easy to ask an LLM whether a change looks safe. But a safety gate has to give the same answer to the same change, and a team has to be able to read the rules and argue about them in a pull request. The assistant can read the explanation. It never changes the verdict.

Fail closed. If bricksentry can't verify something (a diff that fails, a masked column, a table rewritten while it's being checked, a view whose definition it can't read), it asks a human. It never turns "couldn't check" into "looks fine".

Agents see counts, never values. bricksentry often runs with more access than the agent that calls it. So agents get row counts, columns and verdicts, and only for the tables you list, including tables reached through views and SQL functions. They never get production values, not even the "after" side of their own change.

Undo comes first. The rollback is handed over before the change runs, not looked up after something breaks.

How hard we tried to break it

I don't think you should trust a safety tool because its author says so. So I asked another AI to attack it.

Over ten rounds, an AI assistant tried everything we could think of on a real Databricks workspace: duplicate and NULL keys, 10 million rows, 1,000 columns, MAP columns, floating-point traps, near-overflow decimals, MERGE in every shape, tables rewritten in the middle of a check, prompt injection hidden in table tags, agents trying to read social security numbers through a dry run, SQL designed to confuse the parser, views and functions hiding forbidden tables.

It found real problems. Duplicate keys could make two real changes look like 36,563. A dry run could hand an agent production values. A table rewritten mid-check could mix two versions into one answer. A view could smuggle a forbidden table past the allowlist. Every one was fixed, re-tested against the original attack, and written up in public, including the ones that embarrassed me.

Where it stands today:

  • 319 automated tests on every change.
  • A 15-scenario validation battery that runs on your own workspace in about four minutes and cleans up after itself.
  • 10 million rows diffed exactly in 22 seconds.
  • Every finding, fix and re-test on the validation page.

What I'm confident about, and what I'm not

I'm confident about the direction of every failure: when bricksentry is unsure, it stops and asks. I'm confident production is never written by a preview, and that agents never see your data.

What isn't proven yet is everything outside my own workspace: other clouds, classic compute, teams where the agent and bricksentry run as different identities, months of daily use. That's why it's in public beta, and the list of what has to be proven before 1.0 is written down in the README.

Where this goes

I think we're near the start of a big change in how data work gets done. Assistants won't just suggest code; they'll build pipelines, refactor them, backfill them and fix them at 2 a.m. The teams that do well won't be the ones who keep AI away from their data. They'll be the ones who can let it work and still sleep, because every change carries its own evidence.

That's what I want bricksentry to become: the layer between "the AI says it's done" and "this is in production". A check every agent calls before it writes, a verdict every reviewer can read, and a record of every change that you can come back to months later and understand.

The next steps are concrete:

  • Running bricksentry as an MCP server inside the workspace, so Databricks' own assistant calls it directly in agent mode.
  • Proving it on other clouds and classic compute, and with teams beyond my own.
  • Faster checks for very large tables.
  • A clear compatibility promise at 1.0.

Try it, and tell me where it breaks

On your laptop, in about 30 seconds:

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

On Databricks, run the validation notebook on your own workspace, then point the PR check at one real pipeline. If you'd like to be one of the first teams in the beta, open an issue or reach out.

Build with AI. Validate with bricksentry. And keep the evidence.

Brahma

ShareLinkedInX