Which Pipeline Failures Can an AI Agent Safely Auto-Fix, and Which Need a Human?
A four-tier autonomy guide for Airflow, dbt and Dagster failures, sorted by reversibility and blast radius
An AI agent can safely apply a pipeline fix on its own when the fix is idempotent, reversible and limited to the work that already failed. Re-running a failed dbt node with dbt retry is the clearest example. Anything that changes data contracts, permissions or the meaning of a metric needs a human decision first. We sort failures into four tiers, from observe-only to human-only, so you can set autonomy per failure class instead of per tool.
Key Takeaways
- •Diagnosis is mature; autonomous remediation is safe only for narrow, reversible cases, and the rest should wait for approval.
- •Auto-apply a fix only if it is idempotent, scoped to the failed work and undoable, which is true of retries, single-partition reruns and resuming from the failure point.
- •Fixes that change schemas, model logic, permissions or PII handling belong in an approval tier, and deletes or grants belong with a human.
- •Set autonomy per failure class, not per tool: the same agent can run Tier 1 unattended and Tier 3 never.
- •Retry limits and delays must be set by the platform policy, never chosen by the model at run time.
Why the question is about fixes, not diagnosis
Public write-ups on self-healing pipelines tend to agree on one point: detecting and explaining a failure is largely solved, while autonomous remediation is limited to narrow cases that carry an approval step, as this DZone overview of self-healing data pipelines describes. That matches what we see. Root-cause analysis over logs, lineage and query history is read-only, so it carries almost no risk. Writing a fix back into production is a different category of action.
The useful question is therefore not whether an agent is smart enough to fix a failure. It is what happens if the fix is wrong. A wrong retry costs compute. A wrong schema change can corrupt downstream tables, and a wrong grant can expose PII. Risk follows the consequence of the action, and the model's capability does not change that.
This is why we treat autonomy as a dial per failure class. Our Incidents Agent can diagnose any failure, but what it is allowed to do afterwards depends on the tier the failure falls into. The four tiers below give you a starting policy you can tighten or loosen with your own incident history.
Step 1: Apply three tests to every candidate fix
Before assigning a tier, run each candidate fix through three tests. First, is it idempotent: if the agent applies it twice, is the end state the same? Second, is it reversible: can you restore the previous state quickly and completely? Third, is it scoped: does it touch only the failed task, model or partition, rather than shared tables, other teams' data or access rules?
A fix that passes all three can run unattended. A fix that fails one needs a human in the loop, and a fix that fails two or more should usually stay with a human entirely. The tests are deliberately mechanical, so you can encode them as policy rather than relying on someone's judgment at 3 a.m.
The tests also expose a common trap. Many fixes look small but fail the scope test. Re-running a backfill sounds like a retry, yet if it overwrites a table that three other pipelines read, its blast radius is much larger than the failed task. Ask what a fix touches, not how many lines it changes.
Step 2: Tier 1, auto-apply reversible retries and resumes
Tier 1 covers failures where the cause is transient or the failed work can simply be repeated. Examples include a timeout against a busy warehouse, a flaky upstream API, a worker evicted mid-task, or a dbt run that failed on one node. The platforms already model this. In the dbt docs, a five-model example run fails on one node (PASS=4 ... ERROR=1 ... TOTAL=5), and `dbt retry` rebuilds only that node (PASS=1 ... TOTAL=1) instead of the whole project.
Orchestrators work the same way. Airflow's task documentation shows a retry policy example with retries=5 and a one-minute retry_delay, and it notes that by default Airflow retries failed tasks with a fixed count and delay regardless of the error type. Dagster's run retry settings default to a FROM_FAILURE strategy, which resumes at the failed step rather than starting over.
The agent's job in Tier 1 is to classify the error first, then apply the platform's own retry mechanism. It should not invent a retry loop. Retry counts and delays come from policy you set, because a model choosing its own delay can hammer a struggling warehouse. Tier 1 actions are logged, but no one is paged.
Step 3: Tier 2, propose the fix and wait for approval
Tier 2 holds fixes that are likely correct but change something durable. Typical cases are a source column that was renamed upstream, a dbt model that needs a cast or a null-handling tweak, a backfill across many partitions, a warehouse resize, or a changed schedule. The agent can prepare the change completely: the diff, the affected downstream models, a test run in a development schema and a rollback plan. It stops before applying it.
The approval gate should present the evidence rather than a summary. A reviewer needs the failing query, the lineage impact, the proposed change and what was already verified. When we ask a Schema Agent for the blast radius of a change, the answer arrives with the downstream tables and dashboards listed, so the approver is checking facts rather than trusting a narrative. If you run Airflow, our guide on human approval and safe retries in Airflow covers the gate mechanics.
Tier 2 is where most teams should start expanding autonomy. After a few months of approvals, you will see which proposals are approved unchanged every time. Those are candidates to promote to Tier 1, with a narrower scope than the original class. Promotion should be driven by the approval record, not by confidence in the model.
Step 4: Tier 3, keep these with a human
Tier 3 covers actions an agent should never apply on its own, however good its diagnosis. Dropping a column or table, deleting or truncating data, granting or revoking access, changing PII classification or masking rules, editing a metric definition that finance reads, and altering retention all belong here. Each is either irreversible, wide in scope or a governance decision rather than an engineering one.
The agent still does useful work in this tier. It can diagnose, quantify the impact and draft the change request, then route it to the owner. For example, when someone asks 'What's the blast radius if I drop this column?', the agent returns the dependent models and queries, and the human decides. That keeps the expensive judgment with the person accountable for it.
Governance metadata is a good illustration of why this tier matters. Snowflake, for instance, allows a maximum of 50 tags on a single object, and those tags often drive masking and access policy. An agent that edits tags to make a failing job pass could silently weaken a data protection rule, so tag and policy edits sit at Tier 3.
Step 5: Encode the tiers as policy and measure them
A tier list in a wiki does not constrain an agent. The policy has to be enforced where the action happens: the tool layer. Every write capability should declare its tier, and the runtime should refuse a Tier 2 or Tier 3 action without a recorded approval. In the OSS edition of Data Workers (dw-claw) the agents are read-only by default, so nothing here is applied until you deliberately enable writes. Pro adds writes with approval workflows and audit trails.
Then measure the tiers. Track how many incidents each tier handled, how often Tier 2 proposals were approved unchanged, how often a Tier 1 fix had to be rolled back, and the time from failure to resolution. In our early pilot testing, 60% of incidents auto-resolved before human notification, which is our own pilot figure and not an industry benchmark. Your number will depend on your failure mix, which is the reason to measure it.
Review the tiers on a schedule. A failure class that never needed a rollback for a quarter may deserve promotion, and one that caused a near miss should be demoted at once. The Orchestration Agent coordinates the hand-offs between diagnosis, schema analysis and the Pipeline Agent, so the tier decision is made once and applied consistently across the swarm.
A quick reference by failure type
| Failure | Default tier | Why |
|---|---|---|
| Transient timeout or evicted worker | Tier 1 | Idempotent, scoped to the failed task, reversible by re-running |
| One failed dbt node after a transient error | Tier 1 | Resume from the failure point, nothing upstream is rebuilt |
| Upstream column renamed | Tier 2 | Likely fix is clear, but it changes a model other teams read |
| Large multi-partition backfill | Tier 2 | Costly and overwrites data, so the scope needs review |
| Warehouse resize or schedule change | Tier 2 | Changes spend and downstream timing |
| Drop column or table | Tier 3 | Irreversible and wide blast radius |
| Grant, revoke or PII policy change | Tier 3 | Governance decision, not an engineering fix |
Frequently Asked Questions
Can an AI agent safely retry a failed Airflow task?
Yes, when the task is idempotent and the retry uses the orchestrator's own policy. Airflow already retries with a fixed count and delay, so the agent's added value is classifying the error and deciding whether a retry makes sense at all. A schema mismatch will fail again identically, and retrying it only wastes compute and delays the real fix.
Is it safe to let an agent change dbt model SQL?
Not unattended. A model change alters the data other teams consume, so we place it in Tier 2. The agent should open the change as a proposal with a tested diff and the list of downstream models, and a human should approve it. Resuming a failed run with dbt retry is different, because it does not change any logic.
How do we decide when to promote a fix from Tier 2 to Tier 1?
Use the approval record. If a narrowly defined fix class has been approved unchanged many times, never rolled back, and passes the idempotent, reversible and scoped tests, promote that specific class with a tight scope. Do not promote a whole category because the model sounds confident. Keep the ability to demote immediately after any near miss.
Do these tiers work in Dagster as well as Airflow and dbt?
Yes. The tiers describe the consequence of the action, not the tool. A Dagster run resumed FROM_FAILURE is Tier 1, while a change to an asset's definition or its partitions is Tier 2. Because Data Workers agents are MCP servers, the same policy applies whether you invoke them from Claude Code, Cursor or another MCP client.