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:| Variable | Value |
|---|---|
TRIDENT_PROJECT_PUBLIC_KEY | Your project’s Public Key (find it at Settings → API Keys) |
TRIDENT_PROJECT_SECRET_KEY | Your project’s Secret Key — treat this as a password |
Run evaluations
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.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.
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.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.