DEV Community

Cover image for Don't Trust the Agent. Trust the Factory.
Remo H. Jansen
Remo H. Jansen

Posted on Edited on

Don't Trust the Agent. Trust the Factory.

The path to reliable agentic engineering is not waiting for models to stop making mistakes. It is building a delivery system that catches those mistakes before they become incidents.

When engineers hear that a team wants to delegate more work to coding agents, they often raise a reasonable objection:

These models are probabilistic. They make things up, miss requirements, and sometimes produce code that looks right but isn't. How can we automate more of software development on top of that?

They're right about the risk. An agent can misunderstand a requirement, implement the wrong behavior with complete confidence, or write a test that confirms its own mistake. Better models can lower the chance of these failures, but they cannot make that chance zero.

The mistake is assuming that the agent itself has to become perfectly reliable before we can delegate meaningful work to it.

It doesn't.

Reliability is a property of the system

We already build software systems on top of fallible components. Networks time out. Processes crash. People make mistakes. We don't respond by demanding that every component become infallible. We add timeouts, retries, health checks, constraints, monitoring, and recovery paths.

We can take the same approach with agent-authored changes. The useful question isn't:

Can I trust this agent?

It's:

What evidence does this change have to produce before it can affect users, and what happens if that evidence misses something?

That question moves trust away from the agent's confidence and toward the system that handles its work. The agent proposes a change. The factory evaluates it, limits how far it can travel, watches what happens, and gives us a way to respond.

By factory, I mean the connected delivery process around a change: from expressing what should happen, through checks and deployment, to production feedback and recovery. It isn't just a CI pipeline, and it isn't a promise that a green build means the software is correct.

A change should earn its way to production

Imagine an agent asked to add a new rule to a payment workflow. It changes the implementation and adds tests. The code compiles. The tests pass.

That is useful evidence, but it is not enough if the tests were derived from the implementation rather than from the intended behavior. The agent may have made the wrong interpretation and captured that interpretation in both the code and the tests.

So the factory needs independent signals. The requirement or acceptance criteria should describe the behavior we want. Tests should check that behavior, not merely mirror the implementation. Types, static analysis, and build checks can catch other classes of mistakes. A review or policy gate can be required when a change touches a sensitive area.

Then deployment can limit the consequences of what escaped those checks. A small rollout can expose a problem before every user sees it. Production signals can detect an unusual error rate. A rollback or kill switch can stop the change from continuing to cause harm.

No single step is magic. The point is that each step has a defined job, and the change must pass through the system rather than relying on someone feeling reassured by a polished explanation.

Deterministic gates are useful, not omniscient

This is where the word deterministic needs care. A policy check can consistently reject a forbidden dependency. A test can consistently fail when a specified behavior is broken. A deployment rule can consistently prevent a rollout from continuing past a threshold.

But repeatability is not the same as correctness. A test can assert the wrong thing. A threshold can be poorly chosen. Monitoring can miss a new failure mode. Even a factory with many green checks can have blind spots.

That doesn't make the factory pointless. It tells us what it must do: make its assumptions visible, use independent layers of evidence, and improve when a defect gets through. If a customer reports a failure that the checks missed, that should lead to a better test, a more useful production signal, or a safer rollout rule—not just a reminder to "be more careful next time."

The goal is not to prove that every change is perfect. The goal is to make failures less likely to escape, less damaging when they do, and faster to detect and correct.

Delegation isn't the same as unchecked authority

Some people hear "delegate to agents" and picture a model changing production code and shipping it without oversight. That is not the only form of automation.

We can delegate the work of exploring a codebase, implementing a well-scoped change, adding tests, and responding to failed checks without delegating every decision about risk. A low-risk change with clear requirements and strong coverage might pass through an automated path. A change to payments, permissions, or data deletion might require additional review or a staged rollout.

The factory can apply different controls to different kinds of change. That is more useful than either extreme: manually scrutinising every line an agent writes, or treating a passing test suite as permission to ship anything.

Human judgment still matters. People define what the system is supposed to do, decide which risks are acceptable, and improve the checks when reality proves them incomplete. But people shouldn't have to re-derive the safety of every routine change from scratch. That's what repeatable verification is for.

The factory makes improvement compound

Without a factory, every agent mistake becomes a reason to distrust the next agent change. Engineers have to inspect everything manually, so the agent's speed simply moves the bottleneck to review.

With a factory, an escaped mistake can strengthen the system. A bug becomes a regression test. A production pattern becomes an alert. A risky category of change gets a new policy or rollout step. The next agent—not just the next human—benefits from that work.

I've written before about tests as the feedback loop that lets agents move quickly and about verification as a recurring cost of software. This is the broader operational version of that argument: tests matter, but trust comes from the whole loop, including what happens after deployment.

The measure of progress is not how often an agent gets its first answer right. It is how much useful work we can safely delegate because the system can tell us when an answer is wrong, contain the impact, and help us recover.

Agents will keep making mistakes. Our job is not to pretend otherwise, or to wait for a model that never does. Our job is to build a factory in which mistakes are expected, observable, and survivable.

That is how we make agent-authored changes safe enough to ship.

Top comments (0)