PR Eval Gate
Gate pull requests on evaluation regressions — set up with AI, a deterministic PR, or by hand.
The PR Eval Gate runs your LLM app over a pinned dataset on every pull request, scores the outputs with a metric collection, and posts a GitHub check-run that passes, fails, or is neutral depending on whether your metric scores regressed against your base branch (within your configured tolerance).
It needs two things in your repository:
.github/workflows/confident-eval-gate.yml— a workflow that sets up your app (Python + dependencies) and runs Confident’s published runner Action.confident_eval.py— arun(input)function that calls your app and returns its output as a string. Confident calls this once per golden in your dataset.
The GitHub App is required either way — it posts the check-run on every pull request. The setup options below differ only in how those two files get added to your repo.
Configure the gate
Setup methods
An agent reads your repository to tailor confident_eval.py and the workflow to your app, then opens the setup pull request. Fastest.
Confident opens a pull request with template files — no AI reads your code. You fill in run() and adjust the workflow before merging.
Add the two files yourself. Confident never opens a PR for you — the App only posts check-runs. Follow the steps below.
Set it up yourself
If you’d rather Confident never open a PR for you, add both files by hand. This is the most locked-down option; you also add the API key secret yourself.
Add the CI workflow
Create .github/workflows/confident-eval-gate.yml. Set up your app’s runtime (Python + dependencies) in earlier steps, then invoke the runner Action — keep the final Confident PR Eval Gate step’s uses: ref and its four with: inputs.
base_url is region-specific: use https://api.confident-ai.com for US and https://eu.api.confident-ai.com for EU. Set dataset_alias (and optionally dataset_version) to the dataset you configured the gate against.
Add the eval callback
Create confident_eval.py at the repository root. run(input) receives one dataset input, calls your app, and returns its output — Confident runs it for every golden in your dataset and scores the results.
Add the repository secrets
Create a project API key in Settings → API Keys, then add it as a repository secret named CONFIDENT_API_KEY (Settings → Secrets and variables → Actions in GitHub). Add any runtime secrets your app needs (for example OPENAI_API_KEY) the same way.
Once the workflow and confident_eval.py are on your default branch, every future pull request runs the gate and posts the Confident PR Eval Gate check-run with the score comparison against your base branch.
Troubleshooting
Most misconfigurations fail loudly — the runner reports the reason on the Confident PR Eval Gate check-run and in the workflow’s Actions logs. A few fail silently; those are called out below.