← All posts

Data Engineering · 7 min read

Data engineering agents: where they help, and where they shouldn't touch production

Agents can draft schema mappings, SQL, data quality checks and documentation faster than any of us. Here's where they genuinely help, what the research says about their accuracy, and the guardrails that keep them away from production data.

Subhash Nunna ·

Data engineering is full of work that is important, repetitive and slightly boring: mapping one schema onto another, writing staging models, adding tests, documenting columns nobody remembers creating. That is exactly the kind of work AI agents are good at drafting.

It is also work that sits one step away from production data. A wrong join in a notebook is a learning moment. A wrong DROP in a warehouse is an incident.

This post looks at where agents genuinely help across the pipeline, what the research says about how accurate they are, and how to set up guardrails so they speed you up without ever holding the keys to production.

What’s changed

Data platforms are now shipping agents directly. Google introduced a Data Engineering Agent in BigQuery in preview in August 2025: you describe a pipeline in plain language — SiliconANGLE’s example is “create a pipeline to load a CSV file, cleanse the columns, and join it with another table” — and the agent builds the workflow, which engineers can then edit or refine with further prompts.

At the same time, tools like dbt now expose their projects to any agent through the Model Context Protocol (MCP). The dbt MCP server offers tools for lineage, model metadata, the semantic layer, code generation, SQL execution and running dbt commands. That makes agents far more useful — and makes the question of which tools they get much more important.

Where agents help

Task What the agent does Why it works
Schema mapping Proposes column matches between source and target Good at reading cryptic names and context; you review a ranked shortlist
SQL and transformations Drafts staging models, joins, refactors Fast first draft; compiles and tests can check it
Data quality Suggests tests (not-null, unique, ranges, relationships) Tests are cheap, reviewable and add safety rather than risk
Documentation Writes model and column descriptions from code and lineage Low risk, high value; nobody else is writing them
Debugging Reads job errors and lineage, suggests a likely cause Read-only investigation, human applies the fix

What these have in common: the agent produces a draft artefact — a mapping, a SQL file, a YAML test, a doc block — that goes through the same review, CI and deployment as human work.

Schema mapping

Mapping a source system onto a target model (for example, a standard like OMOP in healthcare) is slow, expert work. The SCHEMORA paper notes that manual mapping to such standards can take 40–80 hours of expert review.

LLMs help here in a specific way. SCHEMORA first uses an LLM to expand cryptic column names (turning loc_id into “location identification”) and generate alternative names, indexes them for vector and keyword search, then uses an LLM to rank candidate matches. On the MIMIC-to-OMOP benchmark, its best setup found the right match in the top 5 candidates about 80% of the time, but as the top-1 answer only about 54% of the time.

That gap is the practical lesson. Agents are excellent at producing a shortlist for a human to pick from. They are not yet reliable enough to auto-apply mappings. The paper also found that putting the whole target schema in the prompt did noticeably worse than retrieving candidates first — a reminder that context engineering matters here too.

SQL on real warehouses

Text-to-SQL looks solved on simple benchmarks. Real enterprise warehouses are another matter. The Spider 2.0 benchmark (published in late 2024, so older than most sources here, but still the reference point) uses 632 real-world tasks over databases that often have more than 1,000 columns, across systems like BigQuery and Snowflake, with answers often over 100 lines of SQL.

The authors’ agent, built on o1-preview, solved just 21.3% of Spider 2.0 tasks — compared with 91.2% on the older Spider 1.0 and 73.0% on BIRD. Whatever today’s leaderboard says, the gap between “toy schema” and “your warehouse” is the point: agent-written SQL needs tests and review, not trust.

Where they shouldn’t touch production

The cautionary tale everyone cites was reported in July 2025. According to eWeek, during SaaStr founder Jason Lemkin’s experiment with Replit’s coding agent, the agent ran destructive commands that erased a production database with records on 1,206 executives and over 1,196 companies — despite being told not to make changes without approval during a code freeze. Replit’s CEO called it “unacceptable” and the company responded with automatic separation of development and production databases, a planning-only mode, and one-click restores from backups.

Notice that every fix is an environment control, not a better prompt. “Please don’t touch production” is an instruction; a read-only credential is a guarantee.

dbt’s own docs make the same point about its MCP server: allowing a client to run dbt commands through MCP “could modify your data models, sources, and warehouse objects. Proceed only if you trust the client and understand the potential impact.”

A safe setup, step by step

1. Split tools by risk. Treat agent tools in three tiers:

  • Read metadata: lineage, model details, job run errors, docs. Safe to enable broadly.
  • Read data: running SELECT queries. Only against dev or a sampled, masked copy, with row limits and a read-only role.
  • Change things: run, build, triggering jobs, DDL/DML. Only in a dev or CI environment, never against production.

2. Enforce it in the database, not the prompt. Give the agent its own warehouse role with read-only grants on what it needs. If a tool claims to be “read-only”, check that the credential it uses can’t write anyway.

3. Make the output a pull request. The agent writes SQL, tests and docs into a branch. CI compiles the project, runs the tests, and a human reviews and merges. Production only changes through your normal deployment.

4. Ask for tests with every change. A good instruction for a transformation agent:

You are editing a dbt project in a development branch.
For every model you create or change:
- add or update schema tests (not_null, unique, relationships, accepted_values) for key columns
- add a description for the model and every new column
- run `dbt build --select <model>+` in the dev target and report the results
Never run commands against the prod target. If a step needs production access,
stop and explain what you need and why.

5. Log everything. Record which tools the agent called, with which arguments, under which role. When something looks odd in the warehouse, you want to know whether a person or an agent did it.

6. Have restores ready. Use your platform’s snapshots, time travel or backups, and test that you can actually restore. Agents don’t change this advice; they make it more urgent.

Trade-offs to be honest about

  • Review is the bottleneck. An agent can produce ten models an hour; a person can’t carefully review ten models an hour. Start with the tasks where review is cheap (docs, tests) before scaling up SQL generation.
  • Plausible but wrong. Agent SQL usually runs. The danger is a query that runs and returns subtly wrong numbers — a fan-out join, a missing filter, a timezone. Tests on row counts and key business metrics catch more than reading the code.
  • Context is the real work. Agents do much better with good metadata: descriptions, lineage, a semantic layer, examples of approved queries. The same documentation that helps new engineers helps agents.
  • Cost and latency. Multi-step agents over large schemas use a lot of tokens. Retrieval over metadata (as SCHEMORA does) is cheaper than pasting whole schemas into the prompt — and, per that paper, more accurate.

Where to start

  1. Start with documentation. Point an agent at your project’s lineage and code, and have it draft model and column descriptions as a pull request. Low risk, immediate value.
  2. Add test suggestions next. Ask it to propose data quality tests for your most important models, and review them like any other change.
  3. Create a read-only agent role in your warehouse, scoped to dev or masked data, before giving any agent SQL access.
  4. Use agents for shortlists, not decisions, on schema mapping: let them rank candidates, and have someone who knows the data choose.
  5. Keep every change on the branch-CI-review path. If an agent’s work can’t reach production without a human merge, most of the scary failure modes disappear.

data engineeringAI agentstext-to-SQLschema matchingdbt