Repository navigation
Running Moonshot Tests

This guide explains how to run Moonshot Tests straight out of the box. Please complete the onboarding process to set up Moonshot in your CI/CD before running the first test. You may refer to this guide.
Moonshot tests can be run with a single command. Example:
moonshot run <run_id> <test_id> <endpoint_id>-
moonshot: Fixed parameter. This is always required. -
run: The keyword for the run action. Only this keyword is needed to run benchmark tests and red team attacks. -
<run_id>: The run id of the run, which should come from the CI/CD runner. This run id will also be the name of the result JSON file of this run (i.e.,my-run-id.json). If there is no run id, the user can specify his/her run id.
Warning
If the run id is a duplicate, an error will be thrown as we do not want to overwrite the result file with the same run id.
-
<test_id>: The test id of the test configuration to run. For example, this could beqa-tests-- a combination of multiple benchmark tests and red team attacks, orprompt_injection_jailbreak, a single benchmark test.
Tip
For a list of tests available in Moonshot, please download the latest copy from here.
-
<endpoint_id>: The name of the endpoint configuration for evaluation. For example, this could bemy-gpt-4o-miniif the user wishes to evaluate against OpenAI’s o4 mini model.
Tip
For a list of models currently supported in Moonshot, please download the latest copy from here.
A typical configuration for running tests in a Moonshot workflow might look like this:
jobs:
run-moonshot-in-ci:
permissions:
id-token: write
contents: read
packages: read
runs-on: ubuntu-latest
container: <your_moonshot_image>
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-southeast-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- name: Run Moonshot
run: |
cd /app
export OPENAI_API_KEY="${{ secrets.OPENAI_TOKEN }}"
export MS_TEST_CONFIG_PATH=${{ secrets.S3_URI }}
export MS_CONFIG_PATH=${{ secrets.S3_URI }}
moonshot run my-run-1 qa-tests my-gpt-4o-mini
- name: Upload Moonshot Results
uses: actions/upload-artifact@v4
with:
name: test-results
path: /app/data/results/*GitHub Actions Example
Congratulations! You have successfully learnt how to run Moonshot as a workflow action in your CI/CD!
- AI Verify Evals Toolkit Installation Guide
- AI Verify Evals Toolkit User Guide
- AI Verify Evals Toolkit Developer Guide
- Onboarding Guide for CI/CD Deployment
- Basic User Guide - Moonshot Configurations
- Basic User Guide - Running Moonshot Tests
- Advanced User Guide - Create Custom Connectors for your Application Endpoint
- Advanced User Guide - Create Custom Evaluation Metrics for your Tests
- Expert User Guide - Create Custom Moonshot Tests