Skip to main content
Strix uses standard exit codes to indicate the result of a scan. Exit codes are only meaningful in non-interactive mode.

Overview

In non-interactive mode, Strix returns different exit codes to indicate:
  • Success with no vulnerabilities found (0)
  • Errors during execution (1)
  • Success with vulnerabilities found (2)
This allows CI/CD pipelines to fail builds when security issues are discovered.

Exit Code Reference

Exit Code 0: Success - No Vulnerabilities

Meaning: The scan completed successfully and no security vulnerabilities were found. When this occurs:
  • Scan completed without errors
  • All agents finished their work
  • No vulnerabilities were reported
  • Target appears secure
CI/CD usage:

Exit Code 1: Error During Execution

Meaning: An error occurred that prevented the scan from completing successfully. Common causes:
error
Unable to connect to the language model provider.Solutions:
  • Verify STRIX_LLM environment variable is set
  • Check LLM_API_KEY is valid and not expired
  • Verify network connectivity to LLM provider
  • Check API rate limits and quotas
  • Review LLM provider service status
error
Docker daemon not running or Docker-related error.Solutions:
  • Start Docker daemon: sudo systemctl start docker
  • Verify Docker is installed: docker --version
  • Check Docker permissions: add user to docker group
  • Ensure Docker image can be pulled
  • Check available disk space
error
Invalid configuration or missing required settings.Solutions:
  • Verify all required environment variables are set
  • Check custom config file syntax if using --config
  • Ensure target is accessible and valid
  • Review instruction file contents if using --instruction-file
error
Unable to reach or access the target.Solutions:
  • Verify target URL is correct and accessible
  • Check network connectivity
  • Verify authentication if required
  • Ensure target is running if testing localhost
  • Check firewall rules
error
Unexpected error during execution.Solutions:
  • Review error output in stderr
  • Check scan logs in output directory
  • Report bug if error appears to be in Strix
  • Try running in interactive mode for more details
CI/CD usage:

Exit Code 2: Success - Vulnerabilities Found

Meaning: The scan completed successfully and security vulnerabilities were discovered. When this occurs:
  • Scan completed without errors
  • All agents finished their work
  • At least one vulnerability was reported
  • Vulnerability reports saved to output directory
This is the key exit code for CI/CD integration - it allows pipelines to fail builds when security issues are found. CI/CD usage:

CI/CD Integration Examples

Basic Build Gate

GitHub Actions

GitLab CI

Jenkins

CircleCI

Advanced Patterns

Warning Mode (Don’t Fail Build)

Allow vulnerabilities but warn:

Severity-Based Gating

Fail only on high/critical vulnerabilities:

Baseline Comparison

Fail only if new vulnerabilities are found:

Conditional Scanning

Run different scans based on branch:

Exit Code in Interactive Mode

In interactive mode (default), Strix does not use exit code 2 for vulnerabilities:
This is because:
  • Interactive mode expects human supervision
  • User manually quits when ready
  • Vulnerabilities are shown in TUI during scan
  • Exit code 2 is specifically for automation

Troubleshooting

Exit Code 1 Every Time

Problem: Scan always fails with exit code 1 Diagnosis:
Common issues:
  • Missing environment variables
  • LLM API key invalid or expired
  • Docker not running
  • Target not accessible
  • Network connectivity issues

Exit Code 0 When Vulnerabilities Expected

Problem: Scan returns 0 but you expect vulnerabilities Diagnosis:
Possible reasons:
  • Quick scan mode missed complex issues (try deep mode)
  • Target has good security posture
  • Scan needs more specific instructions
  • Agent didn’t have enough time (check scan duration)

Can’t Capture Exit Code

Problem: Exit code always appears as 0 in shell script Solutions:

Best Practices

Always Archive Results

Provide Clear Error Messages

Use Non-Zero Exit for Both Errors and Vulnerabilities

Set Timeouts

See Also