@shieldaai/security-watch 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/CONTRIBUTING.md +92 -0
  3. package/LICENSE +202 -0
  4. package/README.md +394 -2
  5. package/SECURITY.md +62 -0
  6. package/dist/assessment.d.ts +16 -0
  7. package/dist/assessment.js +569 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +1105 -0
  10. package/dist/config.d.ts +302 -0
  11. package/dist/config.js +381 -0
  12. package/dist/coverage.d.ts +4 -0
  13. package/dist/coverage.js +11 -0
  14. package/dist/cve-now.d.ts +35 -0
  15. package/dist/cve-now.js +1002 -0
  16. package/dist/cvss4.d.ts +3 -0
  17. package/dist/cvss4.js +39 -0
  18. package/dist/delivery.d.ts +58 -0
  19. package/dist/delivery.js +687 -0
  20. package/dist/ecosystems.d.ts +48 -0
  21. package/dist/ecosystems.js +332 -0
  22. package/dist/engine.d.ts +80 -0
  23. package/dist/engine.js +388 -0
  24. package/dist/everyday-words.d.ts +11 -0
  25. package/dist/everyday-words.js +256 -0
  26. package/dist/health.d.ts +24 -0
  27. package/dist/health.js +122 -0
  28. package/dist/heartbeat.d.ts +13 -0
  29. package/dist/heartbeat.js +74 -0
  30. package/dist/http.d.ts +15 -0
  31. package/dist/http.js +280 -0
  32. package/dist/index.d.ts +36 -0
  33. package/dist/index.js +23 -0
  34. package/dist/inventory-evidence.d.ts +10 -0
  35. package/dist/inventory-evidence.js +206 -0
  36. package/dist/inventory.d.ts +276 -0
  37. package/dist/inventory.js +336 -0
  38. package/dist/lock.d.ts +3 -0
  39. package/dist/lock.js +112 -0
  40. package/dist/maintenance.d.ts +48 -0
  41. package/dist/maintenance.js +295 -0
  42. package/dist/matching.d.ts +29 -0
  43. package/dist/matching.js +537 -0
  44. package/dist/models.d.ts +33 -0
  45. package/dist/models.js +932 -0
  46. package/dist/operations.d.ts +17 -0
  47. package/dist/operations.js +117 -0
  48. package/dist/pilot-cases.d.ts +171 -0
  49. package/dist/pilot-cases.js +330 -0
  50. package/dist/pilot-input.d.ts +16 -0
  51. package/dist/pilot-input.js +125 -0
  52. package/dist/pilot-recall.d.ts +166 -0
  53. package/dist/pilot-recall.js +231 -0
  54. package/dist/pilot-report.d.ts +113 -0
  55. package/dist/pilot-report.js +279 -0
  56. package/dist/pilot-responses.d.ts +111 -0
  57. package/dist/pilot-responses.js +159 -0
  58. package/dist/providers.d.ts +209 -0
  59. package/dist/providers.js +459 -0
  60. package/dist/python-version.d.ts +3 -0
  61. package/dist/python-version.js +30 -0
  62. package/dist/rehearsal.d.ts +440 -0
  63. package/dist/rehearsal.js +372 -0
  64. package/dist/sbom.d.ts +13 -0
  65. package/dist/sbom.js +193 -0
  66. package/dist/setup.d.ts +113 -0
  67. package/dist/setup.js +100 -0
  68. package/dist/source-error.d.ts +38 -0
  69. package/dist/source-error.js +71 -0
  70. package/dist/sources.d.ts +3 -0
  71. package/dist/sources.js +1725 -0
  72. package/dist/store.d.ts +96 -0
  73. package/dist/store.js +953 -0
  74. package/dist/types.d.ts +404 -0
  75. package/dist/types.js +1 -0
  76. package/dist/util.d.ts +29 -0
  77. package/dist/util.js +94 -0
  78. package/dist/vendor/cvss4-reference.d.ts +2 -0
  79. package/dist/vendor/cvss4-reference.js +789 -0
  80. package/dist/vendor-sources.d.ts +24 -0
  81. package/dist/vendor-sources.js +56 -0
  82. package/dist/word-filter.d.ts +3 -0
  83. package/dist/word-filter.js +3291 -0
  84. package/docs/alert-outcome-evaluation.md +150 -0
  85. package/docs/compatibility.md +35 -0
  86. package/docs/configuration.md +666 -0
  87. package/docs/cvss-v4-support.md +41 -0
  88. package/docs/offline-advisory-preview.md +114 -0
  89. package/docs/offline-rehearsal.md +44 -0
  90. package/docs/pilot-cases.md +58 -0
  91. package/docs/pilot-recall.md +124 -0
  92. package/docs/pilot-report.md +52 -0
  93. package/docs/validation/alert-outcome-evaluation-2026-11-05.json +2935 -0
  94. package/docs/validation/cvss-v4-reference-parity-2026-11-05.json +93 -0
  95. package/docs/validation/rehearsal-accepted-2026-11-05.json +175 -0
  96. package/docs/validation/rehearsal-unknown-2026-11-05.json +175 -0
  97. package/docs/vendor/cvss-v4-LICENSE.txt +22 -0
  98. package/docs/vendor/cvss-v4-provenance.json +38 -0
  99. package/examples/advisories.json +17 -0
  100. package/examples/agent-advisories-2026.json +145 -0
  101. package/examples/agent-advisory-cases-2026.json +397 -0
  102. package/examples/common-systems.yaml +243 -0
  103. package/examples/libraries.example.txt +18 -0
  104. package/examples/libraries.example.yaml +40 -0
  105. package/examples/library-watch.example.yaml +27 -0
  106. package/examples/offline-advisory-preview.mjs +42 -0
  107. package/examples/rehearsal.json +75 -0
  108. package/examples/security-watch.example.yaml +86 -0
  109. package/examples/systems.example.yaml +35 -0
  110. package/package.json +85 -4
package/README.md CHANGED
@@ -1,3 +1,395 @@
1
- # Temporary Holding Version
1
+ # Shielda Security Watch
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Security Watch tells you, within minutes, when a newly reported security problem concerns software you run, and tells you **where to look**. You give it a list of your systems and the libraries they use. It keeps watching public security advisories and security news, compares them with your list, and sends a message to Slack or email when something needs attention.
4
+
5
+ It runs on your own server or laptop. Your list of systems stays with you.
6
+
7
+ ## The problem
8
+
9
+ There is far more security news than anyone can read, and most of it has nothing to do with you. Waiting for a CVE to be published, or checking once a day, is too late: you need to know quickly what affects _your_ stack. Security Watch does that reading for you. You choose how often it runs and how far back it looks, you set your own risk appetite (which findings alert at once and which wait for a digest), and you add context about your systems. It then sends Slack or email alerts with the evidence and a pointer to the affected system, so you can act right away.
10
+
11
+ ## Why a daily check is not enough
12
+
13
+ - **Problems are used by attackers within hours.** A check that runs once a day, or once a week in a build pipeline, leaves most of that day uncovered. In the starter setup Security Watch checks every 30 minutes, and it catches up by itself after downtime.
14
+ - **The CVE entry often arrives late.** A vulnerability is usually discussed in vendor announcements and security news before a complete CVE record with affected versions exists. If you wait for the CVE, you start late. Security Watch reads the news as well as the advisory databases, and raises a "possibly affected, please check" finding as soon as a story names something on your list.
15
+ - **A list that was correct last month is not enough.** A library you already use can become vulnerable tomorrow without any change on your side. The check has to run continuously against the versions you run today, so keep your list current; in the starter setup Security Watch warns when the list has not been updated for a week.
16
+ - **Knowing the library is not knowing the place.** "lodash is vulnerable" does not tell anyone which service, repository or team has to act. Every system and library on your list can carry a short note, and the alert repeats that note.
17
+
18
+ ## What an alert looks like
19
+
20
+ This is the message produced by the example list in step 3 below and a fictional advisory:
21
+
22
+ ```text
23
+ [CRITICAL] express request smuggling (fictional test record)
24
+ Finding: 8aa3f6df3875112d087d95f4ae8b23cd32a81fd24b7fdf01fb1a92720be41bf7
25
+ Delivery: f464faf4-d0e6-4c0f-9ff3-ff008fb808da
26
+ System: web-shop / library:ee5130742729fbc72bd45978
27
+ Where to look: Web shop (owner: Dana, platform team) - runs on cluster eu-1, namespace shop
28
+ Affected item: npm express 4.21.2 - checkout API, repository acme/checkout, file package.json
29
+ Applicability: affected; source severity: critical; priority: critical
30
+ Summary: express@4.21.2 in Web shop: affected.
31
+ • The exact npm identity express and installed version 4.21.2 match affected advisory evidence.
32
+ Fix: 4.22.0
33
+ Rule: Matched library rule at critical severity; source severity remains the minimum.
34
+ Assessment time: 2026-11-13T18:10:42.212Z
35
+ https://example.com/advisory
36
+ ```
37
+
38
+ The `Where to look` and `Affected item` lines come from your own list: the system's name, owner and note, and the note you wrote beside the library. Whoever receives the alert can go straight to the right place and confirm it. The `Finding` value is what you pass to commands such as `security-watch explain`.
39
+
40
+ ## Get started in five steps
41
+
42
+ You need a computer that stays on (a small server is enough) and [Node.js](https://nodejs.org/) version 24.10 or newer. In a terminal:
43
+
44
+ 1. **Install it.**
45
+
46
+ ```sh
47
+ npm install --global @shieldaai/security-watch
48
+ ```
49
+
50
+ 2. **Create a starter folder.** This writes a configuration file, an example list of systems and a template for secrets. Nothing is sent anywhere yet.
51
+
52
+ ```sh
53
+ security-watch init --directory ./watch --yes --notifications slack
54
+ ```
55
+
56
+ 3. **Describe what you run.** Open `watch/systems.yaml` in a text editor and replace the example with your own systems, libraries and notes:
57
+
58
+ ```yaml
59
+ systems:
60
+ - id: web-shop
61
+ name: Web shop
62
+ owner: Dana, platform team
63
+ note: runs on cluster eu-1, namespace shop
64
+ updated_at: '2026-11-13T09:00:00Z' # when you last checked this list; older than 7 days counts as stale
65
+ libraries:
66
+ - 'npm:express@4.21.2 # checkout API, repository acme/checkout, file package.json'
67
+ - 'python:requests==2.32.3 # billing worker, services/billing/requirements.txt'
68
+ products:
69
+ - name: PostgreSQL
70
+ version: '16.4'
71
+ note: managed database "shop-prod", owned by the data team
72
+ ```
73
+
74
+ Everything after `#` on a library line is the note for that library. Keep the quotes around each library line: without them the note is ignored. Notes are optional, but they are what makes an alert easy to act on.
75
+
76
+ If your list contains libraries that are not npm packages (Python, PHP, Java, Go and so on), also open `watch/security-watch.yaml` and change `osv: false` to `osv: true`. That turns on the advisory database that covers those ecosystems; it receives the library names and versions you list.
77
+
78
+ 4. **Add the Slack address.** Copy the secrets template, keep it private, then open `watch/.env` and paste your Slack incoming-webhook address after `SLACK_WEBHOOK_URL=`:
79
+
80
+ ```sh
81
+ cp ./watch/.env.example ./watch/.env
82
+ chmod 600 ./watch/.env
83
+ ```
84
+
85
+ 5. **Check, then start.** The first command verifies your files, the second shows what a scan finds without sending anything, the third keeps watching. The first scan reads the last day of advisories at roughly one request a second, so expect it to take 15 to 20 minutes; later scans usually take a minute or two. You can skip the second command and go straight to the third.
86
+
87
+ ```sh
88
+ security-watch doctor --config ./watch/security-watch.yaml --credentials-file ./watch/.env
89
+ security-watch scan --config ./watch/security-watch.yaml --credentials-file ./watch/.env --dry-run
90
+ security-watch start --config ./watch/security-watch.yaml --credentials-file ./watch/.env
91
+ ```
92
+
93
+ **What gets sent.** With the starter settings you get an immediate message for a critical finding in a library, anything reported as actively exploited, a malicious package, and a possibly critical finding that still needs checking (a critical product or news finding is one of these until it is confirmed). High findings for a product or in the news usually arrive in the daily digest: a product match cannot be confirmed from version ranges, and news is sent at once only when a configured model confirms that it affects you. Less urgent findings that need a look arrive together in one daily digest. Everything else is recorded and shown by `security-watch findings`. The `policy` section of the configuration file changes these thresholds.
94
+
95
+ To try it with no network access and fictional data first, follow the [offline advisory preview](docs/offline-advisory-preview.md). The rest of this page covers the options in detail.
96
+
97
+ **Version 1.0.0.** This is `@shieldaai/security-watch` 1.0.0, the first stable release, published under the default `latest` tag. It has no independent security audit. Read the [coverage and security limits](SECURITY.md) before relying on it, the [compatibility policy](docs/compatibility.md) for what stays stable, and the [changelog](CHANGELOG.md) for what changed since the alpha.
98
+
99
+ Related projects: [Agent Guard](https://github.com/ShieldaAI/agent-guard) for tool permissions and approvals, and [SafeCall Node](https://github.com/GuardianMesh/llm-safecall-node) or [SafeCall Python](https://github.com/GuardianMesh/llm-safecall) for model response validation. The [package selection guide](https://github.com/ShieldaAI/agent-guard/blob/main/docs/package-guide.md) explains how they fit together.
100
+
101
+ ## Features
102
+
103
+ - YAML/JSON inventories, library lists across 12 ecosystems, and npm package-lock v2/v3 imports. Names alone are accepted; exact installed versions improve applicability checks.
104
+ - cve.now CVE updates and npm stack checks, plus The Hacker News security articles. Optional sources include OSV, GitHub, CISA KEV, official Node.js/Python/PHP feeds and other RSS/Atom feeds.
105
+ - Structured library checks without AI, with optional AI analysis to distinguish new vulnerabilities, updates to known vulnerabilities and general system news. Each finding records source severity, applicability and contextual priority separately.
106
+ - Separate alert thresholds for libraries, products and news, plus review digests and configurable overrides for potentially critical findings, known exploitation and malware.
107
+ - Slack incoming webhooks and SMTP email, backed by a SQLite delivery queue. An email is retried automatically only when it provably never left. A Slack message is retried when Slack answers HTTP 429 or 5xx or the connection fails before the request is sent; in rare cases Slack may have posted a message it answered 5xx for. Any other uncertain delivery is recorded for manual review and retry.
108
+ - Per-source coverage receipts, bounded CycloneDX import with package URLs and dependency relationships, and inventory drift reports. Optional artifact kinds cover MCP servers/clients, plugins, skills and models; signature, attestation and remediation lifecycle fields record operator-supplied evidence. They do not perform verification or close findings. See [deployment evidence](docs/configuration.md#agent-deployment-evidence-sboms-and-drift).
109
+ - Finding history, revision-bound AI dismissal review, acknowledgement, suppression with an expiry, source checkpoints and model budgets. Optional external heartbeats, bounded retention and verified backups support ongoing operation.
110
+
111
+ | Inventory item | Coverage |
112
+ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
113
+ | npm package with an exact version | Match supported affected ranges or verified OSV query results; preserve uncertainty and conflicting sources |
114
+ | PyPI package with a final release | Match the documented PEP 440 final-release subset; other forms remain unknown |
115
+ | Library in another supported ecosystem | Exact positive OSV query or explicitly listed affected version; unsupported version ranges remain unknown |
116
+ | Library without an installed version | Discover advisory candidates by package identity; applicability remains unknown |
117
+ | npm package-lock v2/v3 | Import resolved transitive, development and optional dependency metadata; no installation or lifecycle scripts |
118
+ | Product, OS, database or SaaS name | Whole-name/keyword candidates plus AI news/impact assessment; **no general product-version, vendor-backport or SaaS configuration adapter** |
119
+ | Unknown or stale version | Review required; never infer safety from missing evidence |
120
+
121
+ `affected` means the declared package and installed version match supported advisory evidence. npm and the documented PyPI final-release subset support version-range exclusion; other ecosystems use exact positive OSV query results or explicitly listed affected versions. A missing version or empty search establishes neither affectedness nor safety. Lockfiles describe dependencies; you still need to verify what is deployed and reachable.
122
+
123
+ ## Install and preview
124
+
125
+ Use Node.js **24.10.0 or newer**. Install it:
126
+
127
+ ```sh
128
+ npm install --global @shieldaai/security-watch
129
+ ```
130
+
131
+ To build and install from a source checkout:
132
+
133
+ ```sh
134
+ npm ci
135
+ npm run check
136
+ npm pack
137
+ npm install --global ./shieldaai-security-watch-1.0.0.tgz
138
+ ```
139
+
140
+ Choose one setup command below. For a fictional example with AI disabled:
141
+
142
+ ```sh
143
+ security-watch init --directory ./watch --yes
144
+ ```
145
+
146
+ `init --yes` creates a private configuration, an example inventory and `.env.example`. It checks cve.now and The Hacker News every 30 minutes, with a 40-minute news window. AI and notification routes start disabled. Interactive `init` also asks for a provider, model, timing and notification channels. Existing files are never replaced.
147
+
148
+ Or start with Node.js, Python and OpenAI analysis:
149
+
150
+ ```sh
151
+ security-watch templates
152
+ security-watch init --directory ./watch --yes --systems nodejs,python \
153
+ --provider openai --model gpt-6-luna --poll-minutes 30 --lookback-minutes 40
154
+ ```
155
+
156
+ After either setup command, create the private environment file:
157
+
158
+ ```sh
159
+ cp ./watch/.env.example ./watch/.env
160
+ chmod 600 ./watch/.env
161
+ ```
162
+
163
+ If you enabled OpenAI, edit `watch/.env` to set `OPENAI_API_KEY`. Use an exact model ID available to your account; `security-watch providers` lists the supported providers and their credential names. Omit `--provider` and `--model` to start without AI. Local services also need `--endpoint` and `--allow-private-endpoint`.
164
+
165
+ To configure notifications during setup, add `--notifications slack` to `init`, or use `--notifications email --email-from alerts@example.com --email-to security@example.com`. `--notifications slack,email` configures both. Fill in `SLACK_WEBHOOK_URL` or `SMTP_URL` in the private credentials file. `doctor` lists the active routes and warns when notifications are disabled.
166
+
167
+ Replace the example inventory in `watch/systems.yaml`, then edit `watch/security-watch.yaml`. For system news analysis, enable `models`, set your exact analysis model ID and provide its credential through the named environment variable. Configure notification routes separately. Without AI, matching system names remain candidates requiring review; a mention alone does not prove impact. See the [configuration guide](docs/configuration.md).
168
+
169
+ [Common systems](examples/common-systems.yaml) provides a sample list of 24 runtimes, operating systems, databases and infrastructure products, including Node.js and Python. It leaves installed versions unspecified. Add your versions and deployment context before using it to assess impact; broad language names also match applications and incidental mentions.
170
+
171
+ ```sh
172
+ security-watch doctor --config ./watch/security-watch.yaml --credentials-file ./watch/.env
173
+ security-watch scan --config ./watch/security-watch.yaml --credentials-file ./watch/.env --dry-run
174
+ security-watch start --config ./watch/security-watch.yaml --credentials-file ./watch/.env
175
+ ```
176
+
177
+ `start` activates configured routes and stays in the foreground. Run it under your service manager or Docker for continuous operation.
178
+
179
+ Verify a destination with `security-watch test-notification --channel slack --config ./watch/security-watch.yaml --credentials-file ./watch/.env`; use `--channel email` for SMTP. Each invocation sends one explicit test, reports acceptance or a safe failure reason, and leaves the monitor database unchanged.
180
+
181
+ To scan every 30 minutes and discover news from the last 40 minutes, set:
182
+
183
+ ```yaml
184
+ poll_interval_minutes: 30
185
+ news_lookback_minutes: 40
186
+ ```
187
+
188
+ Overlapping scans deduplicate findings. After downtime, the worker catches up from the last successful source checkpoint (for cve.now, up to about three months of records; a longer gap is reported); older tracked advisories and exact package matches remain in scope. See [scan schedules and news windows](docs/configuration.md#scan-schedule-and-news-window).
189
+
190
+ `doctor` validates local configuration and required environment variables, and lists inventory entries that were left out or will not match as written. It exits with status 2 whenever it prints `ok: false`. It does not contact providers, validate a model by spending tokens, or send test messages. A dry run writes no application state, disables model calls and sends no notifications; public advisory/feed requests still occur. For an offline demonstration, run:
191
+
192
+ ```sh
193
+ npm run demo
194
+ ```
195
+
196
+ The demo refreshes synthetic inventory timestamps and uses in-memory state, with no network, models or messages. The underlying files are [example configuration](examples/security-watch.example.yaml), [example inventory](examples/systems.example.yaml) and [synthetic evidence](examples/advisories.json). You can also run:
197
+
198
+ ```sh
199
+ security-watch scan --config examples/security-watch.example.yaml --fixture examples/advisories.json --dry-run
200
+ ```
201
+
202
+ Fixture mode makes no source or AI requests and counts the fixture's records as read now; with `--dry-run` it also counts the inventory as current, since it previews matching, not freshness. Do not combine a fixture with `--notify` unless you intend to send its synthetic findings. To test model analysis, run `security-watch scan --config ./watch/security-watch.yaml --credentials-file ./watch/.env` without `--dry-run` or `--notify`. This saves findings and budget reservations and may incur provider charges; it does not deliver notifications. The checkout also includes an opt-in [synthetic provider check](CONTRIBUTING.md#live-provider-checks).
203
+
204
+ Use the packaged [offline rehearsal](docs/offline-rehearsal.md) to exercise policy, outbox receipts and backup/restore in an isolated temporary database. `rehearse --config PATH --input SCENARIO.json --sink accepted --output NEW.json` uses simulated in-process delivery, disables sources/models and exports a sanitized report with per-run opaque references. It never opens the configured live database or loads credentials; `disabled` is the default sink.
205
+
206
+ For an opted-in pilot, `pilot-report --database PATH --from YYYY-MM-DD --until YYYY-MM-DD` reports observed policy workload, review response times and model reservations for complete UTC days. It also counts current queued and ambiguous deliveries using a single read-only database snapshot. Use `--backup PATH` for a standalone backup. [Pilot report guide](docs/pilot-report.md)
207
+
208
+ For independent analyst review, `pilot-cases` builds a private lookup packet from a frozen backup. `pilot-score` compares paired, blinded labels with the retained policy decision for each revision and gives the reviewed denominators. [Review a pilot’s policy decisions](docs/pilot-cases.md)
209
+
210
+ Use `pilot-recall` to measure timely findings, immediate routing decisions and Slack or SMTP acknowledgements against independently enumerated urgent incidents in a frozen backup. The report distinguishes immediate alerts from digest acknowledgements and includes incidents without a matching retained finding. [Measure recall on an incident reference](docs/pilot-recall.md)
211
+
212
+ To measure when an analyst acknowledged or triaged those incidents, use `pilot-response-template` to prepare a private worksheet. A second reviewer fills it from incident records. Score it with `pilot-recall --responses` to see how many met the deadline and how many still lack evidence. [Analyst response workflow](docs/pilot-recall.md)
213
+
214
+ ## Library inventories
215
+
216
+ Runtime requirement: Node **24.10.0 or newer**. PyPI final-release range evaluation uses a conservative PEP 440 subset; unsupported forms remain unknown (see [configuration](docs/configuration.md#python-version-range-coverage)).
217
+
218
+ The supported ecosystems are npm, PyPI, Packagist, Go, Maven, crates.io, RubyGems, NuGet, Hex, Pub, Hackage and SwiftURL. Common language names such as `python`, `php` and `rust` are accepted as aliases. Run `security-watch ecosystems` for the canonical names.
219
+
220
+ Start from a file with one library per line:
221
+
222
+ ```text
223
+ npm:express
224
+ python:requests
225
+ python:urllib3==2.2.3
226
+ php:symfony/http-foundation@6.4.0
227
+ maven:org.apache.logging.log4j:log4j-core
228
+ ```
229
+
230
+ Add a note after `#` to say where a library is used; it appears in every alert about that library:
231
+
232
+ ```text
233
+ npm:express@4.21.2 # checkout API, repository acme/checkout, file package.json
234
+ python:requests==2.32.3 # billing worker, services/billing/requirements.txt
235
+ ```
236
+
237
+ A line that starts with `#` is still an ordinary comment. When the same library is listed twice with different notes, both notes are kept. Systems and products accept a `note:` field in the inventory file. Notes stay on your machine and in your notifications; they are never sent to advisory sources or AI models. See [notes](docs/configuration.md#notes-telling-readers-where-to-look).
238
+
239
+ These are examples, not version recommendations. Use the registry's published package spelling, especially for NuGet. npm names are lower case and case-sensitive: `npm:Lodash` is kept but matches nothing published as `lodash`, and `doctor` lists it under `name_notices`. Omit a version you have not verified; do not substitute `latest`, a version constraint or a guessed release.
240
+
241
+ ```sh
242
+ security-watch normalize-libraries --input ./libraries.txt
243
+ security-watch init --directory ./watch --yes --libraries ./libraries.txt
244
+ ```
245
+
246
+ For a list containing only one ecosystem, use names without prefixes and add `--ecosystem php` or another supported alias. `init --libraries` creates one application inventory and enables OSV. It cannot be combined with `--systems`. Structured library matching needs no AI or model credentials. For a library-only monitor, disable news sources; see the [library configuration](examples/library-watch.example.yaml), [grouped inventory](examples/libraries.example.yaml) and [mixed library list](examples/libraries.example.txt).
247
+
248
+ To include official release/security news, add `--vendor-feeds nodejs,python,php` during setup or set `sources.vendor_feeds` in the configuration. These adapters extract bounded article text from fixed vendor hosts. A release announcement or database publication date alone does not establish a new vulnerability.
249
+
250
+ ## LLM providers
251
+
252
+ There are 22 provider profiles:
253
+
254
+ - OpenAI, Azure OpenAI, Anthropic (Claude), Google Gemini, Cohere, xAI and Perplexity use their provider APIs.
255
+ - Groq, DeepSeek, Mistral, Together AI, Fireworks AI, OpenRouter, Cerebras, NVIDIA, SambaNova and Hugging Face use hosted Chat Completions endpoints.
256
+ - Ollama, LM Studio, vLLM and LiteLLM support configured local servers or gateways. A generic `openai-compatible` profile accepts other Chat Completions endpoints.
257
+
258
+ Run `security-watch providers` to list provider IDs, default endpoints, credential variable names and API documentation without loading a monitor configuration. Specify an exact model ID and choose a supported output format; capabilities vary by model and account. Local/private endpoints require explicit configuration. AWS Bedrock and Vertex AI credentials are not supported directly. See [provider configuration](docs/configuration.md#model-configuration) for defaults and examples.
259
+
260
+ ## Run with Docker
261
+
262
+ Build the image locally:
263
+
264
+ ```sh
265
+ docker build -t shielda-security-watch .
266
+ docker volume create security-watch-data
267
+ docker run --rm --user 0 --entrypoint chown \
268
+ --mount type=volume,src=security-watch-data,dst=/data \
269
+ shielda-security-watch "$(id -u):$(id -g)" /data
270
+ docker run --rm --name security-watch \
271
+ --user "$(id -u):$(id -g)" \
272
+ --read-only --cap-drop ALL --security-opt no-new-privileges \
273
+ --tmpfs /tmp \
274
+ --env-file ./watch/.env \
275
+ --mount type=bind,src="$(pwd)/watch/security-watch.yaml",dst=/config/security-watch.yaml,readonly \
276
+ --mount type=bind,src="$(pwd)/watch/systems.yaml",dst=/config/systems.yaml,readonly \
277
+ --mount type=volume,src=security-watch-data,dst=/data \
278
+ shielda-security-watch start --config /config/security-watch.yaml
279
+ ```
280
+
281
+ Before running, set `inventory: /config/systems.yaml` and `database: /data/watch.db` in the container's configuration. Create `watch/.env` privately with only the credentials you use; it is not loaded automatically by the npm CLI. Keep configuration, inventory and `.env` readable only by your user, for example with `chmod 600` on those files. The short initialization command assigns the data volume to your UID/GID; the application itself then runs as that user. Your Docker VM must be able to access the configuration/inventory bind mounts. Add a read-only mount for any imported lockfile under `/config` and use the matching path in the inventory.
282
+
283
+ SQLite stays on a native Docker volume rather than a desktop VM's shared host filesystem. This avoids depending on host-sharing behavior for database locking and write-ahead logging. Retain `security-watch-data` when recreating the container. The application needs outbound network access and no inbound port.
284
+
285
+ The included Compose file uses root-level `security-watch.yaml`, `systems.yaml` and `.env`:
286
+
287
+ ```sh
288
+ cp examples/security-watch.example.yaml security-watch.yaml
289
+ cp examples/systems.example.yaml systems.yaml
290
+ cp .env.example .env
291
+ chmod 600 security-watch.yaml systems.yaml .env
292
+ export SECURITY_WATCH_UID=$(id -u) SECURITY_WATCH_GID=$(id -g)
293
+ ```
294
+
295
+ Edit the copied inventory, notification routes and credentials, and apply the same `/config/systems.yaml` and `/data/watch.db` settings before running `docker compose up --build -d`. Inspect `docker compose logs --follow`. Compose requires the host UID/GID variables and automatically runs a short volume-ownership initializer before the application starts. Its `watch-data` named volume keeps SQLite on Docker's native filesystem, while the private configuration/inventory remain read-only host mounts. You may persist the UID/GID values in the private `.env` file for later Compose invocations. Add an explicit read-only mount if the inventory imports a lockfile. Retain the named volume when recreating containers; `docker compose down --volumes` removes it.
296
+
297
+ ## How decisions work
298
+
299
+ 1. Collect cve.now responses and The Hacker News articles within configured size and request limits. Preserve source revisions and group advisories that share verified aliases. News mentioning several existing advisories adds context to each finding separately.
300
+ 2. Compare each deployment's library identity and declared version. npm and the PyPI final-release subset support range checks; other ecosystems require exact positive evidence. Generic product matches remain uncertain. Stale inventory cannot support a safe conclusion.
301
+ 3. Ask the configured model to classify matched system news and assess the claimed impact on the declared deployment, using article evidence and version context. General news about a system is distinguished from a new vulnerability or an update to a known one. If configured, a second model reviews every news analysis and any critical, exploited, uncertain or conflicting finding. Disagreements remain visible.
302
+ 4. Apply the category's notification policy. AI cannot reduce priority below the source severity or suppress a critical library/product finding. News with an advisory identifier and an exact installed package mention uses library policy even before structured advisory data arrives.
303
+ 5. Commit finding changes and notification jobs together. Deliver meaningful changes without treating cosmetic article wording or AI phrasing as new events.
304
+
305
+ With the default rules, libraries select critical severity and products/news select high or critical; routes are empty until configured. Unknown/conflicting potentially critical findings notify immediately when `urgent_unknown` is enabled, except a version exclusion that is `unknown` only because its advisory evidence is out of date: that goes to the review digest, and the source's health finding reports the outage. Lower-priority uncertainty goes to a review digest. Known-exploitation and malicious-package overrides are separately configurable. A category with no channels sends nothing, including overrides.
306
+
307
+ AI dismissals now require local review by default (`policy.ai_dismissals: review`). Both general-news and model-only `not_affected` conclusions enter a durable queue, even without notification channels. Use `reviews` to inspect items and `review FINDING_ID --revision N --disposition dismiss|investigate --reviewer NAME --reason TEXT` to record a local decision. `record` explicitly opts out; the legacy boolean is normalized as documented in [configuration](docs/configuration.md#reviewing-ai-dismissals-locally).
308
+
309
+ For system news, the model records `new_vulnerability`, `known_vulnerability_update`, `general_news` or `unknown`, alongside its assessment of system impact. General coverage and supported model-only exclusions require review before dismissal; uncertain analysis goes to the review digest. A vulnerability that the model believes affects the system follows your severity policy. These rules also cover product articles linked to collected CVEs. Critical-source severity, configured exploitation overrides and deterministic library matches still take precedence. See [model configuration](docs/configuration.md#model-configuration) for evidence and version requirements.
310
+
311
+ General-news classifications remain in history after a story leaves RSS. Changes to the article, inventory or model settings trigger reassessment. Affected or excluded impact claims require fresh evidence.
312
+
313
+ Models cannot run tools, change recipients, edit version ranges or establish that a dependency is safe. Model outages and exhausted budgets retain deterministic results and create monitoring-health findings. There is no automatic provider fallback.
314
+
315
+ ## Operate
316
+
317
+ Commands that operate on a configured monitor accept `--config PATH`; the default is `./security-watch.yaml`. For monitor commands, add `--credentials-file PATH` to load a private dotenv file, or export variables through your service manager. The offline `rehearse` command rejects credential files and uses simulated delivery. Existing environment values take precedence for monitor commands. Files are parsed as data, without shell evaluation; they are never loaded implicitly. `init` uses `--directory` instead. Unsupported flag/command combinations are rejected before activity.
318
+
319
+ | Command | Behavior |
320
+ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
321
+ | `providers` | List supported provider profiles without configuration, credentials or network access |
322
+ | `templates` | List common system IDs available to `init --systems` |
323
+ | `ecosystems` | List supported library ecosystems |
324
+ | `normalize-libraries --input PATH` | Parse a library list without network requests; optional `--ecosystem` sets the group and `--output` saves a new JSON file |
325
+ | `scan` | Run once, save evidence/findings and queue notifications; does not deliver by default |
326
+ | `scan --dry-run` | Use in-memory state, disable model calls and send no notifications; source requests still occur |
327
+ | `scan --notify` | Save a scan, attempt due delivery and report the remaining backlog; future or rate-limited jobs stay pending |
328
+ | `scan --fixture PATH` | Use local evidence instead of network sources and AI |
329
+ | `scan --no-ai` | Keep structured matching and disable model calls for this invocation |
330
+ | `start` | Run the scheduler and delivery worker in the foreground |
331
+ | `findings`, `status`, `deliveries`, `budget` | Inspect saved assessments, monitoring state, delivery outcomes and budget reservations |
332
+ | `health` | Check worker heartbeat, completed-scan freshness and actionable delivery problems; exits 2 when unhealthy |
333
+ | `health --scan-only` | Check completed scans and delivery without requiring a foreground worker, for external cron schedules |
334
+ | `reviews [--all] [--limit N] [--after CURSOR]` | Inspect the durable local AI dismissal queue and its backlog |
335
+ | `review FINDING_ID --revision N --disposition dismiss\|investigate --reviewer NAME --reason TEXT` | Adjudicate an exact current review locally without sending a notification |
336
+ | `explain FINDING_ID` | Show a finding, its current policy decision and acknowledgement/suppression controls |
337
+ | `history FINDING_ID` | Show saved finding revisions |
338
+ | `acknowledge FINDING_ID` | Acknowledge the current revision, or only revision N with `--revision N` |
339
+ | `suppress FINDING_ID --hours 24 --reason TEXT` | Suppress until an explicit expiry |
340
+ | `retry DELIVERY_ID` | Requeue a failed/uncertain delivery after checking receipt; does not send immediately |
341
+ | `backup --output PATH` | Create a consistent SQLite backup at a new destination and verify a temporary restored copy |
342
+ | `verify-backup --input PATH` | Verify a standalone backup without monitor configuration or replacing a live database |
343
+ | `prune` | Show a read-only plan using configured retention periods |
344
+ | `prune --apply` | Apply one bounded retention batch atomically |
345
+ | `unlock` | Remove stale lock metadata only when no worker owns the SQLite lock |
346
+ | `test-notification --channel slack` | Send an explicit test message; `email` is also supported |
347
+
348
+ Only one scan/scheduler instance may write a given database. Inspection and acknowledgement use SQLite safely alongside the worker. Do not share a database between containers or hosts or put it on a network filesystem. Stop the worker before replacing a database with a backup; retain permissions and move aside stale SQLite sidecar files with the old database.
349
+
350
+ Digests use fixed UTC epoch-aligned time buckets, defaulting to midnight UTC, with at most five findings per delivery. Larger digests produce multiple messages. `scan --notify` does not wait for future digest times, retry timers or Slack rate limits; it prints the remaining backlog. Use `start` to keep draining the queue as jobs become due. Urgent deterministic results are attempted before optional AI work.
351
+
352
+ A notification marked `accepted` was accepted by the destination, not necessarily read. Interrupted or ambiguous delivery becomes `unknown`: inspect the destination before `retry`, because it may already have arrived. Automatic retries cover explicit transient rejections and DNS/connection failures known to occur before sending. Slack digests split to fit the message limit, and one malformed queued message does not block healthy messages. Delivery state remains available even when a destination fails.
353
+
354
+ `scan` exits with status 2 for degraded monitoring or failed/uncertain delivery (running without an AI model is a supported setup and is reported under `notices`, not as degraded), including an early urgent delivery attempt; setup/command failures use status 1. `health` is read-only, makes no network requests, and reports monitoring health rather than whether systems are secure. The Compose service includes this health check. Check `status`, service logs and delivery state rather than treating an empty findings list as an all-clear.
355
+
356
+ One failed source item, model response or notification does not stop unrelated work. Valid evidence and findings are saved, incomplete sources keep their previous checkpoints, and `start` continues scheduled scans and due deliveries. A one-shot `scan` finishes its work and reports degraded status; it does not stay running. Cancellation and failures that prevent reliable database writes still stop the worker.
357
+
358
+ SIGTERM/SIGINT cancels source/model requests and active delivery attempts, then stops further work. Interrupted or ambiguous receipt remains explicit. Before urgent sends, inventory exclusions, withdrawals and removals are reconciled. Every delivery rechecks current routing policy.
359
+
360
+ ### Heartbeats, retention and backups
361
+
362
+ All three are opt-in. `init --heartbeat` adds an external success-ping route using the `HEARTBEAT_URL` environment variable. Configure the receiving service to alert when pings stop. The worker sends a bodyless request only while monitoring health is healthy; failed scans or delivery problems withhold success pings. This is separate from the local `health` command and sends no inventory or logs.
363
+
364
+ Configure `maintenance.retention`, inspect `security-watch prune --config PATH`, then use `--apply` for one cleanup batch. Once configured, `start` also applies retention on the maintenance schedule. Active or uncertain findings, unresolved deliveries, source checkpoints and budget records remain protected. Expiring an inactive finding requires a supported exclusion, withdrawal or confirmed general-news result; removing a system from inventory is not enough.
365
+
366
+ `maintenance.backup` schedules private snapshots, verifies them before rotation, and keeps the configured number. When both are enabled, a verified backup precedes pruning. `verify-backup` tests schema migration and structural restoration in a temporary copy; it does not prove that stored security claims are correct. See [maintenance configuration](docs/configuration.md#retention-and-verified-backups) before enabling either policy.
367
+
368
+ ### Model evaluation from a checkout
369
+
370
+ ```sh
371
+ npm run evaluate:models -- --help
372
+ npm run evaluate:models
373
+ ```
374
+
375
+ Without `--live`, the script makes no provider calls and reports skipped cases. To run it, supply provider credentials and exact `SECURITY_WATCH_EVAL_<PROVIDER>_MODEL` values in the environment, then choose providers and a request cap:
376
+
377
+ ```sh
378
+ npm run evaluate:models -- --live --providers openai,anthropic --max-requests 20
379
+ ```
380
+
381
+ Run `npm run evaluate:outcomes -- --output alert-evaluation.json` from a checkout for the offline final-outcome regression gate. It compares deterministic matching, one model and verification using production policy and a fresh local outbox, and reports false quiet dismissals, unnecessary immediate alerts and benign digest/review burden. See the [outcome evaluation guide](docs/alert-outcome-evaluation.md) for controls, human-label import and production-readiness limits.
382
+
383
+ The corpus contains source-derived synthetic scenarios with fictional inventories. Its reference labels are marked `pending_human_review`. Reports distinguish output acceptance, coverage, label agreement, false exclusions, rejected outputs and model disagreements. Label agreement is not measured production accuracy. Live runs may incur charges, use a total request cap, and send no notifications; full options are in the script help.
384
+
385
+ ## Boundaries and privacy
386
+
387
+ cve.now stack queries disclose deduplicated npm package names and versions; lockfiles and deployment metadata are not uploaded. The Hacker News feed and article servers receive normal HTTP requests. Optional OSV queries also disclose dependency names and versions; optional GitHub, CISA and additional feed sources receive normal HTTP requests. GitHub authentication is optional. The selected model provider receives, under the default `minimal` disclosure profile, the matched package and product names and versions plus selected evidence; the `deployment-context` profile adds environment, exposure, criticality and matching keywords (see [SECURITY.md](SECURITY.md)). Slack/email receive findings and evidence links. Consider these disclosures before monitoring private dependencies.
388
+
389
+ Authentication credentials are read from environment variables. Findings, evidence, quoted model output, budget reservations and history are stored locally. There is no automatic application telemetry. An explicitly configured heartbeat service receives success pings and normal request metadata. Protect the configuration, SQLite database, backups and credentials as operational data. Details are in [SECURITY.md](SECURITY.md).
390
+
391
+ This release has no automatic patching, shell execution from news, hosted dashboard, Slack action buttons, general SBOM import, distributed workers, EPSS integration or independent security audit. CVSS v3.0/v3.1 vectors and supplied severity labels/scores are supported. OSV and GitHub also support [CVSS v4 base-vector scoring](docs/cvss-v4-support.md), with explicit base projection and unsupported-vector diagnostics. Product backports, reachability and exploit prerequisites require human/vendor evidence. cve.now starts from recent entries, revisits tracked/news-cited CVEs and checks exact npm packages through its stack endpoint; this is not an exhaustive historical audit of every product. Existing configurations retain explicitly enabled legacy sources; set `osv`, `github` and `kev` to `false` to switch exclusively to the new defaults.
392
+
393
+ Current evidence and findings are loaded into memory during each scan. Retention is disabled until configured, and protected unresolved records may continue growing even after cleanup is enabled. This release targets small installations. Plan storage and review retention dry runs before increasing scale.
394
+
395
+ See the [configuration guide](docs/configuration.md), [security policy](SECURITY.md) and [contributing guide](CONTRIBUTING.md). Licensed under Apache-2.0.
package/SECURITY.md ADDED
@@ -0,0 +1,62 @@
1
+ # Security policy and boundaries
2
+
3
+ Security Watch is a monitoring tool without an independent security audit. Security reports are handled on a best-effort basis by a single maintainer, with no guaranteed response time; fixes are released for the latest 1.x version. Validate findings against your deployment before using them to make remediation decisions.
4
+
5
+ ## Report a vulnerability
6
+
7
+ Use [GitHub's private vulnerability reporting form](https://github.com/ShieldaAI/security-watch/security/advisories/new). If that option is unavailable, ask a maintainer for a private reporting channel without posting exploit details, credentials, private inventory or affected customer data publicly. Do not send real secrets in examples. There is no dedicated security reporting address yet.
8
+
9
+ Include the relevant commit/version, Node version, a minimal synthetic reproduction, expected versus observed behavior, and which trust boundary is crossed. Reports involving lost alerts, false safety conclusions, credential disclosure, unsafe network access or duplicate/incorrect delivery are particularly useful.
10
+
11
+ ## Trust model
12
+
13
+ Trusted inputs are the operator's configuration, inventory, chosen model/SMTP endpoints, environment, local filesystem and installed application/dependencies. Feed bodies, article text, advisory text and model output are untrusted evidence. The application does not protect against a malicious local administrator, compromised dependency, hostile model endpoint explicitly trusted by the operator, or altered system clock.
14
+
15
+ Implemented boundaries include:
16
+
17
+ - Strict configuration/inventory parsing, bounded input sizes and metadata-only lockfile import. No package installation or lifecycle-script execution occurs during monitoring.
18
+ - Public HTTPS fetching with checks on the addresses used by the connection, bounded redirects/timeouts/response sizes, and removal of authentication headers on cross-origin redirects. Model and external-heartbeat endpoints may explicitly opt into private addressing; plain HTTP is then allowed only to private or local addresses, checked again on the addresses the connection uses. SMTP endpoints are operator-selected.
19
+ - Models receive no shell, browser, filesystem or notification tools. Output is schema-checked, evidence IDs must exist, and supporting quotes must appear in the supplied evidence.
20
+ - The Hacker News article requests are restricted to its publication hosts and have size limits. Article links to other sites are not crawled. Missing, excerpted, stale or truncated evidence cannot support a new decisive AI impact conclusion. Historical general-news classifications are retained; current affected/excluded claims require fresh evidence.
21
+ - Deterministic package matching and source-severity floors govern library/product decisions. AI cannot rewrite recipients, authoritative version constraints or dependency applicability.
22
+ - AI news classification and claimed system impact are stored separately from authoritative applicability. Evidence-backed general news or an AI-reported exclusion can suppress noncritical news alerts, but cannot override source-critical or enabled known-exploitation safeguards.
23
+ - Slack destinations come only from operator configuration and are restricted to standard `hooks.slack.com` incoming webhooks. SMTP requires TLS. Notification content is rendered as text and cannot enable attachments, filesystem reads or URL-fetching features in the email transport. Each value from an advisory, a model or the inventory is placed on a single line behind that line's own label, with runs of blank characters reduced to one space, so it cannot add a line that looks like one of the message's own labels; inventory text fields reject control characters and line separators when the inventory is loaded.
24
+ - Findings and their delivery jobs are committed together. Ambiguous delivery is visible and requires a manual receipt check before retrying. An email is retried automatically only when the failure provably came before the message was handed over (before `MAIL FROM`) or the server refused it with a temporary response code; a connection lost after that point is recorded as uncertain.
25
+
26
+ Models can misinterpret sources, feeds can omit important facts, and advisories can be wrong or delayed. Check source failures and uncertain findings during operational review. The bot does not provide a general prompt-injection detector or execution sandbox.
27
+
28
+ ## Data handling
29
+
30
+ cve.now stack requests reveal deduplicated npm package names and exact versions through URL query parameters; lockfiles and system/deployment metadata are not uploaded. The Hacker News feed and article servers receive normal HTTP request metadata. Optional OSV requests reveal library ecosystem, package name and the installed version when supplied. Official vendor feeds receive normal request metadata. Other enabled advisory/feed servers receive normal request metadata, and GitHub may receive the configured API token.
31
+
32
+ Each configured AI model defaults to the `minimal` disclosure profile. It receives selected relevant package ecosystem/name/version and product name/version, request-local IDs and inventory freshness status, plus target event and selected evidence fields/excerpts. Original inventory IDs, system name/owner, repository URLs, provenance, dependency graphs, verification declarations, remediation records and operator identities are excluded. `deployment-context` opts that specific model into environment/exposure/criticality and evidence-matching keywords, never other inventory metadata. The verifier applies its own profile independently. Allowed names and evidence text are not secret-redacted; do not place private content there unless the endpoint is approved to receive it. Full contracts and migration behavior are in [model disclosure configuration](docs/configuration.md#data-sent-to-models).
33
+
34
+ Inventory notes (the `note` field on systems, libraries and products) are the operator's own pointers to where something runs. They are stored in the local database and shown in notifications together with the system name and owner. They are never sent to advisory sources and are excluded from model requests under both disclosure profiles. Do not put secrets in a note.
35
+
36
+ Notifications disclose formatted finding context, the inventory names and notes above, and source links to Slack or the configured email recipients under separate routing policy; model disclosure settings do not filter notification payloads or public inventory queries. There is no automatic application telemetry. An optional, operator-configured heartbeat endpoint receives bodyless success pings and normal request metadata. It receives no inventory, finding content or logs.
37
+
38
+ Credential values are read from environment variables, not placed in model prompts or intentionally persisted in SQLite. Do not insert keys into model names, feed URLs, inventory text or configuration substitutions. Use your service manager or secret manager to supply credentials; the CLI does not automatically load `.env` files. Do not commit configuration, database files, backups or `.env` files to source control.
39
+
40
+ SQLite stores evidence, finding revisions, model analysis excerpts, caches, budgets and delivery state. Database files use private permissions but are not application-encrypted. Use appropriate host access controls and encrypted storage. Retention and scheduled backups are disabled until configured. Cleanup preserves active or unresolved findings, unresolved delivery audit, source checkpoints and budgets; it is bounded and has a read-only preview. Scheduled backup rotation removes only managed snapshots after a new snapshot verifies successfully. Backups can contain the same sensitive material as the live database. Verification copies a standalone snapshot into a private temporary directory and checks structural restoration, including migrations, without replacing live state. This is not validation of every stored security claim; plan disk capacity and protect backup destinations.
41
+
42
+ ## Coverage limitations
43
+
44
+ - Library inventory supports 12 ecosystems. npm names are matched exactly, including letter case: a capitalised name typed by hand is listed as a notice by `doctor` and in every scan report, because it matches only advisories published under that spelling; the notice does not degrade monitoring. npm and a bounded PyPI final-release subset use supported version-range evaluation and exclusions; complex PEP 440 forms remain unknown. Other ecosystems require a positive exact OSV query or an explicitly listed affected version; a missing version, unmatched result or unsupported range stays unknown. Lockfile entries include dependencies that may not be present in production.
45
+ - Generic products, operating systems and SaaS services have name/keyword candidate matching plus optional AI news/impact analysis. AI impact is an evidence-backed opinion, not a deterministic product-version result. Vendor backports, enabled features and exploit reachability are not automatically established.
46
+ - Missing versions, unknown constraints and stale inventory remain uncertain. An empty advisory search does not establish that a system has no vulnerabilities.
47
+ - CVSS v3.0/v3.1 calculation and supplied source labels/scores are supported. For OSV and GitHub records, CVSS v4 base vectors are scored with the pinned FIRST reference calculator; threat and environmental metrics are not applied, and unsupported vectors are counted and left unknown. See [CVSS v4 support](docs/cvss-v4-support.md).
48
+ - A package named only in the prose of a news story is matched by rules, not by understanding: a name that is an English word must be named as a package, carry a release or be written as a name, a scoped package is matched by its full name only, and a Maven library by its coordinates or by an artifact name that is not an English word. Stories about such packages can be missed and, less often, an unrelated story can match; see the [matching rules](docs/configuration.md#sources-and-coverage). Advisories are matched by structured package claims and are not affected.
49
+ - Source requests and model inputs have size and request limits. Incomplete collection or analysis reports degraded monitoring and requires review.
50
+ - Recent cve.now entry collection, tracked/news-cited refreshes and exact npm stack queries do not establish exhaustive historical coverage for every product. The recent listing is read one week past the checkpoint; a record cve.now ingests more than a week after its publication date is found only through an exact npm match or a news citation. The Hacker News may block article access; the feed excerpt remains available for review without a confident impact conclusion.
51
+ - CycloneDX JSON 1.4–1.6 package metadata import is supported, but not general SBOM/VEX ingestion, attestation verification or live deployment discovery. There is no authenticated web crawling, automatic remediation, distributed lock, multi-host worker or independent penetration-test certification.
52
+ - Notifications are not exactly-once delivery. A timeout can occur after a destination accepts a message. Verify receipt before retrying an `unknown` job.
53
+
54
+ Review `status`, `deliveries`, source-health findings and service logs. Optional external success pings stop when monitoring is unhealthy, but the receiving service must be configured to detect missing pings. Loss of the host or every delivery channel cannot be reported through that same failed infrastructure.
55
+
56
+ Inventory origin, digest, provenance, observation and configuration fields are operator declarations. They do not authenticate artifact origin or establish a deployed fix. Baselines are stored locally for drift comparison; do not include secrets. Coverage receipts describe bounded collection and must not be interpreted as an exhaustive vulnerability scan. Configuration-dependent remediation guidance remains subject to operator verification.
57
+
58
+ ## Local AI dismissal review
59
+
60
+ Both AI-only quiet routes require review by default. `policy.ai_dismissals: record` explicitly opts out. Review and notification delivery are separate: sending a digest does not approve a dismissal, and no configured channel is required for the local queue. A human verdict binds the finding revision, reviewed source content and installed/model context. Source changes invalidate stale verdicts even before a scan completes reassessment.
61
+
62
+ CLI review commands rely on private local database/OS access. The reviewer string is an operator-declared audit label, not an identity-provider assertion. Review notes stay local and in backups. Generic retention protects review history and its evidence; review-specific expiry is not implemented. A local dismissal can cancel pending delivery but cannot recall an in-flight message. Review never changes authoritative version applicability.
@@ -0,0 +1,16 @@
1
+ import type { Assessment, Config, Decision, Evidence, Inventory } from './types.js';
2
+ export declare function normalizeEventId(id: string): string;
3
+ /** Assess each deployment independently against package identity and version evidence. */
4
+ export declare function assess(inventory: Inventory, evidence: Evidence[], config: Config, now?: number,
5
+ /**
6
+ * The time against which the age of advisory evidence is judged; `now` unless given. A scan that
7
+ * reconciles stored evidence before refreshing it passes the time of the last collection, so
8
+ * evidence does not count as stale merely because the refresh has not happened yet.
9
+ */
10
+ evidenceAsOf?: number,
11
+ /** Event identifiers of findings already reported; an event keeps the one it was reported under. */
12
+ knownEvents?: ReadonlySet<string>,
13
+ /** Identifiers of findings already reported, for an event that merges two reported ones. */
14
+ knownFindings?: ReadonlySet<string>): Assessment[];
15
+ /** The source severity is always a floor; AI-proposed priority reductions cannot suppress it. */
16
+ export declare function decide(assessment: Assessment, config: Config): Decision;