Install tridentctl
Install the Trident CLI in your CI environment before running evaluations:
npx:
Set your project credentials
Trident authenticates eval runs using your project API keys. Add the following as secrets or environment variables in your CI system:
Never hard-code these values in your repository. Use your CI system’s secrets manager to inject them at runtime.
Run evaluations
1
Create an eval configuration file
Write a YAML file (for example,
trident-evals.yaml) using the promptfoo configuration format. Define the prompts, attack scenarios, and assertions you want to run. Start with high-priority attacks like prompt injection and jailbreak attempts.2
Run the eval command
Execute the following command in your CI pipeline:Trident runs each scenario in the eval corpus against your agent and evaluates the responses using the assertions defined in your config file.
3
Interpret the exit code
The
tridentctl evals command exits with a non-zero status code if any test assertion fails. Most CI systems treat a non-zero exit as a pipeline failure, which blocks the pull request or deployment automatically — no additional configuration required.4
Use --watch for local development (optional)
During local development, pass the
--watch flag to have tridentctl automatically re-run evaluations whenever your config file or prompt files change:GitHub Actions example
Add the following workflow file to your repository to run Trident evals on every pull request:.github/workflows/trident.yml
Trigger evaluations via API
If you want to trigger a full cloud-run campaign rather than running evals locally in the CI runner, you can call the Trident REST API instead: Start a campaign:status field is completed or failed, then use the passed boolean to determine whether to proceed with the deploy.