A tool to scan Snyk targets for specific components in AI Bills of Materials (AI-BOMs) using the Snyk API.
This tool connects to the Snyk API to:
- Fetch all targets from your Snyk organization
- Generate AI-BOMs for each target
- Search for specific keywords/components in those AI-BOMs
- Report which targets contain the specified components
Perfect for identifying which of your Snyk organization's targets use specific AI frameworks, models, or libraries. Supports searching for multiple terms with OR logic using comma-separated values.
- Python 3.8 or higher
- Snyk account with API access
- Snyk organization with imported repositories
# Install dependencies
uv sync
# Install the project
uv pip install -e .
Set the required environment variables:
export SNYK_ORG_ID="your-organization-id"
export SNYK_TOKEN="your-snyk-api-token"
# Optional: Use different Snyk API URL (defaults to https://api.snyk.io)
export SNYK_API_URL="https://api.snyk.io"
- Snyk Token: Go to Snyk Account Settings → Auth Token
- Organization ID: Found in your Snyk organization URL or API responses
# Basic usage
ai-bom-scan "deepseek"
# Search for multiple terms with OR logic (comma-separated)
ai-bom-scan "deepseek,openai"
# Enable debug output
ai-bom-scan --debug "pytorch"
# Get help
ai-bom-scan --help
# Run directly with uv
uv run python main.py "deepseek"
# With debug mode
uv run python main.py --debug "deepseek"
ai-bom-scan "deepseek"
Output:
Starting scan to find targets using 'deepseek'...
Found 45 total targets in the organization.
Scan Complete
==================================================
✅ Found matches in 3 targets:
• my-org/ml-project (deepseek)
• my-org/data-science-tools (deepseek)
• my-org/ai-experiments (deepseek)
...
==================================================
ai-bom-scan "deepseek,openai,anthropic"
Output:
Starting scan to find targets using any of: 'deepseek', 'openai', 'anthropic'...
Found 45 total targets in the organization.
Scan Complete
==================================================
✅ Found matches in 8 targets:
• my-org/ml-project (openai)
• my-org/chatbot-service (openai,anthropic)
• my-org/ai-experiments (deepseek)
• my-org/content-generator (openai)
• my-org/voice-assistant (anthropic)
• my-org/smart-recommendations (openai,deepseek)
• my-org/language-tools (anthropic)
• my-org/research-prototype (deepseek,openai)
==================================================
ai-bom-scan --debug "openai,claude"
This will show detailed information about:
- API requests being made
- Job status updates
- Processing details for each repository
- Fetch Repositories: Retrieves all targets from your Snyk organization
- Filter Compatible Targets: Only processes Git-based repositories (GitHub, GitLab, etc.)
- Generate AI-BOMs: Creates AI Bill of Materials for each repository
- Search: Looks for your keyword in the AI-BOM content
- Report: Shows which repositories contain the specified component
- GitHub
- GitHub Enterprise
- GitLab
- Azure Repos
- Bitbucket Cloud
Container images and manual uploads are automatically skipped.
# Clone the repository
git clone <repository-url>
cd ai-bom-scan
# Install in editable mode with uv
uv pip install -e .
# Or with pip
pip install -e .
ai-bom-scan/
├── main.py # Main application code
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lock file
└── README.md # This file
After making changes to main.py
, the console command will immediately reflect your changes (thanks to editable install with -e
).
This tool uses Snyk AI-BOM API version 2025-07-22
. If you need to use a different API version, you can modify the default in the SnykAIBomScanner
class.
"Error: Please set SNYK_ORG_ID and SNYK_TOKEN environment variables"
- Make sure both environment variables are set correctly
- Verify your token is valid and has the necessary permissions
"Could not retrieve any targets"
- Check that your organization has repositories connected
- Verify your token has access to the specified organization
Use --debug
flag to see detailed information about:
- API requests and responses
- Job polling status
- Target processing details
- Keyword search results