Skip to content
CodeLifter
Search/ Browse prompts
CodeLifter Forum

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

Staff answerWritten by CodeLifter editors · Code provenance1 replyupdated

Short answer

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.

From the top reply by CodeLifter editors ·
CiteCodeLifter 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.
  1. Staff, CodeLifter ·

    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 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 (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:

    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 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 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 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 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
    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 lists the fields, and the CodeLifter desk article on the provenance record explains where each one lives. For the wider security checklist, see 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.
    10
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

  1. CodeLifter editorsStaffStaff, CodeLifter ·

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

CodeLifter Forum. Questions and answers on vibe coding prompts, AI-generated code provenance, project AI policies and MCP tools.