Playwright to AI Agent Migration (Part 1): The Assessment Matrix

Not every module is worth migrating to AI. Three evaluation dimensions: operation stability, structural change frequency, exception handling cost. Data-driven decisions, not intuition.

16Yun Engineering TeamMay 6, 20262 min read

Why You Need an Assessment Matrix

When people hear "AI browser agents," the first impulse is "replace all Playwright scripts with AI." Understandable but wrong.

In our experience, full replacement leads to two outcomes:

  • Both systems running — AI version built, scripts kept "just in case," double maintenance
  • AI version abandoned — simple operations became unreliable with AI, switched back, migration effort wasted

A better approach is progressive migration. First step: which modules should move first, which shouldn't move at all.

Three-Dimension Assessment Matrix

Dimension 1: Operation Stability (1-5)

ScoreMeaningExample
5100% reliableFixed URL, stable selector
4<5% failureLogin with occasional CAPTCHA
35-20% failureSearch results sort order varies
220-50% failureForm fields vary by user type
1Very unreliableWeekly page redesign

Dimension 2: Change Frequency (1-5)

ScoreMeaningExample
5YearsInternal system standard form
4OccasionallyStandard SaaS page
3MonthsE-commerce redesign
2MonthlyA/B test heavy pages
1ConstantlyDynamic content pages

Dimension 3: Exception Cost (1-5)

ScoreMeaningExample
5Zero, auto retryRead page title
4Low, retry a fewTimeout retry
3Medium, manual checkData inconsistency
2High, human neededForm submission failure
1Critical, business impactPayment error, data loss

Example Assessments

Task A: Login to internal system
  Stability: 5 | Change: 5 | Exception: 4
  Score: (5-5)+(5-5)+4 = 4 → "keep_script"
 
Task B: Extract price from e-commerce
  Stability: 3 | Change: 3 | Exception: 3
  Score: (5-3)+(5-3)+3 = 7 → "hybrid"
 
Task C: Process various supplier order formats
  Stability: 2 | Change: 1 | Exception: 2
  Score: (5-2)+(5-1)+2 = 9 → "prefer_ai"
 
Task D: Scrape government announcements
  Stability: 1 | Change: 1 | Exception: 2
  Score: (5-1)+(5-1)+2 = 10 → "strong_ai"

Three Migration Strategies

keep_script → No migration. Scripts work fine.
hybrid → Scripts primary, AI for exceptions. Bridge layer auto-switches.
prefer_ai / strong_ai → AI primary, scripts for optimization.

Summary

The assessment matrix core idea: not every scenario needs AI agents. Each scenario has its appropriate automation degree.

High stability, low change, low exception cost? Keep scripts. Low stability, high change, high exception cost? Migrate to AI first. Middle ground? Hybrid — scripts and AI collaborate in the same task flow.

Need an enterprise proxy plan?

We can tailor architecture to your target domains, concurrency, and reliability goals.