Skip to content

witnyx check

witnyx check reads a software bill of materials (SBOM) and runs the release security check on it: actively exploited vulnerabilities, other known vulnerabilities, components past their end of life, SBOM quality, and whether the product says how to report a vulnerability. It prints the report and exits with 0, 1 or 2.

Run it on every build that ships: in CI on each push and pull request, and before a release. Exit code 1 means that a --fail-on rule triggered and the build should stop; it is a result, not a tool failure. Exit codes has the details.

  • A path. witnyx check build/bom.json checks that file. CycloneDX 1.4 to 1.6 (JSON or XML) and SPDX 2.2 or 2.3 JSON are read.
  • Standard input. - reads the SBOM from standard input, which must arrive within the --timeout budget.
  • No path. check looks in --repo-dir (the current folder by default) for bom.json, bom.xml, *.cdx.json, *.cdx.xml, *.spdx.json, target/bom.json and build/reports/bom.json, in that order, and names on standard error the file it uses. Symbolic links are never used. Two files that match the same pattern stop the check with WX-SBOM-AMBIGUOUS; no match stops it with WX-SBOM-NOT-FOUND.
Terminal window
$ witnyx check
witnyx: no SBOM given, using bom.json

check also reads .witnyx.yml at the root of --repo-dir, or the file that --config names: see Configuration file. An option on the command line wins over the same setting in the file.

This SBOM lists a component with an actively exploited vulnerability. The default rule fails the build on it, so the exit code is 1:

Terminal window
$ witnyx check bom.json
Witnyx release security check — my-app 2.4.1
[FAIL] 1 actively exploited vulnerability — build failed
CVE-2021-44228 org.apache.logging.log4j:log4j-core 2.14.1 -> upgrade to 2.15.0 (on CISA's exploited list since 2021-12-10; used in ransomware; also listed by ENISA as EUVD-2021-34768)
SBOM quality
EU legal minimum: pass
Completeness: 21% against [email protected] (9 of 42 required values filled)
SBOM creator: missing · Timestamp: present
Biggest gaps: Component creator (0 of 4) · Filename (0 of 4) · Dependencies (0 of 4)
Note: 2 components have licences without acknowledgement; BSI TR-03183-2 counts only licences marked "concluded" (distribution licences) or "declared" (original licences).
Our reading of the EU Cyber Resilience Act; not legal advice.
Disclosure: SECURITY.md missing · security.txt missing
[WARN] SECURITY.md missing -> add one with a security contact (email address or URL)
[WARN] security.txt missing -> publish .well-known/security.txt with Contact and Expires (RFC 9116)
An actively exploited vulnerability is in a component you ship. If it affects your product and the product is sold in the EU, reporting under the EU Cyber Resilience Act (Article 14) may apply. This check recorded when you were made aware. This is not legal advice.
Checked 2026-11-14T09:12:03Z · 3 components (1 not checked: no package ID or version)
Continuous monitoring and 24-hour reporting alerts → witnyx.dev

--fail-on chooses what fails the build. Here a component past its end of life fails it:

Terminal window
$ witnyx check bom.json --fail-on eol
Witnyx release security check — legacy-app 1.0.0
[FAIL] Build failed: --fail-on eol
[FAIL] 1 component past end of life
Spring Framework 6.0 reached end of life on 2024-06-30 -> upgrade to 7.0.10 (org.springframework:spring-core 6.0.23)
SBOM quality
EU legal minimum: pass
Completeness: 18% against [email protected] (4 of 22 required values filled)
SBOM creator: missing · Timestamp: missing
Biggest gaps: Component creator (0 of 2) · Filename (0 of 2) · Dependencies (0 of 2)
Our reading of the EU Cyber Resilience Act; not legal advice.
Disclosure: SECURITY.md missing · security.txt missing
[WARN] SECURITY.md missing -> add one with a security contact (email address or URL)
[WARN] security.txt missing -> publish .well-known/security.txt with Contact and Expires (RFC 9116)
Checked 2026-11-14T09:12:03Z · 1 component
Continuous monitoring and 24-hour reporting alerts → witnyx.dev

--output also writes the report to files, in the other formats: here Markdown for a pull-request comment and SARIF for code scanning. Standard output still gets the text report:

Terminal window
witnyx check bom.json --output markdown=witnyx.md --output sarif=witnyx.sarif

In agent mode, standard output carries exactly one JSON document, the report or the error document, and standard error carries short progress lines. --agent turns agent mode on; it is also on by default when the environment shows an AI coding agent, and --no-agent turns it off.

See also: Your first check, Choose when the build fails, Use from an AI agent, and Complete and incomplete checks.

Usage

witnyx check [-hV] [--[no-]agent] [--no-color] [--offline] [--strict] [--cache-dir=DIR] [--config=FILE] [--fail-on=RULES] [--format=FORMAT] [--product-name=NAME] [--product-version=VERSION] [--repo-dir=DIR] [--security-txt-url=URL] [--timeout=SECONDS] [--output=FORMAT=PATH]... [SBOM]

Arguments

Argument Required Default Description
SBOM no Path to a CycloneDX (JSON or XML) or SPDX 2.2/2.3 JSON SBOM, or - to read it from standard input, which must arrive within the --timeout budget. Without it, the first match in --repo-dir of bom.json, bom.xml, *.cdx.json, *.cdx.xml, *.spdx.json, target/bom.json and build/reports/bom.json is checked.

Options

Option Value Default Description
--fail-on RULES When to fail the build, comma-separated: exploited, critical, high, eol, quality:<min %> or none (default: failOn in .witnyx.yml, else exploited).
--repo-dir DIR . The repository root (default: the current directory).
--config FILE Config file (default: .witnyx.yml in --repo-dir, when it exists).
--security-txt-url URL Fetch security.txt from this https URL instead of reading .well-known/security.txt in --repo-dir (default: securityTxtUrl in .witnyx.yml).
--output FORMAT=PATH (repeatable) Also write the report to a file. FORMAT is text, markdown, sarif or json, for example --output sarif=witnyx.sarif. Repeatable; a format may name several files. When the check cannot run, json files get the error document instead.
--product-name NAME Product name for the report (default: product.name in .witnyx.yml, else the SBOM’s).
--product-version VERSION Product version for the report (default: product.version in .witnyx.yml, else the SBOM’s).
--no-color Plain ASCII text without colours on the terminal (also when NO_COLOR is set).
--agent, --no-agent Agent mode: exactly one JSON document on standard output (the report, or the error document when the check cannot run) and short progress lines on standard error. On by default when the environment shows an AI coding agent; --no-agent turns it off.
--strict Exit with code 2 when the check is incomplete, unless a --fail-on rule triggered (exit code 1). The normal report is still written, with exitCode 2, not the error document. Offline runs are always incomplete, because OSV has no offline copy, so --offline --strict never exits 0.
--offline Use cached data only; the live vulnerability lookup and the security.txt URL are skipped.
--timeout SECONDS 120 Time budget in seconds (default: 120).
--cache-dir DIR Cache directory for public data (default: the platform’s cache folder).
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
--format FORMAT With --help: text (the default) or json, a machine-readable reference.

Exit codes

Code Meaning
0 Ran; the failure rule did not trigger. The report says when the check was incomplete.
1 Ran; the failure rule triggered. This is a result, not a tool failure.
2 Could not run, or the check was incomplete and --strict was set.

Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.