tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > ADK Agent Testing > Shadow Mode Testing for ADK Agents in Production

Shadow Mode Testing for ADK Agents in Production

Author: Venkata Sudhakar

Shadow mode testing runs a new ADK agent version in parallel with the production version on live traffic, capturing both responses without serving the new version to customers. ShopMax India uses shadow mode before every major agent upgrade to compare how the candidate agent responds to real order and search queries from Mumbai and Delhi customers - catching quality regressions on production traffic patterns that synthetic test suites do not cover.

A shadow router duplicates each incoming request, sends it to both the production agent and the shadow agent, records both responses, and computes a diff score. The production response is served to the customer; the shadow response is logged and evaluated asynchronously. Shadow test assertions run against the accumulated log at the end of a testing window, checking that the shadow agent's response quality is within acceptable bounds compared to production.

The example below defines a ShadowRouter that runs both agents for each request, collects side-by-side results, and asserts the shadow agent's mean quality score is no worse than the production agent's score minus a tolerance.


It gives the following output,

Prod mean quality: 0.750, Shadow mean quality: 0.750
1 passed in 0.04s

Run shadow mode for at least 24 hours to cover all traffic patterns including off-peak hours and burst periods during sales events. Set the shadow router to capture 10-20% of traffic to avoid doubling infrastructure costs. When the shadow agent consistently outperforms production (mean quality above prod + tolerance), use that as the promotion signal to flip the traffic split and promote the candidate to production.


 
  


  
bl  br