}

A new automation often gets to write from day one. That is a problem. Its first mistake happens at the customer. A wrong order confirmation goes out. A booking lands in the TMS with the wrong reference. The job itself reports success. It ran without an error. Only the decision was wrong. No exit code shows that.
My rule since this summer: shadow mode first. Go-live second. That applies to every new automation that replaces a dispatcher's decision. It reads everything it would read later. It makes its decision. It writes nothing. Every run gets compared against what the human actually did.
A program with no exception has proven one thing. It runs. Nothing more. It has not proven the order number was correct. Or that the notice went to the right contact. Or that the load matched the right truck. That check needs a second truth to compare against. For a new automation, that truth almost always exists. It is what the dispatcher does anyway.
That is what shadow mode uses. The agent reads mail, PDF, portal. Just like in real operation. It makes its decision. It logs it. Then it stops. The human keeps working in parallel. Unchanged. They notice nothing from the agent. At the end of a day, two rows sit side by side. What the agent would have decided. What happened. Every mismatch is a case for the list.
A number like "94 percent match" sounds reassuring. And it hides the important part: which 6 percent, and why. Every deviation gets a reason at our end. Machine-readable, no free text. Three categories cover most cases.
First, a data problem. The PDF had a layout the agent did not know. Or the order-number field was empty. That is a rule gap in the agent, not a real disagreement.
Second, real judgment. The dispatcher decided differently, for a reason not in the data. A phone call with the customer the day before, for example. These cases mark the edge of what can be automated. They belong in the escalation logic. Not a reason to make the agent smarter.
Third, a human error. It happens, more often than people think, at 300 orders a day through one pair of hands. Shadow mode catches these cases on the side. It is the one observer that compares every single case.
Only the first category should block go-live. The second belongs in the rulebook for escalation. The third is a find for the customer. Not a reason to doubt the agent.
"We are testing for now" and real shadow mode are two different things. The difference is a switch. In our wrapper it sits in front of every write action (R15, wfm_fallback). Before a mail, a portal booking, a TMS update. While test_mode is on, the full decision path runs. Right up to the point where a mail would go out. There, the pipeline logs the planned action instead. Then it stops. The rest of the run matches the real version exactly. That is the point. A separate, simplified test path tests the wrong version.
The gate also guards against a relapse. A developer sets test_mode=False by mistake in a side branch. The main branch is still under review. Without this switch, the side branch would write live, unnoticed. The switch in the wrapper gives one place for that state. Visible in the monitor, for every run.
A deviation rate under the threshold shows one thing. The agent decides correctly on normal cases. It does not show how it behaves when something breaks. A new error code from the portal. A dropped mail connection. A damaged PDF file. Such cases rarely show up on their own in shadow mode. Real systems work most of the time.
So a second step sits before go-live. Fault injection. You create the failure cases on purpose. In a test environment, with the same modules as production. An empty portal search result. A dropped SMTP handshake. A PDF with swapped columns. For every failure, one rule applies (R15b). The agent must land in the fallback path. Not run on silently. Not crash. An agent can get ninety clean cases right. Send a wrong mail on the first broken record, and it only passed shadow mode. Not the real test.
Only after both hurdles does the write path open. Deviation rate under the threshold, over a fixed period. Every fault-injection case landed in the right path. And then only for a small first batch of real cases. Not the whole book. A ramp of a few orders a day follows. The last step before full rollout. Still watched, as before.
The monitor shows three things during shadow mode. Not just running or not running. First, the rate over the last seven days. And the last fourteen. So one bad day does not skew the picture. Second, the list with reasons, sorted by the three categories above. Third, the gate's own status. test_mode on or off, since when. Who last changed it. That third field looks minor, until it is missing. Then it is the difference between a plan and an accident.
Zero deviations are no reason for concern. As long as the number of cases checked holds up. A different failure: zero deviations at zero cases checked. Shadow mode itself has stopped working. Unnoticed. Same idea as the step protocol: a run with no result is an outage, not a quiet success. So the shadow phase gets its own target number per run too.
We run one of our own automations on exactly this pattern. For inbox triage in our own operation, not at a customer. Over fourteen days, 329 runs. 3,790 cases evaluated in total. The decision source splits into four categories. 1,510 cases through the fixed rule layer. 1,564 through the model. 459 through added context. 257 through escalation to a human. Of the 3,790 cases: 1,849 would have gone out as a proposal. If the write path had been open. None of them actually went out. Test mode for this evaluation stays closed. These numbers show one thing. What shadow mode delivers before it gets to do anything. A solid sense of scale, how often the agent would even act. Not one case went live in production.
Shadow mode only works with a reliable second truth to compare against. For a completely new process, that reference is missing. Nobody did it manually before. The deviation rate cannot be calculated then. What is left is the fault-injection check. And a careful, small ramp from the start. And a low deviation rate proves only one thing. Agent and human agreed during those two weeks. It proves no more. The rare case in month three can still go wrong. So the target-actual check stays active after go-live too. Just on a smaller sample, not as a one-time test before the start.
Which process in your dispatch office would get automated next? How would you check for two weeks whether the agent decides like the human does? Without the customer noticing anything. Name me the process. I will show it on our logistics monitor. A list like that, with reasons. And how the gate backs it up. On the choice of script or agent: the post AI agent or RPA. On guarding a running agent against silent portal changes: the post Detecting portal changes.