HomeDocsBlogDownload

Adding ClaudeArmor to Your CI/CD Pipeline in 5 Minutes

ClaudeArmor works great as a desktop app for local development, but the real security value comes when you integrate it into your CI/CD pipeline. Every pull request, every push to main โ€” automatically scanned for AI-generated security risks before code reaches production.

This tutorial covers GitHub Actions, GitLab CI, and Jenkins. Pick your platform and follow along โ€” the whole setup takes under 5 minutes.

Prerequisites

Step 1: Create Your Config File

If you don't already have a .claudearmor.yml in your repo root, create one:

# .claudearmor.yml
version: 2
scan:
  paths:
    - src/
    - lib/
    - scripts/
  exclude:
    - node_modules/
    - "**/*.test.js"
    - "**/*.spec.ts"

rules:
  secret-detection: error    # Block PR on secrets
  mcp-permission-audit: warn # Warn but don't block
  dependency-risk: error     # Block on high-risk deps
  code-pattern-scan: warn    # Warn on suspicious patterns

output:
  format: sarif              # SARIF for GitHub integration
  file: claudearmor-results.sarif

The sarif output format enables rich integration with GitHub's Security tab, showing findings inline on pull requests.

Step 2: Add to Your CI Platform

# .github/workflows/claudearmor.yml
name: ClaudeArmor Security Scan

on:
  pull_request:
    branches: [main, develop]
  push:
    branches: [main]

jobs:
  security-scan:
    runs-on: ubuntu-latest
    permissions:
      security-events: write  # Required for SARIF upload
      contents: read

    steps:
      - uses: actions/checkout@v4

      - name: Install ClaudeArmor CLI
        run: npm install -g claudearmor

      - name: Run Security Scan
        run: claudearmor scan --ci --output sarif

      - name: Upload SARIF Results
        if: always()
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: claudearmor-results.sarif

      - name: Comment on PR
        if: github.event_name == 'pull_request'
        run: claudearmor report --format markdown >> $GITHUB_STEP_SUMMARY

The upload-sarif step sends results to GitHub's Security tab, creating inline annotations on the pull request diff. Reviewers see exactly which lines triggered findings.

# .gitlab-ci.yml (add this stage)
claudearmor-scan:
  stage: test
  image: node:20-slim
  before_script:
    - npm install -g claudearmor
  script:
    - claudearmor scan --ci --output json
    - claudearmor report --format markdown > security-report.md
  artifacts:
    when: always
    paths:
      - claudearmor-results.json
      - security-report.md
    reports:
      codequality: claudearmor-results.json
  rules:
    - if: $CI_MERGE_REQUEST_IID
    - if: $CI_COMMIT_BRANCH == "main"

GitLab's Code Quality widget will show ClaudeArmor findings directly in the merge request UI when using the codequality report format.

// Jenkinsfile (add this stage)
stage('Security Scan') {
    steps {
        sh 'npm install -g claudearmor'
        sh 'claudearmor scan --ci --output json'
        sh 'claudearmor report --format junit > test-results.xml'
    }
    post {
        always {
            junit 'test-results.xml'
            archiveArtifacts artifacts: 'claudearmor-results.json'
        }
    }
}

Jenkins displays results through its JUnit test reporter, treating each finding as a test case. Failed tests = security issues that need attention.

Step 3: Configure Failure Thresholds

By default, ClaudeArmor exits with code 1 (failing the CI job) when it finds any error-level findings. You can customize this:

# .claudearmor.yml โ€” Threshold configuration
ci:
  fail-on: error           # Only block on errors (default)
  # fail-on: warning       # Block on warnings too (strict)
  # fail-on: none          # Never block (report only)
  max-findings: 0          # Fail if any findings exist
  # max-findings: 5        # Allow up to 5 findings

For teams just starting out, we recommend fail-on: error with max-findings: 0. This blocks only the most critical issues (exposed secrets, dangerous dependencies) while allowing less severe warnings to be reviewed at the team's pace.

Step 4: Add a Status Badge

Show your security status on your README:

<!-- For GitHub Actions -->
![ClaudeArmor](https://github.com/YOUR_ORG/YOUR_REPO/actions/workflows/claudearmor.yml/badge.svg)

<!-- For GitLab -->
![ClaudeArmor](https://gitlab.com/YOUR_ORG/YOUR_REPO/badges/main/pipeline.svg)

Troubleshooting

Scan is too slow?

Add --changed-only to scan only files modified in the PR. This typically reduces scan time from minutes to seconds:

claudearmor scan --ci --changed-only --output sarif

False positives?

Add inline suppression comments to ignore specific findings:

// claudearmor-ignore: secret-detection โ€” Test fixture, not real key
const TEST_API_KEY = 'sk-test-1234567890';

Need help?

Join our GitHub Discussions or check the full documentation for advanced CI/CD patterns including monorepo scanning, parallel execution, and caching strategies.

Secure Your Pipeline Today

5 minutes of setup. Every PR scanned automatically. Zero secrets in production.

Get Started โ†’
๐Ÿš€

Priya Sharma

DevOps Engineer at ClaudeArmor. Builds CI/CD integrations and developer tooling. Previously at CircleCI and Vercel.