AI Bill of Materials — discover and inventory all AI/LLM agents, models, and API integrations across your infrastructure.
Project description
AI-BOM
Discover every AI agent, model, and API hiding in your infrastructure
Quick Start | n8n Node | What It Finds | Comparison | Architecture | Output Formats | CI/CD | Scan Levels | Dashboard
Scan all your n8n AI workflows for security risks — directly inside n8n
Why AI-BOM?
- EU AI Act (Article 53, Aug 2025) requires a complete AI component inventory. No existing SBOM tool covers AI.
- 60%+ of AI usage is undocumented — shadow AI is the new shadow IT. Developers ship LLM integrations, agent frameworks, and MCP servers without security review.
- First tool to scan n8n workflows for AI — n8n is the backbone of enterprise AI automation, but completely invisible to Trivy, Syft, and Grype.
One command. 13 scanners. 9 output formats. Standards-compliant AI Bill of Materials.
Quick Start
pipx install ai-bom
ai-bom scan .
That's it. Scans your project and prints a risk-scored inventory of every AI component found.
# CycloneDX SBOM for compliance
ai-bom scan . -f cyclonedx -o ai-bom.cdx.json
# SARIF for GitHub Code Scanning
ai-bom scan . -f sarif -o results.sarif
# Fail CI on critical findings
ai-bom scan . --fail-on critical --quiet
Alternative: Install in a virtual environment
python3 -m venv .venv && source .venv/bin/activate
pip install ai-bom
ai-bom scan .
Troubleshooting: PEP 668 / "externally-managed-environment" error
Modern Linux distros (Ubuntu 24.04+) and macOS 14+ block pip install at the system level. Use pipx (recommended) or a venv as shown above.
sudo apt install pipx # Debian/Ubuntu
brew install pipx # macOS
pipx install ai-bom
Alternative: Run with Docker
docker run --rm -v $(pwd):/scan ghcr.io/trusera/ai-bom scan /scan
# CycloneDX output
docker run --rm -v $(pwd):/scan ghcr.io/trusera/ai-bom scan /scan -f cyclonedx -o /scan/ai-bom.cdx.json
# JSON output piped to jq
docker run --rm -v $(pwd):/scan ghcr.io/trusera/ai-bom scan /scan --json | jq '.components[] | select(.properties[]? | select(.name == "trusera:risk_score" and (.value | tonumber) > 7))'
The image is published to ghcr.io/trusera/ai-bom on every tagged release.
n8n Community Node
Scan all your n8n workflows for AI security risks — directly inside n8n. One node, full dashboard.
Install: Settings > Community Nodes > n8n-nodes-trusera
Setup (1 minute)
- Add the Trusera Webhook node to a workflow
- Add your n8n API credential (Settings > n8n API > Create API Key)
- Activate the workflow
- Visit
http://your-n8n-url/webhook/trusera
That's it. The node fetches all workflows, scans them, and serves an interactive HTML dashboard.
Included Nodes
| Node | Purpose |
|---|---|
| Trusera Webhook | One-node dashboard at /webhook/trusera (recommended) |
| Trusera Dashboard | Chain with built-in Webhook for custom setups |
| Trusera Scan | Programmatic scanning — returns JSON for CI/CD pipelines |
| Trusera Policy | Security gates — pass/fail against configurable policies |
| Trusera Report | Markdown/JSON reports for Slack, email, or docs |
Dashboard features
- Severity distribution charts, component type breakdown, and OWASP LLM Top 10 mapping
- Scanned workflows table with trigger type, component count, and risk severity
- Sortable findings table with search, severity/type/workflow filters
- Per-finding remediation cards with actionable fix steps
- CSV and JSON export
- Light/dark theme toggle
- Optional password protection (AES-256-GCM encrypted, client-side decryption)
What It Finds
| Category | Examples | Scanner |
|---|---|---|
| LLM Providers | OpenAI, Anthropic, Google AI, Mistral, Cohere, Ollama, DeepSeek | Code |
| Agent Frameworks | LangChain, CrewAI, AutoGen, LlamaIndex, LangGraph | Code |
| Model References | gpt-4o, claude-3-5-sonnet, gemini-1.5-pro, llama-3 | Code |
| API Keys | OpenAI (sk-*), Anthropic (sk-ant-*), HuggingFace (hf_*) | Code, Network |
| AI Containers | Ollama, vLLM, HuggingFace TGI, NVIDIA Triton, ChromaDB | Docker |
| Cloud AI | AWS Bedrock/SageMaker | Azure OpenAI/ML | Google Vertex AI | Cloud |
| AI Endpoints | api.openai.com, api.anthropic.com, localhost:11434 | Network |
| n8n AI Nodes | AI Agents, LLM Chat, MCP Client, Tools, Embeddings | n8n |
| MCP Servers | Model Context Protocol server configurations | Code, MCP Config |
| A2A Protocol | Google Agent-to-Agent protocol | Code |
| CrewAI Flows | @crew, @agent, @task, @flow decorators | Code, AST |
| Jupyter Notebooks | AI imports and model usage in .ipynb files | Jupyter |
| GitHub Actions | AI-related actions and model deployments | GitHub Actions |
| Model Files | .gguf, .safetensors, .onnx, .pt binary model files | Model File |
25+ AI SDKs detected across Python, JavaScript, TypeScript, Java, Go, Rust, and Ruby.
Comparison
How does ai-bom compare to existing supply chain security tools?
| Feature | ai-bom | Trivy | Syft | Grype |
|---|---|---|---|---|
| AI/LLM SDK detection | Yes | No | No | No |
| AI model references | Yes | No | No | No |
| Agent framework detection | Yes | No | No | No |
| n8n workflow scanning | Yes | No | No | No |
| MCP server detection | Yes | No | No | No |
| AI-specific risk scoring | Yes | No | No | No |
| Cloud AI service detection | Yes | No | No | No |
| Jupyter notebook scanning | Yes | No | No | No |
| CycloneDX SBOM output | Yes | Yes | Yes | No |
| SARIF output (GitHub) | Yes | Yes | No | No |
| Docker AI container detection | Yes | Partial | Partial | No |
| CVE vulnerability scanning | No | Yes | No | Yes |
| OS package scanning | No | Yes | Yes | Yes |
ai-bom doesn't replace Trivy or Syft — it fills the AI-shaped gap they leave behind.
Architecture
graph LR
subgraph Input
A[Source Code] --> S
B[Docker/K8s] --> S
C[Network/Env] --> S
D[Cloud IaC] --> S
E[n8n Workflows] --> S
F[Jupyter/.ipynb] --> S
G[MCP Configs] --> S
H[GitHub Actions] --> S
I[Model Files] --> S
end
S[Scanner Engine<br/>13 Auto-Registered Scanners] --> M[Pydantic Models<br/>AIComponent + ScanResult]
M --> R[Risk Scorer<br/>0-100 Score + Severity]
R --> C2[Compliance Modules<br/>EU AI Act, OWASP, Licenses]
subgraph Output
C2 --> O1[CycloneDX 1.6]
C2 --> O2[SARIF 2.1.0]
C2 --> O3[SPDX 3.0]
C2 --> O4[HTML Dashboard]
C2 --> O5[Markdown / CSV / JUnit]
C2 --> O6[Rich Terminal Table]
end
Key design decisions:
- Scanners auto-register via
__init_subclass__— add a new scanner in one file, zero wiring - Regex-based detection (not AST by default) for speed and cross-language support
- CycloneDX 1.6 JSON generated directly from dicts — no heavy dependencies
- Risk scoring is a pure stateless function
- Parallel scanner execution via thread pool
Output Formats
Table (default)
ai-bom scan .
Rich terminal output with color-coded severity, risk scores, and component grouping.
CycloneDX 1.6
ai-bom scan . -f cyclonedx -o ai-bom.cdx.json
Industry-standard SBOM format. Compatible with OWASP Dependency-Track. Includes Trusera AI risk properties.
Example output snippet
{
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"components": [
{
"type": "library",
"name": "openai",
"version": "1.x",
"properties": [
{ "name": "trusera:ai-bom:risk-score", "value": "45" },
{ "name": "trusera:ai-bom:severity", "value": "medium" }
]
}
]
}
SARIF 2.1.0
ai-bom scan . -f sarif -o results.sarif
Upload to GitHub Code Scanning for inline annotations on AI components.
Other formats
| Format | Flag | Use case |
|---|---|---|
| HTML | -f html |
Shareable dashboard — no server required |
| Markdown | -f markdown |
PR comments, documentation |
| SPDX 3.0 | -f spdx3 |
SPDX-compatible with AI extensions |
| CSV | -f csv |
Spreadsheet analysis |
| JUnit | -f junit |
CI/CD test reporting |
| JSON | -f json |
Alias for CycloneDX |
CI/CD Integration
GitHub Actions (recommended)
Use the official AI-BOM GitHub Action for one-line CI/CD integration:
name: AI-BOM Scan
on: [push, pull_request]
permissions:
security-events: write
contents: read
jobs:
ai-bom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for AI components
uses: trusera/ai-bom@main
with:
format: sarif
output: ai-bom-results.sarif
fail-on: critical
scan-level: deep
The action handles Python setup, ai-bom installation, and automatic SARIF upload to GitHub Code Scanning.
See .github/workflows/ai-bom-example.yml for more examples (CycloneDX SBOM, policy gates, artifact uploads).
Manual setup (without the action)
name: AI-BOM Scan
on: [push, pull_request]
jobs:
ai-bom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install AI-BOM
run: pipx install ai-bom
- name: Scan for AI components
run: ai-bom scan . --fail-on critical --quiet -f sarif -o results.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
if: always()
Policy enforcement
# Fail CI if any critical findings
ai-bom scan . --fail-on critical --quiet
# Use a YAML policy file for fine-grained control
ai-bom scan . --policy .ai-bom-policy.yml --quiet
# .ai-bom-policy.yml
max_critical: 0
max_high: 5
max_risk_score: 75
block_providers: []
block_flags:
- hardcoded_api_key
- hardcoded_credentials
Scan Levels
ai-bom's detection depth depends on the access available at scan time:
| Level | Access Required | What It Finds | Scanner |
|---|---|---|---|
| L1 — File System | Read-only file access | Source code imports, configs, IaC, n8n JSON, notebooks | Code, Cloud, n8n, Jupyter, MCP Config |
| L2 — Docker | + Docker socket | Running AI containers, GPU allocations | Docker |
| L3 — Network | + Env files | API endpoints, hardcoded keys, .env secrets | Network |
| L4 — Cloud IaC | + Terraform/CFN files | 60+ AWS/Azure/GCP AI resource types | Cloud |
| L5 — Live Cloud | + Cloud credentials | Managed AI services via cloud APIs | AWS/GCP/Azure Live |
# L1 (default) — works out of the box
ai-bom scan .
# L5 — live cloud scanning
pip install ai-bom[aws]
ai-bom scan-cloud aws
Deep scanning (AST mode)
ai-bom scan . --deep
Enables Python AST analysis for decorator patterns (@agent, @tool, @crew, @flow), function calls to AI APIs, and string literals containing model names.
Dashboard
pip install ai-bom[dashboard]
ai-bom scan . --save-dashboard # Save scan results
ai-bom dashboard # Launch at http://127.0.0.1:8000
The web dashboard provides:
- Scan history with timestamps, targets, and component counts
- Drill-down into individual scans with sortable component tables
- Severity distribution charts and risk score visualizations
- Side-by-side scan comparison (diff view)
n8n workflow scanning
# Scan workflow JSON files
ai-bom scan ./workflows/
# Scan local n8n installation
ai-bom scan . --n8n-local
# Scan running n8n instance via API
ai-bom scan . --n8n-url http://localhost:5678 --n8n-api-key YOUR_KEY
Detects AI Agent nodes, MCP client connections, webhook triggers without auth, dangerous tool combinations, and hardcoded credentials in workflow JSON.
Contributing
See CONTRIBUTING.md for development setup and guidelines.
git clone https://github.com/trusera/ai-bom.git && cd ai-bom
pip install -e ".[dev]"
pytest tests/ -v
Quality gates enforced:
- ruff (E,F,I,W,S,B,C4,UP,SIM,N,RUF) — zero lint errors
- mypy strict (
disallow_untyped_defs = true) — zero type errors - pytest — 651 tests, 80%+ coverage required
License
Apache License 2.0 — see LICENSE for details.
Star History
ai-bom is the open-source foundation of the Trusera platform for AI agent security.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_bom-3.1.0.tar.gz.
File metadata
- Download URL: ai_bom-3.1.0.tar.gz
- Upload date:
- Size: 752.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20cb48fd1eeb7fb8a12e4f072cd64569dbb79dd64f4e12048f66a80c63fccfa6
|
|
| MD5 |
1338edb910c1fb405dd39ce55dd3903a
|
|
| BLAKE2b-256 |
523dc1358ea5aa40c4d97838c43aa8a49cf3f4043ea2b57edff35abba2e9a60b
|
Provenance
The following attestation bundles were made for ai_bom-3.1.0.tar.gz:
Publisher:
publish.yml on Trusera/ai-bom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_bom-3.1.0.tar.gz -
Subject digest:
20cb48fd1eeb7fb8a12e4f072cd64569dbb79dd64f4e12048f66a80c63fccfa6 - Sigstore transparency entry: 945158316
- Sigstore integration time:
-
Permalink:
Trusera/ai-bom@ce5539845a74c0318273d582bd1f35d507dd7f1b -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/Trusera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce5539845a74c0318273d582bd1f35d507dd7f1b -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_bom-3.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_bom-3.1.0-py3-none-any.whl
- Upload date:
- Size: 138.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83899ecb43f10628bfe74f19d98c0c0a4bfa19ea2984a2bf0680d82242d90eae
|
|
| MD5 |
b88e54fb1aa85803ee8a8bd1e74d0a16
|
|
| BLAKE2b-256 |
ac9ea069693d0d0b291f65c86f8b523fd3a81df9c3d78071d4d9a43e8ab357a9
|
Provenance
The following attestation bundles were made for ai_bom-3.1.0-py3-none-any.whl:
Publisher:
publish.yml on Trusera/ai-bom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_bom-3.1.0-py3-none-any.whl -
Subject digest:
83899ecb43f10628bfe74f19d98c0c0a4bfa19ea2984a2bf0680d82242d90eae - Sigstore transparency entry: 945158367
- Sigstore integration time:
-
Permalink:
Trusera/ai-bom@ce5539845a74c0318273d582bd1f35d507dd7f1b -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/Trusera
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce5539845a74c0318273d582bd1f35d507dd7f1b -
Trigger Event:
push
-
Statement type: