cd /news/ai-agents/the-agent-refused-to-delete-our-dead… · home topics ai-agents article
[ARTICLE · art-136173] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

The agent refused to delete our "dead" backend. It was right.

A developer building SaaS products with AI coding agents reports that an agent refused a ticket to delete a supposedly dead legacy backend after verifying it held 192 applied database migrations and built two of five production container images. The engineer distilled five rules for agent-driven development, including requiring destructive tickets to state a belief and its source rather than a conclusion, verifying preconditions at approval time, and treating "present but reporting nothing" gates as a named defect class.

by read5 min views6 publishedSep 21, 2026

A few weeks ago I asked an AI agent to delete a directory from a live production repository.

The ticket described it as a dead legacy backend. The HTTP service it contained had been retired, the product ran on a newer backend written in another language, and removing the old one was the obvious first cleanup before handing the codebase over to a team of agents.

The agent didn't delete it. Its first instruction was to prove which component actually serves production, and it came back with evidence instead of a diff: the "dead" directory held 192 applied database migrations, the entire schema history of the live database, and two of the five production container images were built from it.

Deleting it would have destroyed the product. And the agent didn't save it by being clever. It saved it because a rule made it prove the belief before acting on it.

This post is about that rule and four others, each earned by something that went wrong while moving a live product, with real paying users, to a way of working where agents write all the code.

I've built several SaaS products with AI coding agents. Building them turned out to be the easy part. The hard question came after: how do you maintain and grow software that no human on the team wrote?

Every methodology I learned, from waterfall to Scrum, was built around one scarce resource: the time of skilled humans writing code. Sprints, story points, standups, velocity: all of it exists to coordinate something expensive and slow. When agents make code cheap, that scarcity disappears, and the difficulty moves to three places:

So I reorganized the work around those three, and then ran it on a real product. Here is what broke.

Covered above. The failure wasn't the agent's: the ticket stated a human conclusion ("this is dead") as a fact.

Rule: a destructive ticket (delete, drop, revoke, rewrite) states a belief and its source, never a conclusion. It starts with a discovery stage that changes nothing, and a human decides after seeing the evidence.

The backlog named a git tag as the rollback point for the whole cleanup phase. The tag had never been created. We only found out because an agent went to use it.

It happened again later, to me directly. I told the agent four preconditions were met: toolchain installed, remote configured, initial commit pushed, branch protection on. It checked. Three of the four were false.

Rule: every precondition a ticket names is verified to exist at approval time, not at execution time. And an agent never takes a human's word for it, including mine.

The repository's documentation described a make target that "refuses to push unless it passes". The target had no recipe. It existed only as a comment. Two CI workflows sat fully intact behind a manual-only trigger, so they never ran. Every document cited them as protection.

Then an agent wrote a new checker for us, and on its first run it returned failure on clean and dirty trees alike, while its cleanup trap wiped the evidence. It looked exactly like it was working.

Rule: "present but reporting nothing" is a named defect class. A gate is only considered installed once it has been seen to fail on a deliberately planted defect. Every document that cites a gate must name the trigger that fires it, and a liveness check fails loudly when an expected check hasn't run in its window.

Four agents drafting documentation produced eleven citations to sections that don't exist. One of them would have justified removing scheduled security and smoke checks that the process explicitly requires.

Rule: references are checked mechanically. The methodology's section index is machine-readable, a checker validates every reference, and the drafting error rate (about 3.4% of cited claims on the first measurement) is tracked like any other metric.

The inventory turned up live API keys for payment providers the product had stopped using long ago, some of them only in backup files. No rotation cycle would ever touch them, because the integrations no longer existed, and nobody was watching those vendor accounts.

Rule: revocation is a separate step from rotation, and it comes first. Kill every credential whose integration is gone, then rotate the ones still in use.

Looking back at all of them, none of these failures were invented by the agents. Every single one was a human belief written into an artifact as a fact, or a control that existed on paper.

The agents caught them because the process demanded proof rather than agreement. That changed how I think about reviewing AI work: the most valuable review isn't "is this code good", it's "what is this relying on that nobody has checked".

When I had one model audit the specification that another model wrote, it raised 130 findings. I then had each finding challenged by two independent refuters. Only 42 survived: a 68% refutation rate. A single-pass AI review would have been wrong two times out of three.

The spread by topic was even more useful. Findings about citations were refuted 27% of the time (mechanical: a reference resolves or it doesn't). Findings about gates were refuted 94% of the time (interpretive: the reviewer kept mistaking deliberate layering for a conflict). A review lens with a refutation rate that high isn't a strict reviewer, it's asking too broad a question.

I wrote all of this down as AICD (Artificial Intelligence Centered Development): a complete methodology for teams where agents write the code. Agents build, test, operate and document; engineers specify, verify, decide and supervise. The specification is the source of truth and code is a generated artifact. Roles are separated so the agent that writes code never judges it. Changes are tiered by risk, escalation has a protocol, every agent has its own scoped permissions, and there's a step-by-step procedure for migrating a product that already exists.

It's free, under CC BY 4.0: [https://github.com/rachidsahane/AICD-METHODOLOGY](https://github.com/rachidsahane/AICD-METHODOLOGY)

If you only read one part, read *Lessons from the first application*. If you have a vibe-coded app in production and wonder how to hand it to agents without breaking it, read *Migrating an existing product into AICD*.

If you're running agents on something real, I'd like to know what broke. That's more useful than what worked. Discussions are open on the repo, or tell me in the comments.
── more in #ai-agents 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-agent-refused-to…] indexed:0 read:5min 2026-09-21 ·