Regression Testing an Agent After a Model or Prompt Change
A model bump or prompt edit is a behavior change with production blast radius. Use this cheatsheet to catch quality, cost, safety, and wiring regressions before users do.
Search across all documentation pages
A model bump or prompt edit is a behavior change with production blast radius. Use this cheatsheet to catch quality, cost, safety, and wiring regressions before users do.
| Change type | Highest risk | Minimum gate |
|---|---|---|
| System prompt tweak | Tone, tool over/under-use | Smoke gold + P0 pass rate |
| Tool description edit | Wrong args, missed tools | Tool unit + trajectory scenarios |
| Model slug swap | Quality and cost cliffs | Full gold + cost slice |
| Temperature / decoding | Variance, schema breaks | Multi-trial pass rates |
| Provider routing change | Subtle quality drift | Shadow or canary + eval sample |
| New tool added | Permission and loop bugs | Unit + forbid/allow scenarios |
model slug, prompt hash/commit, tool schema version, and gold pack id.| Metric | Warn | Block deploy |
|---|---|---|
| P0 pass rate delta | -2% | -5% or absolute < 0.95 |
| Overall pass rate delta | -3% | -7% |
| Forbidden tool hits on policy cases | any | any |
| Cost per success | +15% | +30% without approval |
| Judge safety dimension | -0.2 mean | any drop below rubric floor |
| New parse failures | > 0.5% | > 2% |
Tune numbers to your risk; write them down before the experiment so you do not move goalposts.
| Symptom | Likely cause | Next step |
|---|---|---|
| Many trajectory misses | Tool descriptions / model tool skill | Diff tool schemas; add examples |
| Hard checks pass, users hate tone | Prompt style regression | Judge tone + human sample |
| Flaky pass rates | N too low / hot sampling | Raise trials; lower temperature on extract steps |
| Cost spike | Extra turns or bigger model | Cap turns; route easy intents cheaper |
| Only one intent breaks | Overfitting or policy mismatch | Inspect that slice's gold labels |
| All green in CI, bad in prod | Fixture unreality | Add redacted prod traces to gold |
Change: prompt X -> Y / model A -> B
Baseline pack: gold@DATE Candidate commit: SHA
P0 pass: 0.98 -> 0.96 (N=3)
Overall: 0.91 -> 0.90
Cost/success: $0.04 -> $0.05
Safety forbidden tools: 0 -> 0
Decision: ship canary 10% / block
Rollback: config flag agent.prompt=X model=ARun deterministic tests plus smoke P0 at minimum. Full gold is still wise if the typo sits in tool instructions or safety text.
Block or fix before full ship. P0 is a product promise, not an average.
Same gold pack, same N, same tools/fixtures, same decoding settings unless decoding is the experiment.
Prefer sandboxes and fakes. If you must use staging, isolate credentials and rate limits.
PR smoke: minutes. Release full gold: whatever your pack needs, often under an hour with concurrency. Overnight is fine for huge matrices.
Only if thresholds are stable and safety cases are strong. Many teams still require a human ack on model swaps.
Hypothesis, version pins, score table, known flakes, and rollback pointer.
Same process: version, diff, eval, roll forward/back. Hosted stores still need the same gates.
Update gold in a dedicated PR with product sign-off, then rebaseline. Do not hide a model regression by silently editing labels in the same change.
No. Shadow helps validate production mix; gold sets give labeled truth and fast iteration.
Related: Why Testing an Agent Differs from Testing Deterministic Code
Related: Building a Gold-Set Eval Suite for Agent Quality
Related: LLM-as-Judge: Scoring Agent Output Automatically
Related: Simulating Full Agent Loops in a Test Harness
Related: Unit Testing Individual Agent Tools
Related: Testing AI Agents Best Practices
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026