Getting Your First Agent Live

Shadow Mode: Testing AI Agents on Live Traffic Before Production

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor
5 min read
Abstract illustration: Shadow Mode: Testing AI Agents on Live Traffic Before Production

Shadow mode testing AI agents means running a candidate version on every incoming request while blocking it from taking any real action. The live agent still responds and acts; the shadow agent observes, reasons, and records, but its outputs go only to your evaluation layer. Teams that use this pattern before full rollout see roughly 40% fewer production incidents compared to those that skip it.

What Shadow Mode Actually Does

The shadow agent receives an identical copy of each request, runs its full reasoning pipeline, and writes its proposed action to a log. Nothing reaches an external API, a database write, or a customer-facing surface. Your evaluation layer then compares the shadow agent’s proposed action against what the live agent actually did, or against a human-labeled ground truth set.

This separation matters because real production traffic contains patterns your synthetic test sets miss: ambiguous intents, malformed inputs, edge cases that only appear at scale, and the long tail of user behavior that no staging environment reproduces. Running on 100% of live traffic for days or weeks gives you a far larger and more representative sample than any pre-deployment benchmark.

For a deeper look at what drives agent decision-making, see the guide on how AI agents work.

Shadow Mode vs. Canary Deployment

Canary deployment routes a percentage of real users, often 1% to 5%, to the new agent version. If the new version misbehaves, those users experience the failure. Shadow mode routes all traffic to both versions but only the live version acts. The tradeoff is cost: you run two agents simultaneously, which approximately doubles inference spend for the duration of the test.

flowchart TD
    A[Incoming request] --> B[Live agent]
    A --> C[Shadow agent]
    B --> D[Executes action]
    C --> E[Logs proposed action only]
    D --> F[User sees response]
    E --> G[Evaluation layer]
    G --> H{Metrics pass?}
    H -- Yes --> I[Proceed to staged rollout]
    H -- No --> J[Iterate on candidate]

The higher cost is the reason teams typically run shadow mode for days rather than weeks, and why the evaluation layer has to be fast enough to surface signal during that window.

The Architecture Pattern

Three components make shadow mode work: a request fan-out layer, a shadow execution environment, and an evaluation store.

The fan-out layer intercepts each request after authentication and sends a copy to the shadow agent. The shadow execution environment mirrors the live agent’s tool access but with all write operations stubbed or redirected to a dry-run endpoint. If your agent calls an order management API, the shadow version calls a mock that returns a realistic response without touching the order database.

The evaluation store records tuples of the live agent’s action, the shadow agent’s proposed action, and the input that produced them. Your evaluation layer queries this store to compute agreement rate, divergence type, and confidence distribution. Teams shipping multi-agent systems sometimes run shadow mode at the orchestrator level only, leaving sub-agents unchanged, which reduces cost while still catching routing and planning errors.

flowchart TD
    A[Request fan-out] --> B[Live agent, full permissions]
    A --> C[Shadow agent, write ops stubbed]
    B --> D[Action log]
    C --> E[Proposed action log]
    D --> F[Evaluation store]
    E --> F
    F --> G[Agreement rate]
    F --> H[Divergence classifier]
    F --> I[Confidence distribution]

What the Evaluation Layer Has to Measure

Logging disagreements is not enough. You need a classifier that sorts divergences into categories: the shadow agent chose the same action with different parameters, chose a different action that would have been acceptable, or chose an action that would have been harmful or incorrect. Only the third category is a blocker.

Georgia Southern University’s admissions agent, GUS, processed over 300,000 real student inquiries during its first two months in production while shadow evaluation ran in parallel. The team reported 94% accuracy against ground truth, which gave them the confidence to expand integrations across Slate, Banner, and PeopleSoft without a phased user rollout. The volume of real traffic was what made that accuracy figure credible; a 500-question eval set would not have surfaced the edge cases that appeared in messages 50,000 through 300,000.

For a structured approach to building this layer, the guide on how to evaluate AI agents covers scoring rubrics and human review workflows.

Cost and Benefit Tradeoffs

Doubling inference cost is the most common objection. The calculation changes when you account for the cost of a production incident: rollback engineering time, customer support load, and, in regulated industries, potential compliance exposure. According to a Gartner Q1 2026 survey, 80% of enterprises now have at least one production application embedding an AI agent, up from 33% in 2024. At that penetration rate, a misbehaving agent is not a contained experiment; it affects real workflows at scale.

Klarna’s customer support agent, which operates across 23 markets in 35 languages, encountered quality problems after its initial full deployment in February 2024. The team subsequently implemented shadow testing and human-in-the-loop gates before expanding. By Q3 2025, the agent automated 67% of chats, cut response times by 82%, and delivered $60 million in annual savings. The quality gates added time upfront and removed far more time in remediation.

Auchan Retail ran a similar pattern before full deployment of its customer support agent, using shadow testing to measure accuracy and escalation rates. The resulting production deployment resolved 6,000 support tickets and improved SLA compliance by 40%, without adding headcount.

When to Gate on Rollout

Shadow mode is an observation phase, not a deployment gate on its own. The gate comes from your evaluation layer. Define your pass criteria before you start: for example, action agreement rate above 90%, harmful divergence rate below 0.5%, and confidence distribution stable across three consecutive days of traffic. When the candidate version meets those criteria across a representative volume, you are ready to move to a staged rollout.

Snowflake structured this as an explicit phase gate. Before moving from pilot to beta and from beta to general availability, the team ran the shadow agent against 150 questions from real sales workflows. The GTM AI Assistant reached 6,000 internal users by the end of 2025 and was handling 35,000 questions per week, with NPS above 92% in beta.

For teams building the governance layer that sits around this process, runtime governance vs. pre-deployment review covers where each control type fits. Agent observability explains what to instrument so your evaluation store gets reliable data. If you are working out which framework to build on, LangGraph deployment and the agentic AI architecture guide cover the infrastructure decisions that determine how easy fan-out is to implement.

Tools like Prefactor sit in this category, providing the evaluation and observability layer that makes shadow mode data actionable rather than just voluminous.

For the broader governance controls that should accompany a shadow-to-production workflow, see the guide on AI agent governance.

Where to Start

If you are preparing your first agent for production, the right starting point is an honest assessment of your current readiness across traffic handling, evaluation infrastructure, and rollout gating. Take the agent readiness assessment to identify which gaps to close before you stand up your shadow environment.

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — evaluation, observability, governance, and the plumbing assistants never needed.

Frequently asked questions

What is shadow mode testing for AI agents?

Shadow mode testing runs a new agent version against 100% of real production traffic while suppressing its actions, so you can compare its decisions to the live agent's without affecting users or downstream systems. It differs from canary deployment, which routes a fraction of real users to the unproven version and exposes them to its mistakes.

How much does shadow mode reduce production incidents?

According to a December 2025 Agent Reliability Engineering analysis, organisations that use shadow mode deployment see approximately 40% fewer production incidents compared to teams that skip the pattern and go straight to staged rollout or full cutover.

How did Snowflake use shadow testing before its GTM AI Assistant launch?

Snowflake's team ran shadow testing against 150 questions drawn from actual sales workflows before each phase gate in the rollout. The assistant reached general availability in September 2025, scaled to 6,000 internal users by year-end, and recorded over 92% NPS in beta.

When should you move from shadow mode to a canary or staged rollout?

Move to a staged rollout when your evaluation layer shows the shadow agent matching or exceeding the production agent on your agreed quality metrics across at least several days of representative traffic. A single passing evaluation run is not sufficient; you want stability across volume spikes, edge-case query types, and any time-of-day patterns that matter to your workload.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.