aibom-scanner 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. aibom_scanner-1.0.0/.github/workflows/ci.yml +21 -0
  2. aibom_scanner-1.0.0/.github/workflows/publish.yml +20 -0
  3. aibom_scanner-1.0.0/.gitignore +16 -0
  4. aibom_scanner-1.0.0/CHANGELOG.md +16 -0
  5. aibom_scanner-1.0.0/CONTRIBUTING.md +36 -0
  6. aibom_scanner-1.0.0/LICENSE +190 -0
  7. aibom_scanner-1.0.0/PKG-INFO +189 -0
  8. aibom_scanner-1.0.0/README.md +166 -0
  9. aibom_scanner-1.0.0/action.yml +27 -0
  10. aibom_scanner-1.0.0/examples/sample-output.json +953 -0
  11. aibom_scanner-1.0.0/pyproject.toml +43 -0
  12. aibom_scanner-1.0.0/src/aibom_scanner/__init__.py +3 -0
  13. aibom_scanner-1.0.0/src/aibom_scanner/__main__.py +5 -0
  14. aibom_scanner-1.0.0/src/aibom_scanner/cli.py +96 -0
  15. aibom_scanner-1.0.0/src/aibom_scanner/control_mapper.py +119 -0
  16. aibom_scanner-1.0.0/src/aibom_scanner/detectors/__init__.py +0 -0
  17. aibom_scanner-1.0.0/src/aibom_scanner/detectors/ai_sdk.py +551 -0
  18. aibom_scanner-1.0.0/src/aibom_scanner/detectors/dev_tools.py +40 -0
  19. aibom_scanner-1.0.0/src/aibom_scanner/detectors/secrets.py +276 -0
  20. aibom_scanner-1.0.0/src/aibom_scanner/formatters/__init__.py +0 -0
  21. aibom_scanner-1.0.0/src/aibom_scanner/formatters/json_fmt.py +11 -0
  22. aibom_scanner-1.0.0/src/aibom_scanner/formatters/sarif_fmt.py +68 -0
  23. aibom_scanner-1.0.0/src/aibom_scanner/formatters/table_fmt.py +109 -0
  24. aibom_scanner-1.0.0/src/aibom_scanner/models.py +58 -0
  25. aibom_scanner-1.0.0/src/aibom_scanner/risk_engine.py +586 -0
  26. aibom_scanner-1.0.0/src/aibom_scanner/scanner.py +207 -0
  27. aibom_scanner-1.0.0/tests/__init__.py +0 -0
  28. aibom_scanner-1.0.0/tests/conftest.py +92 -0
  29. aibom_scanner-1.0.0/tests/test_ai_sdk_detector.py +106 -0
  30. aibom_scanner-1.0.0/tests/test_cli.py +49 -0
  31. aibom_scanner-1.0.0/tests/test_risk_engine.py +71 -0
  32. aibom_scanner-1.0.0/tests/test_scanner.py +63 -0
@@ -0,0 +1,21 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - run: pip install -e ".[dev]" || pip install -e . && pip install pytest
21
+ - run: PYTHONPATH=src pytest tests/ -v
@@ -0,0 +1,20 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - run: pip install build
19
+ - run: python -m build
20
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,16 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.egg
9
+ .venv/
10
+ venv/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .mypy_cache/
14
+ *.so
15
+ .coverage
16
+ htmlcov/
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (2026-04-10)
4
+
5
+ Initial release.
6
+
7
+ - 61 AI SDK detection patterns across 30+ providers
8
+ - 10 Chinese AI providers with BIS Entity List flagging (3 CRITICAL)
9
+ - Agentic AI framework detection (CrewAI, AutoGen, LangGraph, Semantic Kernel, MCP)
10
+ - 34 risk rules across 8 categories with evidence qualification
11
+ - 48 compliance controls mapped to NIST AI RMF, ISO 42001, EU AI Act
12
+ - Secrets management detection (Vault, AWS SM, dotenv, hardcoded keys)
13
+ - Dev tool detection (Cursor, Copilot, Claude Code, Aider, etc.)
14
+ - Output formats: table (terminal), JSON, SARIF (GitHub Code Scanning)
15
+ - GitHub Action for CI integration
16
+ - Zero dependencies beyond Python stdlib
@@ -0,0 +1,36 @@
1
+ # Contributing to aibom-scanner
2
+
3
+ Thanks for your interest in contributing.
4
+
5
+ ## How to contribute
6
+
7
+ 1. Fork the repo
8
+ 2. Create a branch: `git checkout -b feat/your-feature`
9
+ 3. Make your changes
10
+ 4. Run tests: `PYTHONPATH=src pytest tests/ -v`
11
+ 5. Submit a PR
12
+
13
+ ## Adding detection patterns
14
+
15
+ Detection patterns live in `src/aibom_scanner/detectors/ai_sdk.py`. Each pattern is a tuple:
16
+
17
+ ```python
18
+ (provider, sdk_name, regex_pattern, detection_type)
19
+ ```
20
+
21
+ Where `detection_type` is one of: `import`, `api_call`, `config`, `dependency`.
22
+
23
+ ## Adding risk rules
24
+
25
+ Risk rules live in `src/aibom_scanner/risk_engine.py` in the `RISK_RULES` list. Each rule needs:
26
+ - `category`, `title`, `severity`, `providers`, `remediation`, `framework_refs`
27
+
28
+ ## Code style
29
+
30
+ - Python 3.10+
31
+ - Zero external dependencies (stdlib only)
32
+ - `ruff` for linting (line length 120)
33
+
34
+ ## License
35
+
36
+ By contributing, you agree that your contributions will be licensed under Apache-2.0.
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 SaaSVista
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: aibom-scanner
3
+ Version: 1.0.0
4
+ Summary: Scan codebases for AI SDK usage and map compliance risks to NIST AI RMF, ISO 42001, and EU AI Act
5
+ Project-URL: Homepage, https://github.com/saasvista/aibom-scanner
6
+ Project-URL: Documentation, https://github.com/saasvista/aibom-scanner#readme
7
+ Project-URL: Issues, https://github.com/saasvista/aibom-scanner/issues
8
+ Author-email: Mike Carroll <mike@saasvista.io>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: ai,aibom,compliance,eu-ai-act,governance,iso42001,nist,risk,sbom,security
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Security
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+
24
+ # aibom-scanner
25
+
26
+ Scan codebases for AI SDK usage. Map compliance risks to NIST AI RMF, ISO 42001, and EU AI Act.
27
+
28
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
29
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
30
+ [![Tests](https://img.shields.io/badge/tests-43%20passing-green.svg)]()
31
+
32
+ ## What it does
33
+
34
+ `aibom-scanner` detects AI SDKs in your codebase and generates an **AI Bill of Materials (AIBOM)** with compliance risk findings.
35
+
36
+ - **61 detection patterns** across 30+ AI providers (OpenAI, Anthropic, Google AI, AWS Bedrock, Cohere, Mistral, Groq, HuggingFace, and more)
37
+ - **10 Chinese AI providers** with US BIS Entity List flagging (Zhipu, iFlytek, SenseTime = CRITICAL)
38
+ - **Agentic AI** detection (CrewAI, AutoGen, LangGraph, Semantic Kernel, MCP)
39
+ - **34 risk rules** across 8 categories with evidence-qualified severity
40
+ - **48 compliance controls** mapped to NIST AI RMF (23), ISO 42001 (15), EU AI Act (10)
41
+ - **Secrets detection** — hardcoded API keys, Vault, AWS Secrets Manager, dotenv patterns
42
+ - **Dev tool detection** — Cursor, GitHub Copilot, Claude Code, Aider, TabNine, Codeium
43
+ - **Zero dependencies** — pure Python stdlib
44
+
45
+ ## Quick start
46
+
47
+ ```bash
48
+ pip install aibom-scanner
49
+
50
+ # Scan a directory
51
+ aibom-scanner scan --path /path/to/your/repo
52
+
53
+ # JSON output
54
+ aibom-scanner scan --path . --format json > aibom.json
55
+
56
+ # Fail CI on high/critical findings
57
+ aibom-scanner scan --path . --severity-threshold high
58
+ ```
59
+
60
+ ## Sample output
61
+
62
+ ```
63
+ AIBOM Scanner Results
64
+ ──────────────────────────────────────────────────────────────────────
65
+ Scanned 247 files
66
+ Found 33 AI SDK detections + 8 dependency detections
67
+ Providers: openai (12), anthropic (8), deepseek (5), zhipu (3), langchain (3), mcp (2)
68
+
69
+ Risk Findings (9)
70
+ ──────────────────────────────────────────────────────────────────────
71
+ CRITICAL: 1
72
+ HIGH: 4
73
+ MEDIUM: 3
74
+ LOW: 1
75
+
76
+ [CRITICAL] US Entity List violation — prohibited Chinese AI provider
77
+ Providers: zhipu
78
+ Frameworks: NIST-GOVERN-1.6, ISO-42001-A.7.3, EU-AI-ACT-ART-5
79
+
80
+ [HIGH ] Chinese AI provider — data sovereignty risk
81
+ Providers: deepseek
82
+ Frameworks: NIST-GOVERN-1.6, ISO-42001-A.7.5, EU-AI-ACT-ART-10
83
+
84
+ [HIGH ] AI model usage without governance framework
85
+ Providers: openai, anthropic, deepseek, zhipu, langchain, mcp
86
+ Frameworks: NIST-GOVERN-1.1, ISO-42001-5.1, EU-AI-ACT-ART-9
87
+ ...
88
+ ```
89
+
90
+ ## Output formats
91
+
92
+ | Format | Use case | Flag |
93
+ |--------|----------|------|
94
+ | **table** | Terminal (default) | `--format table` |
95
+ | **json** | Programmatic processing | `--format json` |
96
+ | **sarif** | GitHub Code Scanning | `--format sarif` |
97
+
98
+ ## GitHub Action
99
+
100
+ Add AI compliance scanning to your CI pipeline:
101
+
102
+ ```yaml
103
+ # .github/workflows/aibom-scan.yml
104
+ name: AIBOM Scan
105
+ on: [push, pull_request]
106
+ jobs:
107
+ scan:
108
+ runs-on: ubuntu-latest
109
+ steps:
110
+ - uses: actions/checkout@v4
111
+ - uses: saasvista/aibom-scanner@v1
112
+ with:
113
+ severity-threshold: high
114
+ ```
115
+
116
+ ## What it detects
117
+
118
+ ### AI Providers (30+)
119
+
120
+ | Category | Providers |
121
+ |----------|-----------|
122
+ | **Major** | OpenAI, Anthropic, Google AI, AWS Bedrock, Azure OpenAI, Cohere, Mistral, Groq |
123
+ | **Open Source** | HuggingFace, Together AI, Fireworks, Replicate |
124
+ | **Chinese (BIS Entity List)** | Zhipu AI, iFlytek, SenseTime |
125
+ | **Chinese (Data Sovereignty)** | DeepSeek, Alibaba Qwen, Baidu ERNIE, Moonshot, MiniMax, Baichuan, Yi |
126
+ | **Agentic** | CrewAI, AutoGen, LangGraph, Semantic Kernel |
127
+ | **Protocol** | MCP (Model Context Protocol) |
128
+ | **Orchestration** | LangChain, LlamaIndex |
129
+
130
+ ### Risk Categories (8)
131
+
132
+ | Category | Rules | Example |
133
+ |----------|-------|---------|
134
+ | Data Privacy | 4 | Missing DPA, data classification, prompt retention |
135
+ | Model Governance | 8 | No inventory, no versioning, supply chain risk |
136
+ | Security | 4 | Hardcoded keys, no input/output validation |
137
+ | Transparency | 3 | No AI disclosure, no decision logging |
138
+ | Accountability | 3 | No risk owner, no incident response plan |
139
+ | Bias & Fairness | 2 | No bias testing, no fairness evaluation |
140
+ | Compliance | 4 | BIS Entity List, data sovereignty, EU AI Act |
141
+ | Agentic AI | 5 | No HITL, no access controls, no observability |
142
+
143
+ ### Compliance Frameworks (3)
144
+
145
+ | Framework | Controls | Coverage |
146
+ |-----------|----------|----------|
147
+ | **NIST AI RMF** | 23 | GOVERN, MAP, MEASURE, MANAGE functions |
148
+ | **ISO 42001** | 15 | AI management system requirements |
149
+ | **EU AI Act** | 10 | Articles 5-52, high-risk classification |
150
+
151
+ ## How it works
152
+
153
+ ```
154
+ Your Codebase → File Walker → AI SDK Detector → Risk Engine → Control Mapper → Output
155
+ ↓ ↓ ↓ ↓
156
+ git ls-files 61 regex patterns 34 rules 48 controls
157
+ os.walk model extraction 8 categories 3 frameworks
158
+ dependency scan evidence qual gap analysis
159
+ secrets detection consolidation
160
+ ```
161
+
162
+ 1. **Walk** — Lists files via `git ls-files` (or `os.walk` for non-git dirs)
163
+ 2. **Detect** — Matches 61 patterns for AI imports, API calls, configs, and dependencies
164
+ 3. **Classify** — Applies 34 risk rules with severity and evidence qualification
165
+ 4. **Consolidate** — Merges related findings into actionable risk groups
166
+ 5. **Map** — Maps risks to 48 controls across NIST AI RMF, ISO 42001, and EU AI Act
167
+
168
+ ## Why this exists
169
+
170
+ We scanned 5 popular open-source AI repos (470K combined GitHub stars). Found 389 AI SDK detections, 116 compliance findings, and zero governance controls fully mapped in any of them. One enterprise security company had a BIS Entity-Listed Chinese AI provider inherited silently through an acquisition.
171
+
172
+ EU AI Act enforcement starts August 2026. Enterprise buyers are asking AI governance questions in every procurement questionnaire. If you don't know what AI SDKs are in your codebase, you can't answer them.
173
+
174
+ ## Contributing
175
+
176
+ Contributions welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
177
+
178
+ - **Add detection patterns** — new AI providers, SDKs, or frameworks
179
+ - **Improve risk rules** — better severity calibration, new categories
180
+ - **New output formats** — CycloneDX, SPDX, HTML reports
181
+ - **Language support** — Go, Rust, Java detection improvements
182
+
183
+ ## License
184
+
185
+ Apache-2.0. See [LICENSE](LICENSE).
186
+
187
+ ---
188
+
189
+ Built by [SaaSVista](https://saasvista.io) — AI Risk & Compliance Copilot.
@@ -0,0 +1,166 @@
1
+ # aibom-scanner
2
+
3
+ Scan codebases for AI SDK usage. Map compliance risks to NIST AI RMF, ISO 42001, and EU AI Act.
4
+
5
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+ [![Tests](https://img.shields.io/badge/tests-43%20passing-green.svg)]()
8
+
9
+ ## What it does
10
+
11
+ `aibom-scanner` detects AI SDKs in your codebase and generates an **AI Bill of Materials (AIBOM)** with compliance risk findings.
12
+
13
+ - **61 detection patterns** across 30+ AI providers (OpenAI, Anthropic, Google AI, AWS Bedrock, Cohere, Mistral, Groq, HuggingFace, and more)
14
+ - **10 Chinese AI providers** with US BIS Entity List flagging (Zhipu, iFlytek, SenseTime = CRITICAL)
15
+ - **Agentic AI** detection (CrewAI, AutoGen, LangGraph, Semantic Kernel, MCP)
16
+ - **34 risk rules** across 8 categories with evidence-qualified severity
17
+ - **48 compliance controls** mapped to NIST AI RMF (23), ISO 42001 (15), EU AI Act (10)
18
+ - **Secrets detection** — hardcoded API keys, Vault, AWS Secrets Manager, dotenv patterns
19
+ - **Dev tool detection** — Cursor, GitHub Copilot, Claude Code, Aider, TabNine, Codeium
20
+ - **Zero dependencies** — pure Python stdlib
21
+
22
+ ## Quick start
23
+
24
+ ```bash
25
+ pip install aibom-scanner
26
+
27
+ # Scan a directory
28
+ aibom-scanner scan --path /path/to/your/repo
29
+
30
+ # JSON output
31
+ aibom-scanner scan --path . --format json > aibom.json
32
+
33
+ # Fail CI on high/critical findings
34
+ aibom-scanner scan --path . --severity-threshold high
35
+ ```
36
+
37
+ ## Sample output
38
+
39
+ ```
40
+ AIBOM Scanner Results
41
+ ──────────────────────────────────────────────────────────────────────
42
+ Scanned 247 files
43
+ Found 33 AI SDK detections + 8 dependency detections
44
+ Providers: openai (12), anthropic (8), deepseek (5), zhipu (3), langchain (3), mcp (2)
45
+
46
+ Risk Findings (9)
47
+ ──────────────────────────────────────────────────────────────────────
48
+ CRITICAL: 1
49
+ HIGH: 4
50
+ MEDIUM: 3
51
+ LOW: 1
52
+
53
+ [CRITICAL] US Entity List violation — prohibited Chinese AI provider
54
+ Providers: zhipu
55
+ Frameworks: NIST-GOVERN-1.6, ISO-42001-A.7.3, EU-AI-ACT-ART-5
56
+
57
+ [HIGH ] Chinese AI provider — data sovereignty risk
58
+ Providers: deepseek
59
+ Frameworks: NIST-GOVERN-1.6, ISO-42001-A.7.5, EU-AI-ACT-ART-10
60
+
61
+ [HIGH ] AI model usage without governance framework
62
+ Providers: openai, anthropic, deepseek, zhipu, langchain, mcp
63
+ Frameworks: NIST-GOVERN-1.1, ISO-42001-5.1, EU-AI-ACT-ART-9
64
+ ...
65
+ ```
66
+
67
+ ## Output formats
68
+
69
+ | Format | Use case | Flag |
70
+ |--------|----------|------|
71
+ | **table** | Terminal (default) | `--format table` |
72
+ | **json** | Programmatic processing | `--format json` |
73
+ | **sarif** | GitHub Code Scanning | `--format sarif` |
74
+
75
+ ## GitHub Action
76
+
77
+ Add AI compliance scanning to your CI pipeline:
78
+
79
+ ```yaml
80
+ # .github/workflows/aibom-scan.yml
81
+ name: AIBOM Scan
82
+ on: [push, pull_request]
83
+ jobs:
84
+ scan:
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+ - uses: saasvista/aibom-scanner@v1
89
+ with:
90
+ severity-threshold: high
91
+ ```
92
+
93
+ ## What it detects
94
+
95
+ ### AI Providers (30+)
96
+
97
+ | Category | Providers |
98
+ |----------|-----------|
99
+ | **Major** | OpenAI, Anthropic, Google AI, AWS Bedrock, Azure OpenAI, Cohere, Mistral, Groq |
100
+ | **Open Source** | HuggingFace, Together AI, Fireworks, Replicate |
101
+ | **Chinese (BIS Entity List)** | Zhipu AI, iFlytek, SenseTime |
102
+ | **Chinese (Data Sovereignty)** | DeepSeek, Alibaba Qwen, Baidu ERNIE, Moonshot, MiniMax, Baichuan, Yi |
103
+ | **Agentic** | CrewAI, AutoGen, LangGraph, Semantic Kernel |
104
+ | **Protocol** | MCP (Model Context Protocol) |
105
+ | **Orchestration** | LangChain, LlamaIndex |
106
+
107
+ ### Risk Categories (8)
108
+
109
+ | Category | Rules | Example |
110
+ |----------|-------|---------|
111
+ | Data Privacy | 4 | Missing DPA, data classification, prompt retention |
112
+ | Model Governance | 8 | No inventory, no versioning, supply chain risk |
113
+ | Security | 4 | Hardcoded keys, no input/output validation |
114
+ | Transparency | 3 | No AI disclosure, no decision logging |
115
+ | Accountability | 3 | No risk owner, no incident response plan |
116
+ | Bias & Fairness | 2 | No bias testing, no fairness evaluation |
117
+ | Compliance | 4 | BIS Entity List, data sovereignty, EU AI Act |
118
+ | Agentic AI | 5 | No HITL, no access controls, no observability |
119
+
120
+ ### Compliance Frameworks (3)
121
+
122
+ | Framework | Controls | Coverage |
123
+ |-----------|----------|----------|
124
+ | **NIST AI RMF** | 23 | GOVERN, MAP, MEASURE, MANAGE functions |
125
+ | **ISO 42001** | 15 | AI management system requirements |
126
+ | **EU AI Act** | 10 | Articles 5-52, high-risk classification |
127
+
128
+ ## How it works
129
+
130
+ ```
131
+ Your Codebase → File Walker → AI SDK Detector → Risk Engine → Control Mapper → Output
132
+ ↓ ↓ ↓ ↓
133
+ git ls-files 61 regex patterns 34 rules 48 controls
134
+ os.walk model extraction 8 categories 3 frameworks
135
+ dependency scan evidence qual gap analysis
136
+ secrets detection consolidation
137
+ ```
138
+
139
+ 1. **Walk** — Lists files via `git ls-files` (or `os.walk` for non-git dirs)
140
+ 2. **Detect** — Matches 61 patterns for AI imports, API calls, configs, and dependencies
141
+ 3. **Classify** — Applies 34 risk rules with severity and evidence qualification
142
+ 4. **Consolidate** — Merges related findings into actionable risk groups
143
+ 5. **Map** — Maps risks to 48 controls across NIST AI RMF, ISO 42001, and EU AI Act
144
+
145
+ ## Why this exists
146
+
147
+ We scanned 5 popular open-source AI repos (470K combined GitHub stars). Found 389 AI SDK detections, 116 compliance findings, and zero governance controls fully mapped in any of them. One enterprise security company had a BIS Entity-Listed Chinese AI provider inherited silently through an acquisition.
148
+
149
+ EU AI Act enforcement starts August 2026. Enterprise buyers are asking AI governance questions in every procurement questionnaire. If you don't know what AI SDKs are in your codebase, you can't answer them.
150
+
151
+ ## Contributing
152
+
153
+ Contributions welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
154
+
155
+ - **Add detection patterns** — new AI providers, SDKs, or frameworks
156
+ - **Improve risk rules** — better severity calibration, new categories
157
+ - **New output formats** — CycloneDX, SPDX, HTML reports
158
+ - **Language support** — Go, Rust, Java detection improvements
159
+
160
+ ## License
161
+
162
+ Apache-2.0. See [LICENSE](LICENSE).
163
+
164
+ ---
165
+
166
+ Built by [SaaSVista](https://saasvista.io) — AI Risk & Compliance Copilot.