Skip to main content
Save scan and eval results as build artifacts to prove validation before deployment.
API keys required. Add your LLM provider API key (Gemini, OpenAI, or Anthropic) to your CI system’s secrets/environment variables. Never commit API keys to your repository.
Install OpenGrep in your pipeline. flintai scan uses OpenGrep for pattern analysis, and pip install flintai-cli doesn’t include it. Without it the scan still succeeds and writes results, but skips the pattern layer — a passing build that checked less than you think. Each example below installs it and puts it on PATH.
Add flintai-cli to your GitHub Actions workflow:
Attach the artifact to your PR as proof you validated before merge.GitHub Actions documentation →

Output formats

Flint AI CLI writes results as JSON or as SARIF (Static Analysis Results Interchange Format), an open standard for reporting analysis findings. Tools that read SARIF ingest results from any SARIF-producing tool without a custom parser, so your findings land alongside the rest of your security results instead of in a file nobody opens. Flint AI CLI writes SARIF 2.1.0.

Set the format

flintai scan and flintai eval run write JSON unless you ask for something else. Pass --format sarif (short form -f) to write SARIF instead. The output filename follows the format you choose:

What SARIF output contains

Findings map to file locations with line numbers, and severity maps to SARIF levels: critical and high findings become error, medium becomes warning, and everything else becomes note.This is the output GitHub code scanning is built to read.Upload to GitHub code scanning:
Findings then appear in the Security tab of your repository and as annotations on the pull request, so reviewers see them without downloading an artifact.

Exit codes

Flint AI Scan returns standard exit codes for CI/CD integration:
Exit code 0 means the scan ran successfully, not that no issues were found. Check the results file to see findings.

Other CI systems

The core pattern works anywhere:
1

Provide Python 3.11 or later

Flint AI CLI requires Python 3.11 or later. Use a prebuilt image where you can, such as python:3.11.
2

Install Flint AI CLI

3

Install OpenGrep and put it on PATH

Add $HOME/.opengrep/cli/latest to PATH. This is the part that differs most between systems, because most of them run each step in a fresh shell: GitHub Actions writes the path to $GITHUB_PATH, CircleCI appends an export to $BASH_ENV, and GitLab CI runs the whole job in one shell, so a plain export carries. Find your system’s equivalent for persisting environment changes between steps.
4

Set your LLM API key

Store the key as a secret and expose it to the job as an environment variable: GEMINI_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY.
5

Run the scan

Add --format sarif to write SARIF instead. See Output formats.
6

Save the results as a build artifact

Use your CI system’s artifact mechanism so the file outlives the job and reviewers can reach it from the pull request.