AIsbom Security Scanner
July 20, 2026 ยท View on GitHub
Deep binary introspection of ML model artifacts in your PRs. Scans .pt, .safetensors, and .gguf files for pickle-bomb malware, license risk, and silent drift, then posts a single idempotent comment to your PR with the findings.
Marketplace ยท CLI on PyPI ยท Docs
Quick start
name: AIsbom Security Scan
on:
pull_request:
paths:
- 'models/**'
- 'requirements.txt'
permissions:
contents: read
pull-requests: write # required for the PR comment
jobs:
aisbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Lab700xOrg/aisbom@v1
with:
directory: models/
That's it. The Action will:
- Scan the
models/directory in your PR head. - Upload the resulting SBOM to
aisbom.io(via the existing--shareflow) for a hosted viewer URL. - Post or update a markdown comment on the PR summarizing findings and linking to the viewer.
- Fail the job (exit 2) if any CRITICAL findings were detected, unless you set
fail-on-risk: false.
What the PR comment looks like
A two-section panel with the highest-risk artifacts and a viewer link:
๐ก๏ธ AIsbom Security Scan
Summary: 2 CRITICAL, 1 HIGH, 4 MEDIUM across 7 model artifact(s).
Findings
| Risk | Artifact | Format | License | Issue |
| ๐ด CRITICAL | `models/cls.pt` | PyTorch | MIT | Pickle: os.system |
| ๐ด CRITICAL | `models/seg.pt` | PyTorch | MIT | Pickle: subprocess |
| ๐ HIGH | `models/bert.st` | SafeTensors | Apache-2.0 | Unknown metadata |
[View full SBOM in viewer โ](https://aisbom.io/viewer?h=Kx9pQ2v3mLnB&ref=action)
๐ฆ Generated by AIsbom ยท scanned `models/` ยท 7 artifact(s) total
When there are no CRITICAL or HIGH findings, the comment collapses to a one-line โ
confirmation. To suppress the comment entirely on clean PRs, set comment-on-clean: false.
Inputs
| Name | Default | Description |
|---|---|---|
directory | . | Directory to scan recursively for AI model artifacts. |
output-file | sbom.json | Where to save the generated SBOM JSON in the workspace. |
github-token | ${{ github.token }} | Token used to post the PR comment. The workflow needs pull-requests: write. |
max-rows | 10 | Maximum rows shown in the findings table; overflow collapses into a "+ N more" line. |
comment-on-clean | true | Post a comment when no CRITICAL/HIGH findings detected. Set to "false" for silence on clean PRs. |
fail-on-risk | true | Exit non-zero on CRITICAL findings. Set to "false" to make scans informational. |
token | (empty) | Optional. Per-repo API token for posting the generated SBOM to your hosted inventory dashboard at app.aisbom.io. Leave unset for purely local PR-comment behavior. Get a token at https://app.aisbom.io/connect. |
platform-url | https://app.aisbom.io | Override for the platform webhook URL. Only meaningful when token is set. |
fail-on-platform-error | false | Default false. When true, a failed upload fails the CI job. |
Outputs
| Name | Description |
|---|---|
sbom-path | Path to the generated SBOM (default sbom.json). |
share-url | Hosted viewer URL for the SBOM (empty if upload was skipped or failed). |
Example downstream usage:
- uses: Lab700xOrg/aisbom@v1
id: aisbom
with:
directory: models/
- name: Echo viewer link
run: echo "SBOM at ${{ steps.aisbom.outputs.share-url }}"
Permissions
The minimum needed by the consuming workflow:
permissions:
contents: read # to read the PR head
pull-requests: write # to post / update the comment
If you omit pull-requests: write, the scan still runs and the SBOM is still produced โ the Action just logs the permission error and skips the comment. Your workflow won't fail over a configuration issue.
Comment idempotency
The Action embeds a hidden <!-- aisbom-action --> marker in the comment body. On every re-run, it finds the existing comment by that marker and updates it in place โ you'll never see stacked AIsbom comments on the same PR. Only the first post triggers a PR notification; subsequent updates are silent (GitHub's API treats edit differently from create).
Privacy
Scans run inside the Action container; the model files themselves never leave the GitHub runner. Three things can be sent over the wire:
- SBOM upload (
--share): the rendered CycloneDX JSON is POSTed toaisbom.io/api/sbom-shareso the comment can link to a hosted viewer. The SBOM is publicly viewable to anyone with the URL and expires after 30 days. The unguessable 12-char URL token is the only access control. - Hosted dashboard upload (opt-in via
token): when you set thetokeninput, the same CycloneDX JSON is POSTed tohttps://app.aisbom.io/v1/scan-result(or yourplatform-urloverride) along with the branch/tag name (GITHUB_REF_NAME), so your dashboard at app.aisbom.io can track the repo's SBOM history. Data is stored in the EU. The upload is logged loudly in your CI output every time it happens. Remove the token (or the input) to stop. Without a token, nothing is sent to the dashboard. - Anonymous telemetry: two events (
github_action_runandgithub_action_comment_posted) are POSTed toapi.aisbom.io/v1/telemetry. No repo identifier, no file paths, no findings content โ just severity buckets and whether the comment was created vs updated.
To disable 1 and 3, set AISBOM_NO_TELEMETRY=1 in your workflow's env: block. The Action still posts the comment and produces the SBOM; the share upload and telemetry pings are skipped. The dashboard upload (2) is controlled solely by whether token is set.
Troubleshooting
Why isn't the Action posting comments on my PRs?
Three known causes, all distinguishable from the Action's own log output:
-
The workflow isn't triggered on
pull_request. Onpush/schedule/workflow_dispatchtriggers there is no PR to comment on โ the SBOM artifact is still produced, but commenting is impossible. The log showsCannot post PR comment โ missing: pr_number โฆ(reported asno_pr_context). Fix: add apull_request:trigger to the workflow. -
The PR comes from a fork. GitHub restricts
${{ github.token }}to read-only onpull_requestevents from forked repositories, regardless of what yourpermissions:block requests. The scan runs and the SBOM is produced; the comment post fails with a permission error in the log. This is a GitHub security policy, not a configuration issue โ there is no safe way around it with the default token. -
The workflow is missing
permissions: pull-requests: write. The log showsCould not post PR comment โฆ Check the workflow has pull-requests: write permission(you may also see GitHub's "Resource not accessible by integration"). Fix: add the Permissions block shown above. The job still succeeds โ the Action never fails your CI over a comment-permission issue.
Re-runs create duplicate comments โ please file an issue. The marker-based idempotency is meant to be unbreakable, but if you're seeing duplicates we want to know.
See also
- aisbom-cli on PyPI โ the same scanner as a standalone CLI.
- AIsbom Advisories โ rolling list of risky models we've found in the wild.