Skip to main content
New aislop v0.10.2: safer GitHub Action pins, reproducible init workflows, and cleaner rule docs. Read the changelog →
← Blog
Tutorial · 4 min read

How to Add a Quality Gate to Your AI-Assisted Pipeline in 5 Minutes

What is the least amount of CI setup that will stop your agent from shipping slop? One workflow. One threshold. Five minutes. Here is the exact YAML we use.

What is the least amount of CI setup that will actually stop your agent from shipping slop? Ask around and you will hear everything from a full custom pipeline to nothing at all. Your agent is writing code. You are reviewing (or not). Quality drifts. The easiest way to stop the drift is to check it on every push. Here is how to set that up in five minutes with one workflow and one threshold.

GitHub Actions

Drop this into .github/workflows/aislop.yml:

name: aislop on: [push, pull_request] jobs: quality-gate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: scanaislop/aislop@v0.10.1 with: version: latest

That is it. The ci command exits 1 if the score drops below the threshold in .aislop/config.yml. Your PR goes red. Your agent gets held accountable.

GitLab CI

code-quality: image: node:22 script: - npx --yes aislop@latest ci

Picking a threshold

Start low. If your codebase scores 55 today, do not set the threshold at 80. You will just disable the check on day one. Set it at 50. Fix the worst stuff. Bump to 60. Ratchet up over time. The threshold is a floor, not an aspiration.

Rough guide. 70 and up means no critical issues. 80 and up is a well-maintained codebase. 90 and up is clean.

Only scan changed files

On large repos, scanning everything on every PR is slow. Use --changes to only check files modified in the current diff:

$ npx aislop scan --changes

Auto-fix before commit

Some teams run aislop fix as a pre-commit hook so formatting and dead imports never make it into a PR. Reviewers see clean diffs. They can focus on logic instead of the trail of console.log the agent forgot.

# .husky/pre-commit npx aislop fix --staged

Run it

$ npx --yes aislop@latest ci

Drop it in your workflow. Watch a PR go red the first time the agent regresses the score. Star the AI Slop CLI on GitHub if you want the next release in your feed.