Back to Guides

CI/CD visual regression testing your coding agent can run

Published: November 2026•6 min read

A CI/CD pipeline for visual regression testing with AI works like this: your pipeline or coding agent points RegressionBot at a preview URL and at production, RegressionBot captures both pages in the cloud, and you get back a plain-English description of what changed on each page. If you pass the PR's intent, you also get a verdict recommendation your pipeline or agent can read.

Why pixel-only CI gates burn teams out

A gate that fails on any pixel difference flags anti-aliasing, a rotating banner and a lazy-loaded image alongside the one change that matters, and someone has to sort through them. RegressionBot compares the two pages' structure (text, styles, images, links) rather than only their pixels, then describes each changed page in plain English. The measured record is the structured changes list on each page: the exact edits, naming the element and quoting both versions.

Whole-page capture from a live URL (no Storybook required)

Point RegressionBot at a URL or sitemap, and cloud workers capture the live page. There is no test code to write and no component library to maintain. Captures are Chromium viewports at the sizes you configure (for example Desktop Chrome and iPhone 13). This is not a real-device or Safari/WebKit lab.

If you already use Storybook for component states, keep it. See RegressionBot and Chromatic.

Preview vs production in the same run

Pass your preview URL as testOrigin and production as baseOrigin. Both are captured in the same run, so production is the baseline and there are no images to commit. The step-by-step version, with Playwright and Cypress users in mind, is in Visual regression on preview URLs in CI.

What the AI actually returns (plain-English changes + intent-based verdicts)

Each changed page gets a plain-English description of what moved. That is the first thing a person or agent reads.

If you also pass the PR or commit intent as runContext, the run can return a verdict recommendation: pass, review or fail for the run, or not_judged when no intent was given. Each page is labeled intentional, bug, noise or needs_review. A pipeline or agent can read and act on that as a recommendation. It needs the intent; without one the run is not_judged.

Is this a release-clearance judgment?

No. A verdict is a recommendation. Approving and rejecting remain the only actions that move a baseline. A person or your own policy still owns the merge decision. See Intent and the Verdict.

Wire it into CI (GitHub Action, SDK, or REST)

The GitHub Action is the shortest path. This is the core of the step; the full workflow is in Preview vs Production Workflow:

      - name: Run Visual Check
        id: vrs
        uses: RegressionBot/regressionbot-action@v0
        with:
          api-key: ${{ secrets.REGRESSIONBOT_API_KEY }}
          test-origin: ${{ env.PREVIEW_URL }}
          base-origin: 'https://myapp.com'
          sitemap-url: '${{ env.PREVIEW_URL }}/sitemap.xml'
          scan: '**'
          project: 'my-web-app'
          devices: 'Desktop Chrome, iPhone 12'
          github-token: ${{ secrets.GITHUB_TOKEN }}

The Action reads the pull request's title, description (the first 2,000 characters) and head commit from the event itself, so the run is judged against what the PR says it does. There is no run-context input to add. On a push it uses the commit message and SHA. Set change-description to say it yourself (explicit inputs win), or send-pr-context: 'false' to send nothing.

To write your own reporting, use the Node.js SDK or the REST API; the visual regression API page gives the overview.

Drive the same check from MCP in Cursor, Claude Code, or Codex

The MCP server at https://mcp.regressionbot.com/ exposes the same job surface to your agent. The agent starts a run on its preview, reads each page's changes and the run's verdict, fixes what it did not intend, and runs again. Cursor connects with an API key (signing in from Cursor is not confirmed). Setup for each client is in MCP Server; the walkthroughs are Claude Code, Cursor and Verify UI changes before the PR. For the bigger picture, see agentic visual regression over MCP.

Managed baselines vs live-vs-live — pick a workflow

  • Live-vs-live (baseOrigin set): compares a preview, staging or local-via-tunnel site with production on every run. Nothing to set up first.
  • Managed baselines (baseOrigin omitted): compares against baselines stored for the project. The first run captures them and compares nothing.

Cloud workers cannot reach localhost; use a tunnel or a preview deploy (Internal Environments). A preview behind a password is handled by storing the credential on a project (update_project with testAuth) and passing the project's name on the run.

Masking dynamic regions so CI stays trustworthy

Hide ads, timestamps and widgets before capture with a data-vr-mask attribute or CSS selectors. See Data Masking.

Related guides and docs

Ready to ship with confidence?

Start catching visual changes before they reach production. Start your 7-day free trial today. No credit card required.