AI Agent Shadow Testing: How to Stop Double Actions
AI agent shadow testing can trigger duplicate actions if done incorrectly. Learn how to safely test agents on live traffic without sending emails, changing data, or executing real actions.

In this article · 7 sections +
A popular way to test AI agents on live traffic can quietly double their real-world actions. Raju Dandigam, a Staff Software Engineer at Navan, raised the alarm in a technical breakdown on HackerNoon on October 24, 2026.
His example lands hard. A team runs a new agent in shadow mode beside the production one. Both read the same customer request. Then both call send_email. The customer receives two real messages, and a safe experiment turns into an incident.
Dandigam places the fix in architecture, not prompts. A shadow agent can copy the production agent’s thinking. It should never copy its power to act.
An Old Testing Habit Meets a New Failure
Web teams have mirrored traffic to new services for years. They copy requests, discard the responses, and compare logs. The trick works because a copied read harms nobody.
AI agents that take actions break that rule. They refund invoices, update records and message customers. The gap between AI tools and agents shows up right here: a tool returns an answer, while an agent changes something. Run the whole app twice, and every tool call fires twice.
The pressure keeps rising. Teams on orchestration frameworks like CrewAI swap prompts, models and routing logic often. Offline test sets rarely catch the odd phrasing and timing real users bring. So teams turn to live traffic, and the risk follows them.
Decide in Two Places, Act in One
Dandigam splits every agent into stages: input, decision, policy check, and tool execution. The shadow copy stops after its decision and a simulated policy check.
The model never holds a live tool. Instead, the system turns each choice into a structured proposal. That proposal names the action, its arguments, and a short reason code, such as invoice_overdue. Only the primary executor runs proposals, and only after real policy approves them.
Dandigam also rejects collecting hidden chain-of-thought. Short reason codes stay easy to review. Teams should treat any free-text explanation as untrusted and redact it.
Take the Keys, Not Just the Flag
Many teams lean on a dryRun: true flag. Dandigam calls that fragile. One tool ignores the flag, a refactor drops it, or a new tool defaults to live mode.
He prefers a separate shadow tool registry. The candidate sees the same tool names and schemas, so it reasons normally. Those tools, however, carry no execute method. When the shadow pickssend_email, the harness simply logs the arguments.
Infrastructure adds a second wall:
- No production write tokens
- No direct path to effect-triggering message brokers
- Read-only or synthetic dependencies
- Hard spend and concurrency caps
- A kill switch that ignores model behavior
A buggy check can slip through. An identity without write keys can’t.
Context shrinks too. Rather than copying full production prompts, Dandigam feeds the shadow a trimmed, privacy-reviewed view: request type, locale, account tier, and recent event codes.
Judge the Choice, Not the Wording
Two strong agents can explain one decision in very different words. That makes text similarity a weak release gate. Dandigam compares structured behavior instead, and he flags these gaps first:
- Production stays silent, but the candidate proposes a write
- Production asks for approval, but the candidate expects a green light
- Both pick one tool, yet amount, recipient, or scope differ
- The candidate calls a forbidden or made-up tool
- The candidate blows its latency, token, or tool-call budget
That approach matches Google’s Agents CLI evaluation guide, which scores tool use, trajectory, grounding and safety separately.
Policy checks for the shadow run in simulate mode. They can’t mint approval tokens, reserve stock or touch the real audit log.
Hidden Traps in the Numbers
Teams often shadow only simple requests. The dashboard then glows green because risky traffic never entered the test. Dandigam wants every exclusion logged and results split by action type, risk level and language.
Randomness skews results as well. One run per agent says nothing about variance, so he repeats candidate trials under fixed settings. He also warns against pass marks that merely look rigorous. Product risk and baseline data should set them.
One Rung on a Longer Ladder
Shadowing sits fourth in his six-step release path. Static checks, offline replay, and repeated evals come first. A canary and a gradual rollout follow.
He adds a twist. The production agent isn’t always right. A candidate that disagrees might be the better agent, so humans should review real disagreements.
Every shadow run should also prove zero external writes, zero real approvals, and zero published messages. If telemetry can’t confirm that, the test pauses.
Why the Shift Reaches Past Testing
The breakdown points at a larger trend. Agent safety now hinges less on how a model behaves and more on what it can touch. Builders keep relearning that lesson with packaged agent skills, where one loose permission turns handy automation into risk.
The proposal-policy-execution split pays off twice. The same seam makes human approvals testable and gives auditors clear evidence.
Teams should still question “read-only” tools. Pulling from a queue can consume a message, and every API call burns quota.
The takeaway fits on a sticky note. Let the shadow think in parallel, but keep one agent, and only one, at the controls.
Related: What Are Specialized AI Agents? A Practical 2026 Guide



