Repository navigation
feat(comply): add aisbom comply documentation packs - #133
Conversation
`aisbom comply <target> --framework {eu-ai-act|fda}` scans a target and
writes a folder of regulator-facing documents pre-filled from the scan.
- eu-ai-act: an Annex XI technical-documentation skeleton, an Article
53(1)(d) training-content summary in the sections of the Commission's
template (24 July 2025), the SBOM, and an index.
- fda: the SBOM, OpenVEX and CycloneDX VEX (with OSV CVE statements for
exact pins), a component support table, and an index.
A field is filled only from something the scan read, and names its
source. Everything else is left as "TODO (provider)" rather than
guessed. A test bans verdict language in every generated file, each
document carries a template version and a not-legal-advice disclaimer,
and a scan with an unreadable target writes no pack and exits 1.
score and comply now share one scan-and-refuse-partial helper. The
README Privacy section discloses the cli_score and cli_comply events
and the lookups comply triggers. docs/comply.md lists every field and
where its value comes from.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a804e51b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _prop_values(component, "aisbom:pickle:scan_incomplete"): | ||
| notes.append("pickle scan incomplete") | ||
| return "; ".join(notes) or "none" |
There was a problem hiding this comment.
Include non-pickle threats in the security findings summary
When the scanned target contains a malicious Keras, GGUF, or ONNX model, Appendix A reports its security findings as none even though the bundled SBOM records the threats. _findings() only checks pickle properties and unreadability, ignoring aisbom:keras:threat, aisbom:gguf:chat_template_threat, and aisbom:onnx:threat, which build_component_properties() already emits. Passing those generated properties through the pack builder reproduces rows showing CRITICAL | none. Include the other formats' threat properties before falling back to none so the regulator-facing summary does not contradict the scan.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8fa96c7. The summary now lists all four per-format threat properties (pickle opcodes, Keras threats, GGUF chat-template threats, ONNX threats). A HIGH or CRITICAL file with no recognised threat property now points at the risk rating and sbom.json instead of reading 'none', so a property added later can't surface as a clean row. Tests cover each format and the fallback, and a real malicious .keras from the mock generator now lists its Lambda threats in Appendix A.
Appendix A only read pickle properties, so a CRITICAL Keras, GGUF or ONNX file was summarised as 'none' beside the threats the bundled SBOM records. Every per-format threat property is now listed, and a HIGH or CRITICAL file with no recognised property points at the risk rating and sbom.json instead of reading 'none'.
Adds
aisbom comply, which scans a target and writes a folder of regulator-facing documents pre-filled from what the scan read.--frameworkeu-ai-actsbom.json,README.mdfdasbom.json, OpenVEX + CycloneDX VEX (OSV CVE statements for exact pins),component-support.csv,README.mdHow fields are filled
A field is filled only from something the scan read: the model card's task, architecture, licence and declared datasets, the repo and revision, file formats, hashes and security findings. Each value names its source. Everything else is written as
TODO (provider), including provider identity, release dates, training process, compute and component lifecycle dates. Parameter count is deliberately never derived from tensor shapes.docs/comply.mdlists every field and where its value comes from.Guards
scoreapplies. The two commands now share that helper.Privacy
The README Privacy section now discloses the
cli_scoreevent (previously undocumented) and the newcli_complyevent, which carries only the framework name. The OSV, PyPI and Hugging Face lookup paragraphs now mentioncomply.--offline,--no-osvand--no-hf-lookupwork as they do forscan.Verification
poetry run pytest --cov=aisbom --cov-fail-under=85: 1592 passed, coverage 94.07%,aisbom/comply.py97%.aisbom bypass-scorecard --checkpasses.hf://google-bert/bert-base-uncased(eu-ai-act, 11 fields pre-filled), a local tree with a malicious pickle and pinned requirements (fda, 35 VEX statements), and the same tree with--offline.No dependency changes. The merge does not cut a release.