Skip to main content
Integrate Trusys into your continuous integration and deployment pipelines to automatically test your AI applications with every code change. This ensures that your application maintains quality standards before deployment.

Prerequisites

Before setting up CI/CD integration:
  1. Trusys API Key โ€“ Obtain your API key from the Trusys dashboard
  2. Application and Library โ€“ Have your application and prompt library configured in Trusys
  3. CLI Commands โ€“ Refer to the Using CLI documentation for detailed command reference

Basic GitHub Actions Integration

This example runs Trusys evaluations automatically when you push tags matching the pattern test-cli*.
Setup Steps
  1. Add API Key to Secrets: Add a new secret named TRUSYS_API_KEY with your Trusys API key
  2. Configure Environment Variables:
    • Update TRUSYS_APPLICATION with your application name
    • Update TRUSYS_LIBRARY with your prompt library name
  3. Trigger the Workflow: Push a tag matching the pattern: git tag test-cli-v1 && git push origin test-cli-v1

Advanced Integration with Metric Validation

This example includes custom validation logic to check specific assertion types and fail the pipeline based on your criteria.
  • TRUSYS_RELEVANT_ASSERTION_TYPES โ€“ Comma-separated list of assertion types to validate (e.g., icontains,llm-rubric,equals)
  • Customize the validation logic in the Node.js script to match your specific requirements

Key Features

  1. Output to File โ€“ The --output "results.json" flag saves evaluation results for custom validation
  2. Continue on Error โ€“ The continue-on-error: true ensures results are captured even if some tests fail
  3. Custom Validation โ€“ The validation step filters and checks specific assertion types defined in TRUSYS_RELEVANT_ASSERTION_TYPES
  4. Detailed Failure Reporting โ€“ Failed assertions are logged with prompts, assertion types, and failure reasons