# Read an AI-BOM

> What is in Keryn's CycloneDX 1.6 AI bill of materials, how to print it on each surface, and how to check any line of it.

Source: https://keryn.dev/docs/guides/ai-bom/

## Goal

Know which AI technologies your code references, where, and how sure Keryn is about each one, in a file that Dependency-Track, GitLab's dependency list and any other SBOM tool can read. The AI-BOM is plain CycloneDX 1.6.

The AI-BOM lists AI components only. For every package your lockfiles lock, with licences and the dependency graph, write the dependency SBOM instead: `keryn sbom` (CycloneDX 1.6 or SPDX 2.3, next release; see [software composition analysis](https://keryn.dev/docs/guides/sca/#sboms-cyclonedx-and-spdx)).

## Before you start

- A repository to look at. Any language works for the inventory; the AI-BOM comes from the inventory rules, not from a full scan.
- On the CLI, `jq` makes the file easy to read. Nothing here needs a network.

## 1. Get the AI-BOM

**CLI**

`keryn bom .` prints the AI-BOM on standard output (a one-screen summary goes to standard error, which the examples below drop with `2>/dev/null`), and `keryn scan . --aibom keryn-out/bom.cdx.json` writes it next to the findings. List the components:

```sh
keryn bom . 2>/dev/null | jq -r '.components[] | "\(.type)\t\(.name)"'
```

```text
library	anthropic
library	openai
machine-learning-model	claude-sonnet-4-5
machine-learning-model	gpt-4o
```

**Web**

In [Keryn Web](https://keryn.dev/docs/guides/web-app/), scan a folder or repository and open the **AI-BOM** tab: the key assets (models, services and prompt files) first, then SDKs, each with the findings in the files that use it. **Export, CycloneDX 1.6 AI-BOM** downloads the file. Nothing is uploaded: the file is generated in the tab.

**VS Code**

In Keryn for VS Code, the **Keryn AI-BOM** view in the Explorer lists the components, and the command **Show AI-BOM** opens them. **Keryn change** shows the components a change adds against a base; see [editors](https://keryn.dev/docs/guides/editors/).

Each component is something AI-related that the code references: a provider SDK (`openai`, `anthropic`), a model id, an agent framework, an MCP server or client, a vector store, a prompt file, a tool definition.

## 2. Check one component

Every component carries the places Keryn found it, so a reviewer can open the file and look:

```sh
keryn bom . 2>/dev/null | jq -c '.components[0] | {name, found: .evidence.occurrences, properties: [.properties[] | select(.name != "keryn:assetProvenance") | "\(.name)=\(.value)"]}'
```

```text
{"name":"anthropic","found":[{"location":"support.py","line":1}],"properties":["keryn:category=llm-sdk","keryn:basis=observed-in-source","keryn:scope=direct","keryn:rules=keryn.inv.lib.anthropic","keryn:provider=anthropic"]}
```

- `evidence.occurrences`: every file and line, so nothing in the BOM is a claim without a place.
- `keryn:basis`: how it was observed. `observed-in-source` is a reference in code; it is `observed-in-browser` or `observed-on-network` when you fed Keryn a [page snapshot or a list of ports](https://keryn.dev/docs/guides/browser/), and a lockfile-only or docs-only mention is labelled as such.
- `keryn:rules`: the inventory rule that recognised it, which you can look up with [`keryn explain`](https://keryn.dev/docs/guides/explain-and-docs/).

## 3. Read the caveat and the coverage

```sh
keryn bom . 2>/dev/null | jq -r '.metadata.properties[] | select(.name != "keryn:coverage.rules") | "\(.name): \(.value)"'
```

```text
keryn:coverage.files: 3 scanned, 0 skipped
keryn:caveat: Inventory reflects static references only. Absence is not evidence of absence; presence does not prove runtime use.
```

A third property, `keryn:coverage.rules`, says how many rules ran (for the AI-BOM, the inventory pack).

> **Note: The caveat on every BOM**
> Inventory reflects static references only. Absence is not evidence of absence; presence does not prove runtime use.

A real file is on the [formats page](https://keryn.dev/docs/reference/formats/).

## 4. Track what a change adds

Compare two AI-BOMs, or a BOM with a branch, to see the components a change brings in: that is the whole of [baselines and deltas](https://keryn.dev/docs/guides/baselines/).

## What you just proved

Each line of an AI-BOM is an edge from your code to something it **depends on or calls**: a provider, a model, a store. You can name the place in the code for each one, and you know the basis it rests on. That is a different claim from "this application uses these services at run time". The BOM says what the code references. It cannot see what is configured elsewhere, and it does not claim to.

## Next

- Decide which providers are allowed: [policies](https://keryn.dev/docs/guides/policies/).
- See a change's new components: [baselines and deltas](https://keryn.dev/docs/guides/baselines/).
- Hand the BOM to an auditor with the rest of the evidence: [evidence for auditors](https://keryn.dev/docs/guides/auditors/).
