← All posts

Data Engineering · 7 min read

Agents for data pipeline incidents: triage before a human is paged

A failed run at 3 a.m. usually needs the same first hour of digging: read the logs, check what changed, walk the lineage. Here's how triage agents do that work, what the vendors shipping them actually describe, and how to keep them read-only until you trust them.

Subhash Nunna ·

Most pipeline incidents start the same way. A task fails, an alert fires, and someone opens five tabs: the task log, the DAG code, the last few deploys, the upstream tables, the run history. Half an hour later they know whether it’s a bad source file, a schema change, a timeout or a bug in last night’s merge.

That first half hour is reading and correlating — work an agent can do before anyone is woken up, as long as it only reads. This post looks at what pipeline triage agents look at, what the teams shipping them describe, and how to build a modest version yourself without handing an agent the keys to production.

(For the broader picture of where agents fit in data work, see our post on data engineering agents.)

What a triage agent actually does

Good on-call engineers look at the error, check what changed and what’s upstream, then form and test a guess. Triage agents encode the same loop.

Datadog describes the approach behind its Bits AI SRE agent (published January 2026) in three steps: “Formulate hypotheses about the root cause,” “Validate or reject hypotheses using data from targeted queries,” and “Repeat this process until it reaches a root cause.” Datadog’s write-up is about general infrastructure incidents rather than data pipelines, but its lesson carries over. An early version of their agent “issued 12 tool calls across logs, traces, and metrics” and still landed on the wrong root cause. The newer design focuses on the causal link between the alert and the telemetry for a specific hypothesis. More data in context didn’t help; testing a specific idea did.

Monte Carlo, a data observability vendor, described the same pattern for data incidents when it launched its Troubleshooting Agent in April 2025. Its agent “tests hundreds of different hypotheses across all relevant tables within a dataset,” grouped into categories such as bad source data, ETL failure, a mistake in transformation code, or incorrect model output, with “dozens of subagents investigating in parallel.” The sources it reads, according to Monte Carlo’s CTO, include data samples, metadata and query logs.

The inputs that matter

Across the products and samples published so far, the inputs are remarkably consistent:

Input What it answers Example from the sources
Task logs and error What broke, and where Every tool reads these first
Pipeline code Is the failure in our logic? AWS’s MWAA plugin pulls DAG source and operator scripts
Recent changes Did a deploy or merge cause this? Astronomer’s Otto reads recent deploys
Lineage and upstream runs Did something upstream fail or arrive late? Astro Observe scans upstream dependencies for failures
Run history and metrics Is this new, or does it happen every Monday? Otto reads run history and operational metrics
Data samples and query logs Is the data itself wrong? Monte Carlo’s agent reviews samples and query logs

Astronomer’s documentation for Otto, the investigation agent in Astro Observe, is a useful checklist. It says an investigation pulls “Airflow context (Dag code, task logs), Astro context (Deployment configuration, component logs, recent deploys), and Observe context (lineage, run history, operational metrics),” and returns “a root cause type, severity, suggested fix, and a checklist of Dag- and task-level checks.”

That output shape is worth copying: a category, a severity, a fix and the checks run — something on-call can verify in minutes.

Three levels of autonomy

The published examples fall neatly into three levels. Pick the level, not the tool, first.

1. On-demand diagnosis. AWS published a sample in September 2026 for Amazon MWAA (managed Airflow) that adds an “Analyze Task” button to a failed task. It sends task metadata, logs, DAG source and the relevant operator code (Glue or EMR scripts, SQL, Bash) to a model on Amazon Bedrock, and returns a “structured diagnostic report with root cause identification, step-by-step resolution, and prevention recommendations.” AWS says analysis “typically completes within 5–10 seconds.” It takes no action at all; a human reads the report.

2. Automatic investigation on alert. Astro Observe and Monte Carlo’s agent run when something fails or an anomaly fires, so the diagnosis is waiting when someone looks. Monte Carlo states its agents “never directly manipulate, change, or act upon your critical data and key systems (read-only).”

3. Diagnosis plus a proposed fix. Astronomer’s tutorial (labelled as a Labs feature) goes one step further. A failure alert triggers a second DAG that asks Otto for a diagnosis, fetches the failing file from GitHub, asks an LLM for “the smallest set of exact search-and-replace edits,” and opens a pull request “for your review.” The fix never reaches production without a human merge.

Levels 1 and 2 deliver most of the value with almost none of the risk.

Build a small one yourself

You don’t need a platform to try this. A minimal triage agent is a failure callback, a bundle of context and a strict output schema.

1. Trigger on failure. Use your orchestrator’s failure callback or alerting webhook. Pass the DAG ID, run ID and task ID.

2. Gather context deterministically. Don’t let the model decide what to fetch at first. Collect the last part of the task log, the task’s code, the commits to the pipeline repo in the last few days, the status of upstream tasks in this run and the last few runs of this task. AWS’s sample adds a nice touch: it only fetches external scripts when the error looks code-related, and skips that step for timeouts.

3. Clean the context. The AWS sample redacts credential patterns and truncates long scripts before anything goes to the model. Logs often contain connection strings and tokens; strip them first.

4. Ask for hypotheses, then a verdict. A prompt along these lines works well:

You are triaging a failed data pipeline task. You have read-only context below.
1. List up to 4 plausible root causes. For each, cite the specific log line,
   commit or upstream status that supports it, and what would rule it out.
2. Pick the most likely cause. If the evidence is weak, say "unknown".
3. Return JSON:
   {"category": "source_data | upstream_failure | code_change | infra | timeout | unknown",
    "severity": "low | medium | high",
    "evidence": ["..."],
    "suggested_fix": "...",
    "checks_for_human": ["..."],
    "page_now": true | false}
Never suggest re-running a task that writes to production without a human decision.

5. Post it where on-call will look. Attach the result to the alert, the ticket or the chat thread. Let page_now inform routing, but keep paging rules in your alerting system, not in the model.

6. Cache and deduplicate. One upstream failure can break twenty downstream tasks. AWS caches results by a hash of the error context; Astronomer’s tutorial skips work if an open PR for that DAG already exists. Both avoid paying for — and reading — the same diagnosis twenty times.

Guardrails

  • Read-only credentials. The agent’s role should be able to read logs, metadata and code, and nothing else. Monte Carlo’s “read-only” promise and AWS’s narrowly scoped bedrock:InvokeModel and s3:GetObject permissions are the right instinct. If you build level 3, Astronomer recommends “a scoped GitHub App” for production rather than a broad personal token.
  • Watch for loops. Astronomer’s tutorial warns that alerting on “All DAGs” can create an infinite loop if the auto-fix DAG itself fails. Exclude your triage pipeline from its own trigger.
  • Data samples are sensitive. Monte Carlo restricts data-sample access by role and lets customers disable it entirely. Decide whether your agent needs to see rows at all; metadata and query logs answer many questions.
  • Fixes go through review. Any change the agent proposes is a pull request with tests and CI, like any other change.

Trade-offs to be honest about

  • Accuracy is mostly unpublished. Vendors report time savings — Monte Carlo says its agents can “reduce the average time to resolve an incident by 80 percent or more,” and Datadog says Bits can “decrease time to resolution by up to 95%” — but neither gives a method or baseline, and none of the sources here publishes a root-cause accuracy figure. Treat these as claims, and measure on your own incidents.
  • Confident wrong answers cost time. A plausible but wrong diagnosis can send on-call down the wrong path. Requiring cited evidence and allowing “unknown” helps.
  • Evaluation takes work. Datadog’s approach is the one to borrow: it collected and labelled real incidents from hundreds of internal teams into a benchmark, and uses an LLM judge aligned with human judgments to score the agent’s conclusions. Even twenty labelled past incidents from your own pipelines will tell you more than any vendor number.
  • Context quality caps agent quality. Missing lineage and commit messages that say “fix” leave the agent little to correlate.

Where to start

  1. Pick your noisiest pipeline and collect the last 20 failures with the real root cause written down. That’s your evaluation set.
  2. Build level 1: a failure callback that gathers logs, code, recent commits and upstream status, and posts a structured diagnosis to the alert. Read-only, no actions.
  3. Score it against your labelled failures before anyone relies on it. Track how often it’s right, and how often it says “unknown” when it should.
  4. Move to level 2 — automatic investigation on every failure — once on-call engineers find the reports useful.
  5. Only then consider level 3, with fixes as pull requests from a scoped bot account, and never with write access to production data.

data engineeringAI agentsincident responseAirflowdata observability