Skip to content

Configure .witnyx.yml

witnyx check reads a software bill of materials (SBOM) and checks it. .witnyx.yml holds the settings of that check for one repository: when the build fails, the product name and version in the report, where your security.txt is published, and the vulnerabilities assessed as not affecting your product. The file is optional. Without it, the check fails the build only on actively exploited vulnerabilities.

On this page you create the file with witnyx init, set the common fields, and check which file a run reads.

In the root folder of your repository, run witnyx init:

Terminal window
$ witnyx init
created .witnyx.yml
created SECURITY.md
created .github/workflows/release-security-check.yml
next: Add a security contact (email address or URL) to SECURITY.md

init creates three files:

  • .witnyx.yml, the settings file. It sets version and failOn, and explains every other field in comments.
  • SECURITY.md, a security policy template. It names no contact. Add an email address or a web address where people can report a vulnerability privately; until you do, the check reports that the policy has no contact.
  • .github/workflows/release-security-check.yml, a GitHub workflow that runs the check on every push and pull request with the Witnyx GitHub Action.

init never changes a file that exists. A path that already exists, in any form, is kept, and init never writes through a symbolic link. Run it again and it creates only the files that are missing; each file it keeps gets a line that starts with kept and says why. The exit code is 0 either way.

To create the files in another folder, pass --repo-dir. When an AI coding agent runs init, it prints its plan as JSON and writes nothing until it runs again with --write. Use from an AI agent shows that plan.

A .witnyx.yml with the fields most projects set:

.witnyx.yml
version: 1
# Fail the build on actively exploited vulnerabilities and on components past end of life.
failOn: [exploited, eol]
# The product name and version in the report. Without them, the report uses the SBOM's.
product:
name: my-app
version: 2.4.1
# Where security.txt is published, when it is not .well-known/security.txt in this repository.
securityTxtUrl: https://example.com/.well-known/security.txt
Field What it sets The flag that wins over it
version Required. Always 1. None
failOn When the build fails, as a list of rules. Without it, the build fails only on actively exploited vulnerabilities. Choose when the build fails lists the rules. --fail-on
product.name, product.version The product name and version in the report, instead of the SBOM’s. --product-name, --product-version
securityTxtUrl Fetch security.txt from this address instead of reading .well-known/security.txt in the repository. It must be an absolute https URL; plain http is accepted only for localhost, 127.0.0.1 or [::1]. --security-txt-url
notAffected Vulnerabilities assessed as not affecting the product. Mark a finding “not affected” explains the entries. None

A few rules hold for the whole file:

  • Write failOn as a YAML list, failOn: [exploited, eol], or as one value without brackets, failOn: eol. A comma-separated value is the form of --fail-on on the command line; in the file it is read as one unknown rule.
  • An unknown field stops the check. Field names are case-sensitive, so failon is an error rather than a field that is quietly ignored. A misspelt approvedBy can never drop an approval.
  • The file comes from the repository, so Witnyx fetches its securityTxtUrl only from a public address. A URL that points to a private or local address is not fetched, and the report says so. With --offline it is never fetched.

The configuration file reference describes every field.

  • witnyx check reads .witnyx.yml at the root of --repo-dir, which is the current folder by default. It does not look in parent folders or in subfolders.
  • When there is no file, the check runs with the defaults. That is not an error.
  • The file must be a regular file inside the repository. A symbolic link that stays inside the repository is followed. A link that leads outside the repository, or to a missing file, stops the check: the repository can come from a pull request, and a committed link must not read a file elsewhere on the build machine.
  • --config names another file, and the repository’s .witnyx.yml is then not read at all. That path is yours, so a symbolic link in it is followed. A file that does not exist stops the check:
Terminal window
$ witnyx check bom.json --config ci.yml
error WX-CONFIG: Config file not found: ci.yml.
hint: Check the path given to --config.

The check_sbom tool of the MCP server reads .witnyx.yml in the folder it checks, and it has no --config. See Connect the MCP server.

See also: Your first check and GitHub Actions.

Every problem with the file stops the check with the error code WX-CONFIG and exit code 2. The message names the file, and the line or the field.

The message says What to do
version: 1 is required Add version: 1 at the top. A file that holds only comments has no version.
unknown field Correct the field name. The names are version, failOn, product, securityTxtUrl and notAffected, in that letter case.
Unknown value Use one of the rules that Choose when the build fails lists.
must be a regular file inside the repository Commit .witnyx.yml as a regular file, or name a file with --config.
is larger than 256 KiB Check that the path points to the settings file. A .witnyx.yml is a few lines long.

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