# What is an SBOM, and does a vibe-coded app need one?

Source: https://codelifter.com/forum/posts/what-is-an-sbom-and-does-a-vibe-coded-app-need-one/
Site: CodeLifter Forum, category Code provenance
Published: 2026-11-24. Updated: 2026-11-25. Replies: 1.

## Question by CodeLifter editors (staff), 2026-11-24

An SBOM, or software bill of materials, is a machine-readable list of every component in a piece of software: each package, its version, supplier, licence and what depends on what. A small vibe-coded app is rarely required to publish one, but producing one takes a single command and shows exactly which packages the assistant pulled in.

## What is an SBOM?

The US Cybersecurity and Infrastructure Security Agency describes an [SBOM](https://www.cisa.gov/sbom) as "a nested inventory, a list of ingredients that make up software components." Nested means it records not just the packages you asked for (direct dependencies) but the packages those packages need (transitive dependencies), which is usually most of the list.

The idea comes from manufacturing, where a bill of materials lists every part in a product. CISA's page says the software version has been worked on since 2018 through a multistakeholder process run by the National Telecommunications and Information Administration (NTIA), and that the "Minimum Elements" defined under Executive Order 14028 are published by NTIA.

## What goes in one?

NTIA's [minimum elements report](https://www.ntia.gov/files/ntia/publications/sbom_minimum_elements_report.pdf) (12 July 2021) sets seven baseline data fields. Here they are, with what npm puts in each one for a single dependency, taken from the example in the [npm sbom documentation](https://docs.npmjs.com/cli/v11/commands/npm-sbom):

| NTIA field | What it means | npm example value |
| --- | --- | --- |
| Supplier Name | Who makes the component | `author`: John-David Dalton |
| Component Name | The package name | `lodash` |
| Version of the Component | The exact version | `4.17.21` |
| Other Unique Identifiers | A lookup key, such as a package URL | `pkg:npm/lodash@4.17.21` |
| Dependency Relationship | What depends on what | `simple@1.0.0` depends on `lodash@4.17.21` |
| Author of SBOM Data | The tool or person that wrote the SBOM | `npm` `cli` |
| Timestamp | When it was generated | `2023-09-01T00:00:00.001Z` |

npm also records each package's licence (`MIT` in the example), a SHA-512 hash of the downloaded file, and links to its repository and issue tracker. A package URL, or purl, is a standard string that names a package and its registry, so tools can match it against vulnerability databases.

## SPDX or CycloneDX: which format?

Two formats dominate, and most tools write both.

| Format | Version npm writes | Command | Example output file |
| --- | --- | --- | --- |
| SPDX | SPDX-2.3 | `npm sbom --sbom-format spdx` | `sbom.spdx.json` |
| CycloneDX | 1.5 | `npm sbom --sbom-format cyclonedx` | `sbom.cdx.json` |

Pick the one your customer, platform or scanner asks for. If nobody asks, either works. GitHub's [dependency graph export](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exporting-a-software-bill-of-materials-for-your-repository) writes SPDX.

## Does a vibe-coded app need one?

Legally, it depends on what you sell and to whom, and we are not going to guess for your case. The EU's [Cyber Resilience Act](https://digital-strategy.ec.europa.eu/en/policies/cyber-resilience-act) sets cybersecurity requirements for products with digital elements sold in the EU; the Commission says its main obligations apply from 11 December 2027, with reporting duties from 11 September 2026. If you sell software into the EU, read the legal text or the Commission's guidance for what it asks of you; we have not summarised its documentation duties here.

Practically, an SBOM earns its keep on AI-written projects for three reasons:

1. **You see what was installed.** Assistants add dependencies freely, and sometimes suggest packages that do not exist or were registered by an attacker; the [thread on hallucinated packages](/forum/posts/why-does-ai-generated-code-import-packages-that-do-not-exist/) explains the risk. An SBOM puts every name and version in one file you can read.
2. **You see the licences.** The `licenses` field shows at a glance whether a GPL or unknown licence slipped in. The [commercial use thread](/forum/posts/can-you-use-ai-generated-code-in-a-commercial-product/) explains why that matters before you sell.
3. **You can answer "are we affected?"** When a vulnerability is announced in a package, a stored SBOM for each release tells you which versions shipped it.

## How do you generate one?

For a Node.js project with npm 11:

1. Install dependencies first, or rely on the lockfile. `npm sbom` reads `node_modules`; add `--package-lock-only` to read only `package-lock.json`.
2. Run `npm sbom --sbom-format cyclonedx > sbom.cdx.json` (or `--sbom-format spdx > sbom.spdx.json`).
3. Leave out development tools if you only want what ships: add `--omit dev`.
4. If you publish an app rather than a library, add `--sbom-type application`; the default is `library`.
5. Commit the file with each release tag, or attach it to the release.

![Five steps to generate an SBOM with npm sbom, from installing dependencies to storing it with the release](/forum/img/posts/generate-an-sbom-with-npm-steps.webp "Generating an SBOM with npm in five steps, as set out in this article")

On GitHub you can also open the repository, click **Insights**, then **Dependency graph**, then **Export SBOM**. GitHub's page says the export includes "versions, package identifiers, licenses, transitive paths, and copyright information", and that it lists Actions such as the Anchore SBOM Action and the SPDX Dependency Submission Action for generating one in CI.

## What does an SBOM not show?

It lists packages. It does not show a function pasted from a forum answer, a block an assistant reproduced from a public repository, or which lines were generated at all. Those need a record next to the code; the [provenance record thread](/forum/posts/what-should-a-provenance-record-for-copied-code-include/) lists the fields, and the CodeLifter desk article on the [provenance record](https://codelifter.com/provenance/provenance-record/) explains where each one lives. For the wider security checklist, see [vibe coding security](https://codelifter.com/provenance/vibe-coding-security/).

## Short version

- An SBOM is a machine-readable inventory of every package in your software, including the packages your packages need.
- NTIA's baseline has seven fields: supplier, name, version, unique identifier, dependency relationship, SBOM author and timestamp.
- `npm sbom --sbom-format cyclonedx` or `--sbom-format spdx` makes one in a second; GitHub can export one from the dependency graph.
- Whether the law requires one depends on your market; the practical case for AI-written apps is seeing what was installed and under which licences.

## Reply 1 by CodeLifter editors (staff), 2026-11-25

**What is the difference between an SBOM and a lockfile?** A lockfile is the package manager's private record; an SBOM is a standard document anyone's tools can read. `package-lock.json` exists so npm can reinstall exactly the same tree. Its layout is npm's own, not a cross-language standard. An SBOM in SPDX or CycloneDX uses the same fields whatever the language, so a scanner, a customer or an auditor can read it without knowing your build.

The content differs too. The [npm sbom documentation](https://docs.npmjs.com/cli/v11/commands/npm-sbom) shows the SBOM adding a package URL, the declared licence, a supplier, a description, repository links and a timestamp for the document itself, and it can mark the root as a `library`, `application` or `framework` with `--sbom-type`. The page also shows the relationship: with `--package-lock-only`, "only the information in the package lock (or shrinkwrap) is loaded", so details that come from each dependency's own `package.json`, such as description and homepage, drop out. Keep both. The lockfile makes builds repeatable; the SBOM describes what you built to people and tools outside your project.

---
Cite as: CodeLifter Forum, "What is an SBOM, and does a vibe-coded app need one?", https://codelifter.com/forum/posts/what-is-an-sbom-and-does-a-vibe-coded-app-need-one/, accessed 2026-11-25.
