use cases · ci/cd

AI pentesting in your CI/CD pipeline

A yearly pentest checks one release. Your pipeline ships many more. Xalgorix reviews each pull request's code for free, runs an exploit-verified pentest against each deploy, and fails the build only on findings it reproduced, at the severity you choose.

Where it fits in a pipeline

  1. 01 · On every pull request

    Review the diff with the free GitHub App

    The GitHub App reads each pull request's changed code for injection, broken access control, SSRF and leaked secrets, and comments on the PR. It's free and needs no account, API key or workflow file. It reviews code; it doesn't attack a running app.

  2. 02 · After a deploy to staging or a preview URL

    Pentest the running app with the GitHub Action

    xalgorix/scan-action@v1 starts a scan against a live URL, waits for it, writes a per-severity table to the job summary with a link to the full report, and fails the job when a finding is at or above your fail-on severity. Deploy first, then pass the deployed URL as the target.

  3. 03 · On any other CI system

    Call the REST API with curl

    The Action is a thin wrapper over the public REST API: POST /api/public/v1/scans, then poll status until the scan reaches a terminal state and read the findings. The same requests work from any runner that has curl, such as GitLab CI, Jenkins or CircleCI.

  4. 04 · On a schedule

    Catch what changed between releases

    Schedule recurring scans in the dashboard, or start a scan from a nightly job with wait: false and receive a signed scan.completed webhook when it finishes (scheduled scans, CI/CD integrations and webhooks are on the Pro and Max plans).

A GitHub Actions workflow that gates on proof

Create an API key in the dashboard, store it as the XALGORIX_API_KEY secret, and add this as .github/workflows/security.yml. It scans your staging URL on each pull request and fails the check on high or critical findings.

name: security
on:
  pull_request:
    branches: [main]
concurrency:
  group: xalgorix-${{ github.ref }}
  cancel-in-progress: true
jobs:
  xalgorix:
    runs-on: ubuntu-latest
    # Fork PRs can't read secrets, so only run on branches in this repo.
    if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
    steps:
      - name: Xalgorix security scan
        uses: xalgorix/scan-action@v1
        with:
          api-key: ${{ secrets.XALGORIX_API_KEY }}
          target: https://staging.example.com
          mode: single
          fail-on: high

To test the pull request's own changes, deploy a preview first and pass its URL as target. The Action also exposes scan-id, status, web-url and per-severity counts as step outputs. The Action's README has the preview-deploy workflow and the full list of inputs.

What to know before you gate merges

  • The target must be reachable from the public internet. The hosted scanner connects to it, not your CI runner, so localhost or a private-network staging host won't work unless it's exposed.
  • GitHub withholds secrets from pull requests opened from forks, so the scan can't run there. Guard the job with an if: condition, and never scan a fork's untrusted URL with your key.
  • A pentest is not a lint step. The Action polls every 20 seconds and gives up after 60 minutes by default, so run it after a deploy rather than on every commit, and set timeout-minutes to suit your pipeline.
  • Cancelling a CI job doesn't stop its scan. Add a cleanup step that calls POST /scans/stop with the saved scan ID.
  • Scan creation has no idempotency key. Keep the scan ID as a job output and don't blindly retry a start after a lost response.
  • A completed status describes the scan's lifecycle, not its coverage. Check the assessment metadata the API returns before treating a clean result as a full assessment.
  • Pin the Action to a commit SHA once you've reviewed it, and store the API key as a repository or organization secret.
  • Each scan uses your account's normal credits, the same as a scan started in the dashboard. There's no extra fee for the Action.

Questions

Does it scan the pull request's code or the running app?

Two different tools. The free GitHub App reviews the code changed in a pull request. The GitHub Action and the REST API run a dynamic pentest against a live, reachable URL, so they need a deployed environment such as staging or a per-PR preview.

Can it block a merge?

Yes. The Action's fail-on input takes none, low, medium, high or critical and defaults to high: the job fails when the scan reports a finding at or above that severity. Use fail-on: none to get the report without blocking. Findings are only reported after Xalgorix reproduced them, so a red check points at something you can replay.

Does it work with GitLab CI, Jenkins or CircleCI?

There's no dedicated plugin for those. The published Action is for GitHub Actions; on other systems, call the REST API with curl from a pipeline step, poll the scan's status, and apply your own severity threshold to the findings. The API reference has the requests.

Which plan do I need?

The GitHub App is free and needs no Xalgorix account. The /pricing feature table lists CI/CD integrations, webhooks, scheduled scans and API access under the Pro and Max plans. Check /pricing for the current table.

Is it safe to point at production?

Payloads are non-destructive and request rates are capped, but we still recommend scanning staging or a preview environment from CI. Only scan systems you own or have written permission to test.

What if I have no deployed URL to scan on a pull request?

Then a dynamic scan has nothing to test at that point. Use the GitHub App for code review on the pull request, and run the Action later in the pipeline, after the deploy to staging.

Put a pentest behind every deploy

Start with the free GitHub App, then add the Action when you want a live scan in the pipeline. Credit packs start at $10 and never expire.