Agentic Pattern Libraryby Vikas Goyal
← All patterns
71

Ambient QA Agent

Also known as: always-on QA, behaviour watchdog, continuous QA agent

An always-on agent checks the running system against rules people wrote and opens a PR when one breaks.

TrackAI-native software delivery FamilyObserve Maturity Horizon ChangesDecisionVerification
01

Problem

Tests run at merge time, on paths someone thought of. Behaviour drifts afterwards: a dependency changes, data grows, a feature flag flips, a third-party service changes its responses. Users find these problems first. Manual QA can’t watch continuously, and alerts without a proposed fix just add toil.

  • Many failures appear only in the running system.
  • Alerts without fixes create work instead of removing it.
  • An agent that changes code unprompted is a risk.
  • Vague rules make the agent raise false alarms.
02

Solution

Write a small set of behaviour rules in plain language, each with a check, such as “a redirect to a working page is never shown as broken.” An ambient agent runs the checks on a schedule or on events, against staging and, read-only, against production. When a rule fails, it reproduces the problem, writes a failing test, and opens a pull request with a proposed fix, or an issue with evidence if it can’t fix it. It never merges: its pull requests go through the same gates as anyone else’s. People own the rules, which are versioned and protected.

03

Diagram

Behaviour rulesowned by people Running systemstaging · prod read-only Ambient agentchecks on schedule All rules holdnothing to do Reproducefailing test + fix Pull requestnormal gates Mergedby people pass rule breaks review

The agent watches continuously but acts only by proposing. Every fix still passes the normal review gate.

04

When to use

Use it when

  • User-visible behaviour that can be checked automatically
  • Systems that depend on outside services that change
  • A production feedback loop is already in place
  • Regressions reach users before tests catch them

Avoid it when

  • No staging environment or safe way to run checks
  • Behaviour that can't be written as checkable rules
  • Teams already overloaded with pull requests; fix review capacity first
05

Trade-offs

Latency Runs in the background on a schedule
Cost Continuous checks plus agent runs on failures
Complexity Rules, safe check environment, PR plumbing
Reliability Drift caught before users report it

Gains

  • Regressions found between releases, not by customers
  • Alerts arrive with a reproduction and a proposed fix
  • Rules document what the product must always do

Costs

  • Noisy rules erode trust quickly
  • Adds pull requests to the review queue
  • Needs a safe, read-only way to check production
06

Worked example

Scenario
The Linkwatch team runs an ambient QA agent with eight behaviour rules.
  1. RulesEight rules, including “a 301 redirect to a working page counts as up” and “the dashboard loads in under 2 seconds with 10,000 links”.
  2. ScheduleStaging is checked every hour; production every 6 hours with read-only synthetic checks.
  3. DetectionA CDN starts returning 308 redirects instead of 301. Rule 1 fails on staging on Tuesday morning.
  4. ProposalThe agent reproduces it, writes the failing test test_308_counts_as_up, treats 307 and 308 like 301, and opens a pull request.
  5. GateThe pull request is reviewed and merged in 40 minutes, before any customer reports it. One rule that raised 3 false alarms that month is rewritten.
07

Failure modes

FailureSymptomMitigation
Noisy rulesFalse alarms get ignored, then real ones tooTune or remove rules after repeated false alarms
Self-mergingAgent changes reach production without reviewAgent only opens PRs; normal gates and protected rule files apply
Checks with side effectsSynthetic checks create real data or emailsRead-only synthetic checks in production
PR floodAmbient PRs swamp human reviewersCap open ambient PRs at what reviewers can handle