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.
GitHub Actions
GitLab CI
CircleCI
Add flintai-cli to your GitHub Actions workflow:name: Agent validation
on: [pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install flintai-cli
run: pip install flintai-cli
- name: Scan agent code
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: flintai scan ./agent --output scan-results.json
- name: Upload scan results
uses: actions/upload-artifact@v7
with:
name: flintai-scan-results
path: scan-results.json
Attach the artifact to your PR as proof you validated before merge.GitHub Actions documentation → Add flintai-cli to your .gitlab-ci.yml:stages:
- validate
scan-agent:
stage: validate
image: python:3.13
script:
- pip install flintai-cli
- flintai scan ./agent --output scan-results.json
artifacts:
paths:
- scan-results.json
expire_in: 30 days
variables:
GEMINI_API_KEY: $GEMINI_API_KEY
The artifact is automatically attached to your merge request.GitLab CI documentation → Add flintai-cli to your .circleci/config.yml:version: 2.1
jobs:
scan:
docker:
- image: cimg/python:3.13
steps:
- checkout
- run:
name: Install flintai-cli
command: pip install flintai-cli
- run:
name: Scan agent code
command: flintai scan ./agent --output scan-results.json
environment:
GEMINI_API_KEY: ${GEMINI_API_KEY}
- store_artifacts:
path: scan-results.json
destination: flintai-scan-results
workflows:
validate:
jobs:
- scan
Access artifacts from the job’s Artifacts tab.CircleCI documentation →
Exit codes
Flint AI Scan returns standard exit codes for CI/CD integration:
| Code | Meaning |
|---|
0 | Scan completed successfully |
1 | Scan failed (invalid path, no Python files, etc.) |
Exit code 0 means the scan ran successfully, not that no issues were found. Check the JSON results to see findings.
Other CI systems
The core pattern works anywhere:
- Install Python 3.13+
- Install
flintai-cli with pip
- Set your LLM API key as an environment variable
- Run
flintai scan /path/to/agent --output results.json
- Save
results.json as a build artifact