Exit code reference
Which commands use exit codes
Using exit codes in CI
Basic pass/fail gate
--quiet flag suppresses output, so the command just returns a code. Useful when you only care about pass/fail.
Shell conditionals
GitHub Actions branch protection
In your workflow, a non-zero exit code automatically fails the check:Threshold-based gates
--threshold flag makes ai-blackteam benchmark exit 1 if the score is below the specified percentage. This is the recommended way to set a minimum safety bar.
Combining with deployment
&& ensures deployment only happens if safety passes.
Multiple conditions
Handling exit code 2
Exit code 2 means a configuration problem, not a safety issue. Common causes:- API key not set in environment or config
- Unknown provider name (typo)
- Unknown attack name
- Missing required flags