Contents
Agentic coding speeds up data analysis and building data pipelines considerably: coding agents write SQL queries, transformations, ETL jobs and analysis scripts, run them, check the results and correct themselves. At the same time, the risk here is especially treacherous – wrong data often looks just as plausible as correct data. This article shows how data teams use agents productively and safely.
Why data work suits coding agents well
Many tasks in data engineering and analytics are recurring, highly structured and easy to verify – ideal conditions for agents:
- Clear languages and patterns: SQL, Python with widely used data libraries and declarative transformation frameworks such as dbt follow established conventions.
- Fast feedback: a query can be run immediately; the agent sees the result and can improve it.
- Lots of routine: connecting new data sources, renaming columns, documenting models, adding tests – work that takes time but little creativity.
- Exploration: when analysing unfamiliar datasets, an agent can test many hypotheses quickly and summarise anomalies.
What matters is that an agent does not just write code but can also run it and check the result. This loop of writing, executing and verifying is what distinguishes agentic coding from a chat that suggests SQL you then have to test yourself.
Typical use cases at a glance
| Use case | What the agent handles | What to watch |
|---|---|---|
| SQL queries and reports | Writing, optimising and explaining queries | Check join logic and filters against business rules |
| Transformation models | New models, refactoring existing ones, documentation | Granularity and business logic must be right |
| ETL and ELT jobs | Connectors, load processes, error handling, retry logic | Idempotency, handling partial loads |
| Orchestration | Creating and adjusting workflows in tools such as Airflow or Dagster | Understand dependencies and schedules |
| Data quality tests | Tests for uniqueness, completeness, value ranges | Provide business rules, not just technical ones |
| Exploratory analysis | Examining datasets, statistics, visualisations | Critically check conclusions |
| Migrations | Moving pipelines between platforms or SQL dialects | Systematically compare old and new results |
The core risk: plausibly wrong data
Buggy code in an app often crashes visibly. A buggy data pipeline, by contrast, delivers numbers – just the wrong ones. A join that duplicates rows, a filter that forgets cancellations, a time zone that is ignored: without targeted checks, such errors often go unnoticed for a long time and feed into decisions.
Agents are particularly prone to this because they do not know your company's business logic. What counts as an "active customer", how revenue is defined or which test bookings must be filtered out is rarely written in the code. Three ground rules follow:
- Document business definitions and give them to the agent as context, for example in a glossary file in the repository.
- Set expectations upfront: which row counts, totals and value ranges are plausible? These expectations become tests.
- Reconcile results against known values: new pipelines must produce the same metrics for a reference period as existing, verified reports.
A proven workflow for data pipelines with agents
- Specification: write down source, target, granularity, business rules and acceptance criteria.
- Tests first: define data quality tests and expected results for sample data. The approach matches what we describe in agentic coding and test-driven development.
- Implementation in a development environment: the agent works against a copy with test or sample data, never with write access to production data.
- Comparison: reconcile results with reference values, have deviations explained and assess them from a business perspective.
- Review: a person with domain knowledge checks logic, joins and filters.
- Deployment via the pipeline: only reviewed changes reach production through CI/CD.
Data protection and access rights
In data work, the question of what gets sent to a cloud model is particularly relevant. When an agent runs queries and reads results, personal data can end up in the context. Keep the following in mind (this is not legal advice):
- Work with schemas and synthetic data: for many tasks the agent only needs the table structure and sample data, not real customer records.
- Restricted read access: access to development or anonymised datasets, no write access to production.
- Limit result sets: agent queries should default to limits and aggregations rather than full raw data output.
- Check the contractual basis: if personal data reaches the model provider, GDPR requirements such as data processing agreements and third-country transfers must be addressed.
More in our articles on AI coding tools and data protection and local LLMs for software development, which can be an alternative for highly sensitive data.
Exploratory analysis: the agent as analysis assistant
Beyond pipelines, agents are also useful for ad-hoc analysis. An agent can load a new dataset, describe distributions and outliers, create first visualisations and suggest hypotheses. That saves time in the exploration phase. The key is to keep roles clear: the agent provides material; a human is responsible for interpretation. Always have the agent output the queries and calculation steps it used, so results stay traceable and reproducible.
For data teams that want to learn this way of working in a structured manner, we offer workshops from 799 € net in which AI developers from real-world practice train agentic coding on your own data projects. Details are in our article on agentic coding workshops for data scientists and ML engineers.
Planning an app? Request a free fixed-price quote in 2 minutesConclusion
Agentic coding is a major lever for data analysis and data pipelines: SQL, transformations, ETL jobs and tests come together much faster. Because wrong data often goes unnoticed, however, it needs more safeguards than other areas: documented business definitions, tests before implementation, reconciliation against reference values, restricted access rights and a review by someone with domain knowledge. With these guardrails, agents become reliable partners for the data team.
Frequently Asked Questions
Can a coding agent access our production database directly?
We advise against it. Agents should work with development or anonymised data and at most restricted read access; changes reach production through the reviewed pipeline.
How do I spot wrong results from an agent-generated pipeline?
Through data quality tests, expected values defined upfront and reconciliation with existing, verified reports for a reference period.
Is agentic coding suitable for data scientists without deep programming skills?
Yes, especially for exploration and routine tasks. A basic understanding of SQL and data models is still needed to judge the results.
What information does an agent need to build good data pipelines?
Schemas, business definitions, naming conventions, sample data and clear acceptance criteria. The better this context is documented, the more reliable the results.