Set up CI/CD regression gates with EvalGate
Start withgate. Complete the five-minute loop
once, then run that same command on every pull request. Add the later modes
only when you need their different evidence contract.
The quality scoring contract describes components,
missing measurements and evidence completeness. The blended score is descriptive,
not a standalone release decision. Cost thresholds on completed evidence are
not pre-execution spending limits.
Local gate setup
Complete the five-minute local gate first. It covers preview, explicit apply, replacement of every placeholder, discovery, the reviewed-source commit and acceptance of a non-empty passing baseline. CI consumes those reviewed files; it never accepts a baseline for you. Commit@evalgate/sdk as a dev dependency and its package lockfile. Use the
workflow below so npm ci installs the reviewed version and npx --no-install
fails if that dependency is missing.
The published 3.15.0 initializer pins its own 3.15.0 in the generated workflow.
The source generator derives that pin from its own SDK_VERSION, so it does not
carry an independent stale version. The lockfile-only template below is an
alternative for projects that commit the SDK dependency. Compare older generated
workflows with your installed SDK before committing them.
.github/workflows/evalgate-gate.yml
.evalgate/last-report.json is the release decision envelope;
evals/regression-report.json is the detailed regression artifact. Baselines
are reviewed evidence and are never automatically updated, committed, or
pushed by generated CI. Accept a baseline explicitly after reviewing a clean
run with evalgate baseline update.
The built-in local gate compares test pass state and parsed test count against the baseline. If your test script runs AI evals, this gates AI behavior. Otherwise, it gates test health until you add eval specs or a custom
eval:regression-gate script.Later: hosted checks
Usecheck after the local loop when you need shared hosted evidence, independent judge credibility and import-on-failure behavior. Review availability and configure every required component; a score alone cannot demonstrate unmeasured safety.
.github/workflows/evalgate-platform-gate.yml
check --format github emits GitHub annotations for failed cases and writes a step summary with the verdict, score, baseline score, delta, and top failing cases. --onFail import uploads the failed run context to the platform so you can review it in the dashboard.
GitLab CI recipe
GitLab supports a local gate recipe only. Connecting a GitLab repository for Repository Intelligence or automatic AI discovery is unsupported. This is not a native GitLab integration. Use JSON output and retain both decision artifacts:.gitlab-ci.yml
Setting quality thresholds
Define local gate thresholds inevalgate.config.json. The built-in local gate uses evals/baseline.json; platform gates use the quality and judge settings configured for the evaluation.
evalgate.config.json
Exit codes
The process exit status is the shell/CI result. JSON reports may additionally carryeffectiveExitCode and releaseReady when preview mode or evidence
policy separates process completion from the release decision. The complete,
version-bound contract is available from evalgate capabilities --format json.
These meanings are authoritative for the installed runtime. Agents and CI
integrations can read the complete version-bound contract with
npx @evalgate/sdk capabilities --format json.
CLI commands reference
Best practices
Start local
Use the local gate first so every repo gets a baseline before the team adopts platform workflows.
Upload artifacts
Keep
.evalgate/ or evals/regression-report.json as CI artifacts so failures are debuggable after the job exits.Use impacted-only deliberately
Add
--impacted-only only after your spec manifest is stable. Unknown changes fall back to broader runs.Promote reviewed cases
Treat generated candidate cases as drafts until a human or promotion workflow approves them for gating.
Later: eval artifact CI
Useci when your repo contains EvalGate spec files and you want each pull request to write .evalgate/ run artifacts.
.github/workflows/evalgate.yml
- Discovers evaluation specs automatically
- Runs all specs by default
- Writes run artifacts when
--write-resultsis set - Compares against the base branch when
--baseis set - Writes a GitHub step summary and annotations when
--format githubis set - Exits with the appropriate code (see exit codes)
Add
--impacted-only to run only specs affected by the current diff. Impact analysis requires a base branch, so use it with --base main or another base ref.Other CI hosts and languages
Jenkins and Buildkite can invoke the same local command and capture artifacts. JUnit XML is a source candidate until its release is listed in feature status; usegate --format junit > evalgate.xml only with a build that advertises it.
This is generic CI execution, not a native integration. TypeScript and Python
are evaluation runtimes. Go/Ruby generated REST clients are not runners; Java
and .NET evaluation runners are unsupported.