SKILL.md--- name: ci-security-scanning-with-strix description: Add security scanning to CI/CD with Strix — GitHub Actions, GitLab CI, or any pipeline — so every pull request gets a diff-scoped AI pentest that blocks vulnerable code before it merges, with results as PR comments and SARIF uploaded to code scanning. Covers both the self-hosted open-source CLI (runs in your runner) and the managed app.strix.ai platform (GitHub/GitLab app or API, no runner infra). Use when the user asks to add security scanning, SAST/DAST, pentesting, vulnerability checks, or automated security review to their CI pipeline, pre-merge gate, or PR workflow. license: Apache-2.0 metadata: author: usestrix homepage: https://docs.strix.ai --- # Set up Strix in CI/CD You can gate PRs two ways — pick based on the environment, or combine them: - **Managed platform (recommended for most teams)** — connect the GitHub/GitLab/Bitbucket app once and Strix reviews every PR with **no workflow file, no runner, no Docker, and no LLM key**. Results post as PR comments and land in the team dashboard. Best when you want zero CI maintenance, central tracking, or your runners lack Docker. See "Managed platform" below and the **managed-pentesting-with-strix** skill. - **Self-hosted OSS CLI in your runner** — run a diff-scoped scan as a pipeline step. Fully in your infra, free (BYO LLM key), no external account. Requires Docker on the runner. Best for air-gapped/self-hosted CI or when you do not want scans leaving your environment. Both fail the build on validated findings and both emit SARIF 2.1.0, so you can start with one and add the other later. --- # Option A — Self-hosted OSS CLI in the runner Run a diff-scoped Strix scan on every PR: only changed files are tested, `quick` mode keeps it fast, and exit code `2` fails the build when validated vulnerabilities are found. ## GitHub Actions Create `.github/workflows/security.yml`: ```yaml name: Security Scan on: pull_request: jobs: strix-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # required for diff-scope resolution - name: Install Strix run: curl -sSL https://strix.ai/install | bash - name: Run Security Scan env: STRIX_LLM: ${{ secrets.STRIX_LLM }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} run: strix -n -t ./ --scan-mode quick --max-budget 10 # Don't fail open: a run that hits the hard budget stop exits 0 but leaves # run.json status "stopped", not "completed". Enforce completion explicitly. # This does not catch an agent that wrapped up early on a budget *warning* # (it still calls finish_scan and records "completed"), so size the budget. - name: Fail unless the scan completed run: | run_json=$(ls -t strix_runs/*/run.json | head -1) status=$(jq -r .status "$run_json") if [ "$status" != "completed" ]; then echo "Strix run status is '$status' — the scan did not complete (likely budget exhausted). Raise --max-budge