Skip to main content
Core10–16 hours

AI Quality Gate in CI

Build a regression gate for an LLM feature with deterministic checks, model graders, safety cases, and release thresholds.

test designevaluation datasetsmodel graderssafety testingCI gates

Scenario

Task

A team changes prompts and models regularly. It needs an automated gate that blocks a release when quality, safety, or structured-output stability regresses.

Step-by-step execution

1. Build the test taxonomy

Outcome: Product risks are covered by explicit test classes.

Tasks

  • Identify happy paths
  • Add edge cases
  • Add prompt-injection and hallucination cases
  • Assign severity

Checks

  • Every critical risk has a test case
  • The dataset is not limited to happy paths

2. Implement graders

Outcome: Each property has an appropriate evaluation method.

Tasks

  • Add schema checks
  • Add exact/regex assertions
  • Configure a model grader
  • Calibrate the grader on a manually reviewed sample

Checks

  • Deterministic checks are not replaced by an LLM judge
  • The grader has calibration evidence

3. Define the regression policy

Outcome: Release decisions follow recorded rules.

Tasks

  • Record the baseline
  • Define blocking thresholds
  • Separate quality and safety gates
  • Add an exception process

Checks

  • A safety regression always blocks release
  • Thresholds are stored in version control

4. Integrate the CI report

Outcome: Every change receives a transparent verdict.

Tasks

  • Run evals in CI
  • Publish a summary
  • Store raw results
  • Include failure examples

Checks

  • A failed gate fails the job
  • Results can be compared across runs

Acceptance criteria

  • The dataset covers normal, edge, and adversarial cases
  • Deterministic and model-based graders are both present
  • Safety regressions block release
  • CI stores raw evidence
  • Baseline and thresholds are versioned

Assessment rubric

How the result is assessed

Passing score: 75/100 · Distinction: 92/100

Risk coverage

The dataset covers normal, edge, and adversarial scenarios.

25 points

Insufficient

Happy paths dominate.

Competent

Critical risks are covered.

Strong

Coverage is tied to production failures and the threat model.

Evidence required

  • ✓ Link to code or artifact
  • ✓ README with decisions
  • ✓ Test output or runtime evidence
  • ✓ Test taxonomy and severity map

Grader quality

Deterministic checks and model graders match the properties they evaluate.

25 points

Insufficient

One LLM judge evaluates everything.

Competent

Deterministic and model-based checks are separated.

Strong

Grader calibration and disagreement analysis are automated.

Evidence required

  • ✓ Link to code or artifact
  • ✓ README with decisions
  • ✓ Test output or runtime evidence
  • ✓ Calibration sample

Regression policy

Baseline, thresholds, and blocking rules are versioned.

25 points

Insufficient

The verdict is subjective.

Competent

Thresholds and blocking conditions are explicit.

Strong

Risk-based exceptions and trend analysis are implemented.

Evidence required

  • ✓ Link to code or artifact
  • ✓ README with decisions
  • ✓ Test output or runtime evidence
  • ✓ Release policy

CI integration

The gate blocks weak releases and stores evidence.

25 points

Insufficient

The report does not affect release.

Competent

A failure makes the job fail.

Strong

Artifacts, diff reports, and flaky-eval controls are present.

Evidence required

  • ✓ Link to code or artifact
  • ✓ README with decisions
  • ✓ Test output or runtime evidence
  • ✓ Failed and passed CI run