Skip to main content
Block merges and deploys when your agent’s pass rate drops below your configured threshold, using GitHub Actions as the runner. This page covers the hosted CI/CD pipeline (client.tracer.run_eval); for a self-hosted engine, see the Self-Host CI Gate.

Prerequisites

  1. A dataset with CI/CD enabled in AgentX settings.
  2. Your AGENTX_API_KEY stored as a GitHub Actions secret.
  3. Your AGENTX_DATASET_ID (visible in the dataset settings page URL), stored as a secret or variable.

Workflow template

Use a small eval script plus a workflow that runs it. First the script:
Then save this as .github/workflows/eval.yml in your repository:
run_eval runs the full lifecycle in one call: it creates a CI run, calls your agent for each test case, submits each answer for judge scoring, finalizes the run, and returns (or raises on) the gate decision. fail_on_gate=True raises CIGateFailure when the gate fails, so the step exits non-zero and the check goes red. Expected log output:

Adding required status checks

To block merges when the gate fails:
  1. Go to your GitHub repo → Settings → Branches
  2. Add a branch protection rule for main
  3. Enable Require status checks to pass before merging
  4. Add eval / Evaluate agent as a required check

Viewing results

Every CI run is recorded in your AgentX workspace’s evaluation run history, with:
  • Gate result (PASS / FAIL)
  • Per-question scores and justifications
  • Branch, commit SHA, and PR number (from git_context)
  • Threshold violations
You can also poll a run from code with client.tracer.get_ci_run(run_id), or receive the result by webhook when the run finalizes.

Environment variables