Skip to content

feat(comply): add aisbom comply documentation packs - #133

Merged
lab700xdev merged 2 commits into
mainfrom
feat/comply-command
Nov 8, 2026
Merged

lab700xdev merged 2 commits into
mainfrom
feat/comply-command

Conversation

@lab700xdev

Copy link
Copy Markdown
Contributor

Adds aisbom comply, which scans a target and writes a folder of regulator-facing documents pre-filled from what the scan read.

aisbom comply hf://google-bert/bert-base-uncased --framework eu-ai-act
aisbom comply ./models --framework fda --output-dir ./submission/sbom
--framework Writes
eu-ai-act Annex XI technical-documentation skeleton, Article 53(1)(d) training-content summary in the sections of the Commission's template (24 July 2025), sbom.json, README.md
fda sbom.json, OpenVEX + CycloneDX VEX (OSV CVE statements for exact pins), component-support.csv, README.md

How 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.md lists every field and where its value comes from.

Guards

  • A test fails if any generated file contains verdict language ("compliant", "certified", "guarantee", …).
  • Every Markdown document states its template version and ends with a not-legal-advice disclaimer.
  • A scan in which any target could not be read writes no pack and exits 1, the same rule score applies. The two commands now share that helper.
  • The FDA index does not claim VEX is required. It presents VEX as one machine-readable way to record the per-vulnerability assessment FDA's guidance asks for.

Privacy

The README Privacy section now discloses the cli_score event (previously undocumented) and the new cli_comply event, which carries only the framework name. The OSV, PyPI and Hugging Face lookup paragraphs now mention comply. --offline, --no-osv and --no-hf-lookup work as they do for scan.

Verification

  • poetry run pytest --cov=aisbom --cov-fail-under=85: 1592 passed, coverage 94.07%, aisbom/comply.py 97%.
  • aisbom bypass-scorecard --check passes.
  • Live runs: 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.
  • New CI smoke step runs both frameworks and checks every promised file exists.

No dependency changes. The merge does not cut a release.

`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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T00:57:32.696214Z 6a804e5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread aisbom/comply.py Outdated
Comment on lines +314 to +316
if _prop_values(component, "aisbom:pickle:scan_incomplete"):
notes.append("pickle scan incomplete")
return "; ".join(notes) or "none"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.
@lab700xdev
lab700xdev merged commit cb72014 into main Nov 8, 2026
2 checks passed
@lab700xdev
lab700xdev deleted the feat/comply-command branch November 8, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant