GitHub Actions

CI workflow and build-gating with AgentPrey exit codes.

Why It Is CI-Friendly

agentprey returns stable exit codes, so you can gate pull requests and deploys directly on process status.

Exit Codes

  • 0: all secure
  • 1: vulnerabilities found
  • 2: scan error

GitHub Actions Workflow Example

yaml
name: AgentPrey Scanon:  pull_request:  workflow_dispatch:jobs:  security-scan:    runs-on: ubuntu-latest    steps:      - name: Checkout        uses: actions/checkout@v4      - name: Install Rust toolchain        uses: dtolnay/rust-toolchain@stable      - name: Install agentprey        run: cargo install agentprey      - name: Run scan and gate build        env:          TARGET_URL: ${{ secrets.AGENTPREY_TARGET_URL }}        run: |          set +e          agentprey scan --target "$TARGET_URL" --category prompt-injection          exit_code=$?          set -e          if [ "$exit_code" -eq 1 ]; then            echo "agentprey found vulnerabilities"            exit 1          fi          if [ "$exit_code" -eq 2 ]; then            echo "agentprey scan error"          fi          exit "$exit_code"

How To Gate Builds

Treat exit code 1 as a policy failure and fail CI. Treat exit code 2 as a runtime/scan failure and fail CI for investigation.