Esta página está disponível apenas em inglês.

Catch AI-readiness regressions on every deploy

The SagBot GitHub Action scans every preview or production deploy and fails the job when a change makes the site worse for AI agents and answer engines. What got worse, and what got fixed, lands in the pull request.

Add it from GitHub MarketplaceGet an API token

What fails the job

  1. A check got worse

    A check that passed in the baseline scan, usually production, fails now. A check SagBot couldn’t verify never counts.

  2. A score is under your floor

    Agent-ready or Answer-ready is under the floor you set with min-agent-ready or min-answer-ready.

  3. A required check fails

    Any check you list in require, such as agent-robots or seo-indexability, fails on this deploy.

A site SagBot can’t scan at all (down, blocked, behind a login) fails it too, unless you set fail-on-incomplete: false.

What the pull request shows

One comment, updated on every push. The job summary adds the fix for every failing check.

github-actions[bot] commented

❌ SagBot AI-readiness: failed

3f9c2a1e.example.pages.dev · content · scanned 2026-11-25 10:04 UTC

ScoreNowBeforeChange
Agent-ready7178−7
Answer-ready6462+2

Before: scan of example.com from 2026-11-24

Got worse (1): agent-llms-txt llms.txt

Fixed (1): aeo-faq-schema FAQ / QAPage schema

Not compared (host-specific or ignored) (1): seo-indexability Indexable homepage

Gate

  • Got worse: agent-llms-txt (llms.txt) is now fail

Full report on sagbot.app

Set it up

Save your SagBot token as the repository secret SAGBOT_TOKEN, then add one step after the deploy. SagBot fetches the public site, so the URL has to be live when the step runs.

Pull request previews on Cloudflare Pages

Deploy the preview with cloudflare/wrangler-action and scan its URL against production. Production needs one stored scan first: run SagBot on it once.

on: pull_request
permissions:
  contents: read
  pull-requests: write # the PR comment
jobs:
  preview:
    # fork PRs get no secrets: skip the deploy and the scan
    if: github.event.pull_request.head.repo.full_name == github.repository
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      # … build the site into dist/
      - id: deploy
        uses: cloudflare/wrangler-action@v4
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          command: pages deploy dist --project-name=example
      - uses: Sagbot-Apps/scan-action@v1
        with:
          token: ${{ secrets.SAGBOT_TOKEN }}
          url: ${{ steps.deploy.outputs.deployment-url }}
          baseline: example.com # production: the "before"

Vercel, after a production deploy

Vercel sends vercel.deployment.success to workflows on your default branch. That event has no pull request, so the result goes to the job summary.

on:
  repository_dispatch:
    types: [vercel.deployment.success]
jobs:
  sagbot:
    if: github.event.client_payload.environment == 'production'
    runs-on: ubuntu-latest
    steps:
      - uses: Sagbot-Apps/scan-action@v1
        with:
          token: ${{ secrets.SAGBOT_TOKEN }}
          url: example.com # compared with its own previous scan
          min-agent-ready: 60

Any host, after a production deploy

Netlify, your own server or anything else: add the step after the deploy, and each release is compared with the scan before it.

on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      # … your deploy steps
      - uses: Sagbot-Apps/scan-action@v1
        with:
          token: ${{ secrets.SAGBOT_TOKEN }}
          url: example.com
          require: agent-robots, seo-indexability

Every input, from ignore to fail-on-regression: the action’s README.

What it costs

  • The action is free and open source (MIT).
  • Scans of your verified domains and their subdomains are free, with no cap, unless the domain redirects to another site. Point previews at a subdomain of a verified domain and they are free too.
  • Other hosts, preview hosts like *.pages.dev or *.vercel.app included: 3 free scans a day, then $0.06 each from your balance.
  • Reading the baseline scan is free.

See pricing

Questions

Do I need a SagBot account?

Yes, for the API token (sgb_…). Sign in, create a token and save it as the repository secret SAGBOT_TOKEN. Signing up is free.

Why aren’t some checks compared on a preview?

Preview hosts send X-Robots-Tag: noindex and point canonical, hreflang and absolute links at production, so seo-indexability, seo-canonical, seo-crawlable-links and seo-hreflang differ by design. When the scanned host isn’t the baseline’s, the action leaves them out. Add any other id to ignore.

What happens on pull requests from forks?

GitHub gives them no secrets, so the scan step skips with a warning. A deploy step needs secrets too: skip the job on forks, as the Cloudflare example does. Don’t switch to pull_request_target to get the tokens there: anyone opening a pull request would spend your balance.

Can my previews be behind a login?

No. SagBot reads the public site, so a preview behind Vercel Deployment Protection or a password ends as an incomplete scan: it fails the job and still counts as a scan, charged like any other. Scan a public preview, or production after the deploy.

Can a coding agent fix what it finds?

Yes. The job summary lists every failing check with its fix, ready to paste into Claude Code, Cursor, Copilot or Codex. The SagBot MCP server lets the agent scan, fix and rescan by itself.

Does it work outside GitHub?

The action is GitHub only. On GitLab CI or any other runner, call the Scan API with curl: the docs have a CI example that handles timeouts.

SagBot MCP serverScan API in other CISource on GitHub

Add it to your next pull request

One step in your workflow, one secret. Free on your verified domains.

Add it from GitHub Marketplace