Skip to main content

Set up CI/CD regression gates with EvalGate

EvalGate has three CI paths. Choose the one that matches the evidence you want to gate on.

One-command eval artifact CI

Use ci when your repo contains EvalGate spec files and you want each pull request to write .evalgate/ run artifacts.
.github/workflows/evalgate.yml
That command:
  • Discovers evaluation specs automatically
  • Runs all specs by default
  • Writes run artifacts when --write-results is set
  • Compares against the base branch when --base is set
  • Writes a GitHub step summary and annotations when --format github is 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.

Local gate setup

Initialize local evaluation without a hosted prerequisite. A cloud coding agent needs no browser, account, organization, GitHub remote, or EvalGate API key. Add login and link separately only when the workflow needs shared hosted evidence; every cloud intake is then pinned to its exact target commit.

Human TTY

In an interactive terminal, init previews and asks before writing the reviewed files. Confirm the prompt to apply; then baseline update runs your configured suite and accepts only a non-empty passing baseline.

Agent or automation

JSON and other non-interactive invocations remain preview-only until explicit --apply. Explicit init --preview never prompts, writes, or runs project commands, even in a TTY. init --local performs no network request and creates no hosted identity. The deterministic local gate remains credential-free. If hosted linkage is later added, a checkout behind its tracked branch is still linked and can run the local gate while cloud evidence remains pinned to the exact requested SHA. Commit the generated files:
The generated workflow uses the local gate command:
.github/workflows/evalgate-gate.yml
The canonical .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.

Platform gate

Use check when you want the dashboard, quality scores, judge credibility, and import-on-failure behavior.
.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 configuration

For GitLab, use JSON output and upload the report as an artifact:
.gitlab-ci.yml

Setting quality thresholds

Define local gate thresholds in evalgate.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
Store evalgate.config.json and evals/baseline.json in version control. Changing thresholds or baselines without review changes what your CI gate proves.

Exit codes

The process exit status is the shell/CI result. JSON reports may additionally carry effectiveExitCode 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.