exploitwatch-mcp 0.1.0__tar.gz → 0.2.0__tar.gz
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.
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/.gitignore +4 -0
- exploitwatch_mcp-0.2.0/CHANGELOG.md +27 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/PKG-INFO +18 -3
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/README.md +16 -2
- exploitwatch_mcp-0.2.0/docs/plans/response-caching.md +53 -0
- exploitwatch_mcp-0.2.0/docs/releases/v0.2.0.md +55 -0
- exploitwatch_mcp-0.2.0/evals/dashboard_data.py +216 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/mvp_cases.yaml +2 -2
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/run_mvp_validation.py +202 -50
- exploitwatch_mcp-0.2.0/evals/telemetry.py +113 -0
- exploitwatch_mcp-0.2.0/evals/token_profile.py +217 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/pyproject.toml +2 -1
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/news.py +8 -5
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/nvd.py +6 -3
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/server.py +51 -26
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_news.py +21 -9
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_nvd.py +9 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_server.py +26 -6
- exploitwatch_mcp-0.2.0/tests/test_telemetry.py +239 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/uv.lock +1 -1
- exploitwatch_mcp-0.1.0/CHANGELOG.md +0 -16
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/.env.example +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/LICENSE +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/exec_domain_cases.yaml +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/make_report.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/report_notes.yaml +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/evals/report_notes_exec_domain.yaml +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/scripts/live_check.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/__init__.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/epss.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/http.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/ids.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/kev.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/methodology.md +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/src/exploitwatch_mcp/rules.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2010-0050.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2012-0001.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2021-44228.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-101147.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-103534.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-103656.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-103678.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-13313.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/fixtures/nvd/CVE-2026-98167.json +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_epss.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_http.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_kev.py +0 -0
- {exploitwatch_mcp-0.1.0 → exploitwatch_mcp-0.2.0}/tests/test_rules.py +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 (2026-11-23)
|
|
4
|
+
|
|
5
|
+
Grounding release: changes driven by evaluation of answers on three host models (Claude Haiku, Sonnet and Opus 5.5). Urgency methodology unchanged (version 1).
|
|
6
|
+
|
|
7
|
+
- Tool descriptions (`lookup_cve`, `check_kev`, `get_epss`, `search_cve_news`): base every fact about the CVE on the tool's output and label anything else as background. News claims must come from a result's title or snippet.
|
|
8
|
+
- `triage_cve` prompt: calls `search_cve_news` on every triage, for context the databases don't give (how widely the affected software is used, who is exploiting it, vendor fixes). News never changes the urgency. The exec format uses news as context without naming or linking sources.
|
|
9
|
+
- `TAVILY_API_KEY` is now required to use `triage_cve` (README). Without it, news search falls back to Tavily's keyless mode, which is rate-limited, and triage answers say the news context is missing.
|
|
10
|
+
- Results (final eval, Nov 15, after human review): answers with a wrong or unsupported fact fell from 13% to 2% on Sonnet and from 20% to 0% on Opus; Haiku's answers no longer contradict the tool data. Pass rates: Sonnet 95%, Opus 92%, Haiku 87%. Details: `docs/releases/v0.2.0.md`.
|
|
11
|
+
- Python API: `server.lookup()` and `server.news()` run the `lookup_cve` and `search_cve_news` work with a caller's own NVD or Tavily key (optional; tool signatures unchanged).
|
|
12
|
+
- Evaluation: per-call token, cost and latency tracing; three-model comparison on the same cases; failure categories in the results CSV; split judge votes go to human review; upstream outages are excluded as infrastructure. Evaluation set v1 (10 cases) is unchanged.
|
|
13
|
+
|
|
14
|
+
## 0.1.0 (2026-11-05)
|
|
15
|
+
|
|
16
|
+
First release as a standalone package.
|
|
17
|
+
|
|
18
|
+
- Tools: `lookup_cve`, `check_kev`, `get_epss`, `search_cve_news`; resource `exploitwatch://methodology`; prompt `triage_cve`.
|
|
19
|
+
- Urgency methodology version 1: exploitation (CISA KEV, checked live) first, then CVSS bands; `needs review` when no score exists; rejected CVEs return an error.
|
|
20
|
+
- One CVSS score chosen in a fixed order (NVD before CNA or CISA; 3.1, 4.0, 3.0, then 2.0), reported with its version, source and NVD status.
|
|
21
|
+
- Strict input: exactly one CVE ID per call.
|
|
22
|
+
- News search: the server drops any result outside the domain allowlist instead of trusting the search provider to filter.
|
|
23
|
+
- KEV catalog cached for 6 hours, with the last copy kept if a refresh fails (retried every 10 minutes during an outage); `kev_checked` and `kev_catalog_version` show whether and which catalog was used.
|
|
24
|
+
- `triage_cve` prompt: the engineer format names the score's source and version and asks for affected versions and fix steps only where the data states them; the exec format is exactly three sentences (risk; urgency and its reason; decision) with no scores, CVSS versions, sources or acronyms (software versions only where the data states them), and one or two sentences when the lookup returns an error.
|
|
25
|
+
- `lookup_cve` guidance: no own severity verdict for `needs review`.
|
|
26
|
+
- `urgency_reason` names the rule that set the urgency; answers must say when "patch now" is because the CVE is actively exploited.
|
|
27
|
+
- Pre-release validation: 10 cases end to end with an LLM judge (`evals/`).
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: exploitwatch-mcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: MCP server for CVE triage: NVD details, CISA KEV exploitation status, EPSS scores, trusted news, and a rule-based patch urgency.
|
|
5
5
|
Project-URL: Homepage, https://github.com/charlesdata1/exploitwatch-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/charlesdata1/exploitwatch-mcp
|
|
7
7
|
Project-URL: Issues, https://github.com/charlesdata1/exploitwatch-mcp/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/charlesdata1/exploitwatch-mcp/blob/main/CHANGELOG.md
|
|
8
9
|
Author: Charles Bryant
|
|
9
10
|
License-Expression: MIT
|
|
10
11
|
License-File: LICENSE
|
|
@@ -161,7 +162,7 @@ claude mcp add exploitwatch -- uvx exploitwatch-mcp
|
|
|
161
162
|
|
|
162
163
|
| Variable | Needed for | |
|
|
163
164
|
|---|---|---|
|
|
164
|
-
| `TAVILY_API_KEY` | `search_cve_news` |
|
|
165
|
+
| `TAVILY_API_KEY` | `search_cve_news`, `triage_cve` | **Required to use the `triage_cve` prompt**, which calls the news search on every triage for context the databases don't give (such as how widely the affected software is used). Without a key, news search falls back to Tavily's keyless mode, which is rate-limited and may be refused; triage answers will then say the news context is missing. Get a key from [tavily.com](https://tavily.com). The other tools never need it. |
|
|
165
166
|
| `NVD_API_KEY` | `lookup_cve` | Optional. Raises NVD's rate limit. [Request one from NIST](https://nvd.nist.gov/developers/request-an-api-key). |
|
|
166
167
|
|
|
167
168
|
Set them in your MCP client's `env` block, as above. When running from a clone, a `.env` file in the directory you start the server from also works (see `.env.example`).
|
|
@@ -177,7 +178,20 @@ Set them in your MCP client's `env` block, as above. When running from a clone,
|
|
|
177
178
|
|
|
178
179
|
## Validation
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
**0.2.0 (Nov 15).** The same 10 cases were used to measure answers built on the server on three host models,
|
|
182
|
+
after two grounding changes: every tool description tells the model to base each fact on the tool output,
|
|
183
|
+
and `triage_cve` searches trusted news on every triage. Pass rates are after human review.
|
|
184
|
+
|
|
185
|
+
| Model | Answers passed (Nov 10 → Nov 15) | Wrong or unsupported facts |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| Sonnet 5.5 | 83% → 95% | 4 of 30 → 1 of 42 |
|
|
188
|
+
| Opus 5.5 | 77% → 92% | 6 of 30 → 0 of 24 |
|
|
189
|
+
| Haiku 5.5 | 80% → 87% | 4 of 30 (2 wrong) → 2 of 23 (0 wrong) |
|
|
190
|
+
|
|
191
|
+
Tool data was correct in every graded run. Full results, targets and what's still open:
|
|
192
|
+
[docs/releases/v0.2.0.md](https://github.com/charlesdata1/exploitwatch-mcp/blob/main/docs/releases/v0.2.0.md).
|
|
193
|
+
|
|
194
|
+
**0.1.0 (Nov 4).** Before release, 10 base and edge cases were run end to end: Claude answered each one using this server's
|
|
181
195
|
tools, code checked the raw tool output, and a separate LLM judge (gpt-5-mini) scored every answer on a
|
|
182
196
|
7-point rubric, with 3 runs per case. The server's output was correct in all 60 runs. Round 1 found two
|
|
183
197
|
defects in the guidance the server gives assistants, both fixed before round 2; round 3 confirmed the
|
|
@@ -232,6 +246,7 @@ answer the judge had passed. Record and evidence: [evals/human_review/](https://
|
|
|
232
246
|
- **Configurable allowlist**: an organisation can approve additional news and advisory domains.
|
|
233
247
|
- **Optional decision inputs**: SSVC decision points, and EPSS as an optional urgency input.
|
|
234
248
|
- **Readability and upkeep**: CNA names instead of IDs, and a scheduled live check against the real APIs.
|
|
249
|
+
- **Response caching**: cache NVD and EPSS lookups across sessions, measured before and after ([plan](https://github.com/charlesdata1/exploitwatch-mcp/blob/main/docs/plans/response-caching.md)).
|
|
235
250
|
|
|
236
251
|
## Development
|
|
237
252
|
|
|
@@ -138,7 +138,7 @@ claude mcp add exploitwatch -- uvx exploitwatch-mcp
|
|
|
138
138
|
|
|
139
139
|
| Variable | Needed for | |
|
|
140
140
|
|---|---|---|
|
|
141
|
-
| `TAVILY_API_KEY` | `search_cve_news` |
|
|
141
|
+
| `TAVILY_API_KEY` | `search_cve_news`, `triage_cve` | **Required to use the `triage_cve` prompt**, which calls the news search on every triage for context the databases don't give (such as how widely the affected software is used). Without a key, news search falls back to Tavily's keyless mode, which is rate-limited and may be refused; triage answers will then say the news context is missing. Get a key from [tavily.com](https://tavily.com). The other tools never need it. |
|
|
142
142
|
| `NVD_API_KEY` | `lookup_cve` | Optional. Raises NVD's rate limit. [Request one from NIST](https://nvd.nist.gov/developers/request-an-api-key). |
|
|
143
143
|
|
|
144
144
|
Set them in your MCP client's `env` block, as above. When running from a clone, a `.env` file in the directory you start the server from also works (see `.env.example`).
|
|
@@ -154,7 +154,20 @@ Set them in your MCP client's `env` block, as above. When running from a clone,
|
|
|
154
154
|
|
|
155
155
|
## Validation
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
**0.2.0 (Nov 15).** The same 10 cases were used to measure answers built on the server on three host models,
|
|
158
|
+
after two grounding changes: every tool description tells the model to base each fact on the tool output,
|
|
159
|
+
and `triage_cve` searches trusted news on every triage. Pass rates are after human review.
|
|
160
|
+
|
|
161
|
+
| Model | Answers passed (Nov 10 → Nov 15) | Wrong or unsupported facts |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| Sonnet 5.5 | 83% → 95% | 4 of 30 → 1 of 42 |
|
|
164
|
+
| Opus 5.5 | 77% → 92% | 6 of 30 → 0 of 24 |
|
|
165
|
+
| Haiku 5.5 | 80% → 87% | 4 of 30 (2 wrong) → 2 of 23 (0 wrong) |
|
|
166
|
+
|
|
167
|
+
Tool data was correct in every graded run. Full results, targets and what's still open:
|
|
168
|
+
[docs/releases/v0.2.0.md](https://github.com/charlesdata1/exploitwatch-mcp/blob/main/docs/releases/v0.2.0.md).
|
|
169
|
+
|
|
170
|
+
**0.1.0 (Nov 4).** Before release, 10 base and edge cases were run end to end: Claude answered each one using this server's
|
|
158
171
|
tools, code checked the raw tool output, and a separate LLM judge (gpt-5-mini) scored every answer on a
|
|
159
172
|
7-point rubric, with 3 runs per case. The server's output was correct in all 60 runs. Round 1 found two
|
|
160
173
|
defects in the guidance the server gives assistants, both fixed before round 2; round 3 confirmed the
|
|
@@ -209,6 +222,7 @@ answer the judge had passed. Record and evidence: [evals/human_review/](https://
|
|
|
209
222
|
- **Configurable allowlist**: an organisation can approve additional news and advisory domains.
|
|
210
223
|
- **Optional decision inputs**: SSVC decision points, and EPSS as an optional urgency input.
|
|
211
224
|
- **Readability and upkeep**: CNA names instead of IDs, and a scheduled live check against the real APIs.
|
|
225
|
+
- **Response caching**: cache NVD and EPSS lookups across sessions, measured before and after ([plan](https://github.com/charlesdata1/exploitwatch-mcp/blob/main/docs/plans/response-caching.md)).
|
|
212
226
|
|
|
213
227
|
## Development
|
|
214
228
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Response caching: plan and evaluation
|
|
2
|
+
|
|
3
|
+
Status: planned, not started (2026-11-08)
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
Measure before building. The goal is to show the effect of caching on a small sample, and to give
|
|
8
|
+
readers a model they can apply to their own (enterprise) volume, not a direct extrapolation.
|
|
9
|
+
|
|
10
|
+
**Hypothesis:** caching NVD lookups cuts repeat-lookup latency by more than 90%, and cuts NVD calls
|
|
11
|
+
in proportion to the hit rate, which keeps the server under NVD's rate limits at higher volume.
|
|
12
|
+
|
|
13
|
+
Note: this is server-side **data caching** (fewer external API calls). It is separate from prompt
|
|
14
|
+
caching, which happens in the host at the model API.
|
|
15
|
+
|
|
16
|
+
## Current state
|
|
17
|
+
|
|
18
|
+
- `check_kev`: already cached in memory, 6h TTL, falls back to the stale copy if a refresh fails (`src/exploitwatch_mcp/kev.py`).
|
|
19
|
+
- `lookup_cve`, `get_epss`, `search_cve_news`: not cached.
|
|
20
|
+
|
|
21
|
+
## Candidates
|
|
22
|
+
|
|
23
|
+
| Tool | Cache? | TTL | Why |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| `lookup_cve` (NVD) | Best candidate | ~24h per CVE | NVD rate-limits hard without an API key; records rarely change |
|
|
26
|
+
| `get_epss` | Yes | ~24h, or until next daily release | EPSS is published once a day |
|
|
27
|
+
| `search_cve_news` | Maybe | ~1h or none | Freshness is the point of news |
|
|
28
|
+
|
|
29
|
+
## Design decisions
|
|
30
|
+
|
|
31
|
+
1. **Memory or disk.** A stdio server usually lives for one client session, so an in-memory cache is lost when it stops. Use SQLite or `diskcache` to persist across sessions.
|
|
32
|
+
2. **Never cache failures.** Store successful responses only.
|
|
33
|
+
3. **Show freshness.** Return `fetched_at` / `cached: true` so the model and the methodology can account for data age.
|
|
34
|
+
4. **Normalise the key.** Run the CVE ID through `ids.py` before using it as the key.
|
|
35
|
+
5. **Bound the size** (for example LRU) if in memory.
|
|
36
|
+
|
|
37
|
+
## Evaluation
|
|
38
|
+
|
|
39
|
+
What 10 samples can show: the per-call mechanism (a hit is much faster than a network call).
|
|
40
|
+
What they can't show: enterprise savings, which depend on the **hit rate**, which comes from the workload.
|
|
41
|
+
|
|
42
|
+
- **Design:** 10 CVEs, cold vs warm, repeated about 5 times (about 50 measurements per condition).
|
|
43
|
+
- **Metrics:** latency per call (median, min/max, not p95 at this sample size), external API calls made, calls avoided.
|
|
44
|
+
- **Report measured and projected results separately.**
|
|
45
|
+
- Measured: "a hit saves X ms and one NVD call."
|
|
46
|
+
- Projected: savings ≈ calls × hit rate × (cold − warm), as a table at 20 / 50 / 80% hit rates so readers plug in their own workload.
|
|
47
|
+
- **Tests:** two calls to the same tool make one HTTP request; a failed fetch is not cached.
|
|
48
|
+
|
|
49
|
+
## Known gaps (state up front)
|
|
50
|
+
|
|
51
|
+
- Single machine, single network, no concurrency.
|
|
52
|
+
- Real enterprise hit rates are assumed, not measured.
|
|
53
|
+
- Stale-data risk is not measured.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ExploitWatch-MCP 0.2.0: grounded answers
|
|
2
|
+
|
|
3
|
+
0.1.0 passed its release check on Nov 5: server data correct in 60 of 60 runs, the judge caught 5 of 5 planted errors, and every remaining failure was reviewed by hand. This release uses the same evaluation set to measure how answers built on the server perform on three host models. Two small server changes followed from what it found.
|
|
4
|
+
|
|
5
|
+
## What the evaluation found, and what changed
|
|
6
|
+
|
|
7
|
+
| Finding | Change in the server |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Answers stated facts the tools never returned, for example a CVE's nickname or what a product is used for. Nothing in the tool descriptions told the model to stay with the data; they only said not to change the urgency. | Every tool description now says to base each fact about the CVE on the tool output and to label anything else as background. |
|
|
10
|
+
| Executive summaries described business risk ("a widely used compression tool") from the model's memory. The `triage_cve` prompt never searched the news, so that context had no source, although trusted sources state it ("included in most Linux distributions"). | `triage_cve` calls `search_cve_news` on every triage. The exec summary uses the news as context without naming sources. |
|
|
11
|
+
| Users without a news key would get degraded triage. | The README says `TAVILY_API_KEY` is required for `triage_cve`. |
|
|
12
|
+
|
|
13
|
+
On the executive-summary case alone, answers with an unsupported fact went from 4 of 5 to 0 of 7 after the news change (Sonnet, Nov 14 vs Nov 15).
|
|
14
|
+
|
|
15
|
+
## Results
|
|
16
|
+
|
|
17
|
+
Same 10 cases, rubric, judge (gpt-5-mini, 3 votes) and tools as the Nov 10 test. Sonnet answered each case 5 times and Haiku and Opus 3 times. Pass rates are after human review.
|
|
18
|
+
|
|
19
|
+
| Model | Answers passed (Nov 10 → Nov 15) | Wrong or unsupported facts | Cost per answer |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| Sonnet 5.5 | 83% → **95%** | 4 of 30 → **1 of 42** | $0.0159 → $0.0176 |
|
|
22
|
+
| Opus 5.5 | 77% → **92%** | 6 of 30 → **0 of 24** | $0.0334 → $0.0390 |
|
|
23
|
+
| Haiku 5.5 | 80% → 87% | 4 of 30 (2 wrong) → 2 of 23 (0 wrong) | $0.0010 → $0.0012 |
|
|
24
|
+
|
|
25
|
+
- Tool data was correct in every graded run, and the judge caught all 5 planted errors in each model's run.
|
|
26
|
+
- A **wrong** fact contradicts the tool output (rubric R2). An **unsupported** one isn't in it (R3). True facts from the model's own knowledge count too, since a reader must be able to trace every claim.
|
|
27
|
+
- Sonnet's remaining failure is a remark about the CVE ID format. Haiku's two are mitigation steps and a product description from memory.
|
|
28
|
+
|
|
29
|
+
## Against the targets set for this work
|
|
30
|
+
|
|
31
|
+
| Target | Sonnet | Haiku | Opus |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| Answers passed ≥ 90% | ✅ 95% | ❌ 87% | ✅ 92% |
|
|
34
|
+
| 0 wrong or unsupported facts | ❌ 1 | ❌ 2 | ✅ 0 |
|
|
35
|
+
| Tool data correct, all planted errors caught | ✅ | ✅ | ✅ |
|
|
36
|
+
| Cost ≤ $0.012 per answer | ❌ | ✅ | ❌ |
|
|
37
|
+
| Typical wait ≤ 5 s, slowest 1 in 20 ≤ 8 s | not measured | not measured | not measured |
|
|
38
|
+
|
|
39
|
+
Prompt caching (target ≥ 50% of input) happens in the host, not the server, so it doesn't apply here.
|
|
40
|
+
|
|
41
|
+
## Limits
|
|
42
|
+
|
|
43
|
+
- **Small evaluation set.** Evaluation set v1 has 10 cases, kept unchanged as the MVP baseline so releases are compared on the same questions. It checks correctness and consistency; it is too small to estimate a general error rate. Several of its CVEs are famous, which makes grounding failures harder to see.
|
|
44
|
+
- **NVD outage.** NVD was slow and partly down during the Nov 14 and 15 runs. 21 of 110 final-eval runs are excluded as infrastructure failures, and wait times weren't measurable.
|
|
45
|
+
- **Judge settings.** The judge also reads the tool descriptions, so it saw the new grounding sentence.
|
|
46
|
+
- **Human review.** Split judge votes were reviewed by hand: 5 overturned, 3 upheld. Decisions are in `evals/human_review/overrides.csv`, and the audit trail is in `evals/results/2026-11-15-final-eval/review-queue.csv`.
|
|
47
|
+
|
|
48
|
+
## Next
|
|
49
|
+
|
|
50
|
+
- **Evaluation set v2:** more cases, grown from observed failures. Priorities: CVEs newer than the models' training data, questions the data can't answer, and prompt injection in news results.
|
|
51
|
+
- **A source cited for every next step**, so remediation advice is traceable.
|
|
52
|
+
- **Haiku robustness:** misread fields, and tool calls with empty input.
|
|
53
|
+
- **Latency,** measured on a day NVD is healthy.
|
|
54
|
+
|
|
55
|
+
Tested with Claude Haiku, Sonnet and Opus 5.5, evaluated in depth on Sonnet. Full results: `evals/results/`.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"""Export eval sessions to the executive dashboard's data files: one row per session x answer model.
|
|
2
|
+
|
|
3
|
+
python evals/dashboard_data.py # writes evals/results/dashboard/{kpis,cases}.csv
|
|
4
|
+
|
|
5
|
+
Add a session to SESSIONS after each eval run, re-run this, then upload the CSVs to the dashboard.
|
|
6
|
+
Older sessions without a trace (before telemetry) have quality and latency from the CSV, and no cost.
|
|
7
|
+
Runs that failed for infrastructure reasons (answer or judge API/network error) are excluded and counted.
|
|
8
|
+
"""
|
|
9
|
+
import csv
|
|
10
|
+
import re
|
|
11
|
+
import sys
|
|
12
|
+
from collections import defaultdict
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
16
|
+
from telemetry import read_trace # noqa: E402
|
|
17
|
+
from run_mvp_validation import needs_review # noqa: E402
|
|
18
|
+
from token_profile import percentile # noqa: E402
|
|
19
|
+
|
|
20
|
+
RESULTS = Path(__file__).resolve().parent / "results"
|
|
21
|
+
OUT = RESULTS / "dashboard"
|
|
22
|
+
|
|
23
|
+
# Each session: where its runs are. "csv" sources have no cost; "trace" sources have everything.
|
|
24
|
+
# cases: keep only these case ids from that source (used to stitch a run that was finished in two parts).
|
|
25
|
+
# graded: the run's CSV, the record of each verdict and failed check (older traces did not store failed checks).
|
|
26
|
+
SESSIONS = [
|
|
27
|
+
{"id": "s1", "date": "2026-11-04", "label": "First check", "note": "Baseline before fixes",
|
|
28
|
+
"canaries": {"csv": "2026-11-04-mvp-validation.csv", "round": "1"},
|
|
29
|
+
"sources": [{"csv": "2026-11-04-mvp-validation.csv", "round": "1"}]},
|
|
30
|
+
{"id": "s2", "date": "2026-11-04", "label": "Server fixes", "note": "Two server defects fixed; judge given tool docs",
|
|
31
|
+
"canaries": {"csv": "2026-11-04-mvp-validation.csv", "round": "2"},
|
|
32
|
+
"sources": [{"csv": "2026-11-04-mvp-validation.csv", "round": "2"}]},
|
|
33
|
+
{"id": "s3", "date": "2026-11-09", "label": "Cost baseline", "note": "Answer-format fixes; first run with cost tracing",
|
|
34
|
+
"canaries": {"csv": "2026-11-09-token-profile/mvp-validation.csv"},
|
|
35
|
+
"sources": [{"trace": "2026-11-09-token-profile/trace.jsonl", "graded": "2026-11-09-token-profile/mvp-validation.csv"}]},
|
|
36
|
+
{"id": "s4", "date": "2026-11-09", "label": "Model test 1", "note": "Network degraded; latency unreliable",
|
|
37
|
+
"degraded": True, "sources": [{"trace": "2026-11-09-model-tiers/trace.jsonl"}]},
|
|
38
|
+
{"id": "s5", "date": "2026-11-10", "label": "Model test 2", "note": "Clean network; cases 8-10 finished in a second pass",
|
|
39
|
+
"canaries": {"csv": "2026-11-09-model-tiers-rerun/mvp-validation.csv"},
|
|
40
|
+
"sources": [{"trace": "2026-11-09-model-tiers-rerun/trace.jsonl", "cases": {"1", "2", "3", "4", "5", "6", "7"},
|
|
41
|
+
"graded": "2026-11-09-model-tiers-rerun/mvp-validation.csv"},
|
|
42
|
+
{"trace": "2026-11-10-model-tiers-cases8-10/trace.jsonl",
|
|
43
|
+
"graded": "2026-11-10-model-tiers-cases8-10/mvp-validation.csv"}]},
|
|
44
|
+
{"id": "s6", "date": "2026-11-14", "label": "Grounding rule", "note": "Tool descriptions: base facts on tool output; NVD outage",
|
|
45
|
+
"degraded": True, "canaries": {"csv": "2026-11-14-grounding-sonnet/mvp-validation.csv"},
|
|
46
|
+
"sources": [{"trace": "2026-11-14-grounding-sonnet/trace.jsonl", "graded": "2026-11-14-grounding-sonnet/mvp-validation.csv"}]},
|
|
47
|
+
# s7 (2026-11-15, triage_cve news search) ran cases 3 and 10 only: in results/, not a dashboard session.
|
|
48
|
+
{"id": "s8", "date": "2026-11-15", "label": "Final eval", "note": "Grounding + news in triage_cve; NVD slow (latency invalid)",
|
|
49
|
+
"degraded": True, "canaries": {"csv": "2026-11-15-final-eval/sonnet.csv"},
|
|
50
|
+
"sources": [{"trace": f"2026-11-15-final-eval/{m}-trace.jsonl", "graded": f"2026-11-15-final-eval/{m}.csv"}
|
|
51
|
+
for m in ("sonnet", "haiku", "opus")]},
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
MODEL_LABELS = {"claude-haiku-5-5": "Haiku 5.5", "claude-sonnet-5-5": "Sonnet 5.5", "claude-opus-5-5": "Opus 5.5"}
|
|
55
|
+
|
|
56
|
+
# Human review: judge verdicts the project owner overturned, applied to every session (evals/human_review/).
|
|
57
|
+
OVERRIDES = Path(__file__).resolve().parent / "human_review" / "overrides.csv"
|
|
58
|
+
|
|
59
|
+
KPI_COLUMNS = ["session", "order", "date", "label", "note", "degraded", "model", "model_label", "runs", "excluded",
|
|
60
|
+
"passed", "pass_rate", "awaiting_review", "pass_rate_max", "judge_passed", "judge_pass_rate", "overturned", "made_up", "tool_ok", "canaries_run", "canaries_caught", "p50_s", "p95_s", "usd_per_answer", "usd_per_pass",
|
|
61
|
+
"cache_share", "input_cost_share", "reasoning_cost_share", "answer_cost_share", "app_usd", "judge_usd",
|
|
62
|
+
"source"]
|
|
63
|
+
CASE_COLUMNS = ["session", "model", "model_label", "case", "runs", "passed", "made_up"]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def made_up(failed) -> bool:
|
|
67
|
+
"""Trust metric: a wrong fact (R2, contradicts the tool output) or an unsupported one (R3, not in it)."""
|
|
68
|
+
return any(str(f).strip().startswith(("R2", "R3")) for f in failed)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def failed_list(text: str) -> list[str]:
|
|
72
|
+
return [f.strip() for f in text.split(";") if f.strip()]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def runs_from_csv(source: dict) -> list[dict]:
|
|
76
|
+
rows = csv.DictReader((RESULTS / source["csv"]).open())
|
|
77
|
+
return [{"model": r["answer_model"], "case": r["case_id"], "run": int(r["run"]), "result": r["result"],
|
|
78
|
+
"seconds": float(r["answer_seconds"]), "failed": failed_list(r["failed_checks"]), "error": ""}
|
|
79
|
+
for r in rows if r["row_type"] == "case" and r["round"] == source["round"]]
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def graded(path: str) -> dict:
|
|
83
|
+
"""(model, case, run) -> (result, failed checks) from a run's CSV."""
|
|
84
|
+
def failed(r): # runs graded before outage detection: the re-derived failure_type marks the outage
|
|
85
|
+
checks = failed_list(r["failed_checks"])
|
|
86
|
+
return (["upstream outage"] if r.get("failure_type") == "infrastructure" else []) + checks
|
|
87
|
+
return {(r["answer_model"], r["case_id"], int(r["run"])): (r["result"], failed(r))
|
|
88
|
+
for r in csv.DictReader((RESULTS / path).open()) if r["row_type"] == "case"}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def canaries(spec: dict | None) -> tuple:
|
|
92
|
+
"""(run, caught) for the judge canaries: deliberately wrong answers the judge must fail."""
|
|
93
|
+
if not spec:
|
|
94
|
+
return "", ""
|
|
95
|
+
rows = [r for r in csv.DictReader((RESULTS / spec["csv"]).open())
|
|
96
|
+
if r["row_type"] == "judge canary" and r["round"] == spec.get("round", r["round"])]
|
|
97
|
+
return len(rows), sum(r["result"].startswith("PASS") for r in rows)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def load_overrides() -> dict:
|
|
101
|
+
"""(session, model, case, run) -> set of criteria a human reviewer overturned."""
|
|
102
|
+
if not OVERRIDES.exists():
|
|
103
|
+
return {}
|
|
104
|
+
return {(r["session"], r["model"], r["case"], int(r["run"])): set(r["overturned"].split())
|
|
105
|
+
for r in csv.DictReader(OVERRIDES.open())}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def apply_review(run: dict, overturned: set, reviewed: bool = False) -> dict:
|
|
109
|
+
"""A run passes on review when every check it failed was overturned. Made-up facts drop if R3 was overturned.
|
|
110
|
+
|
|
111
|
+
awaiting: the run failed only on split judge votes and no human decision is recorded yet (an override row with
|
|
112
|
+
nothing overturned records an upheld fail).
|
|
113
|
+
"""
|
|
114
|
+
remaining = [f for f in run["failed"] if f.split(" ")[0] not in overturned]
|
|
115
|
+
passed = run["result"] == "PASS" or (bool(overturned) and not remaining)
|
|
116
|
+
return dict(run, judge_result=run["result"], result="PASS" if passed else "FAIL", made_up=made_up(remaining),
|
|
117
|
+
overturned=bool(overturned) and run["result"] != "PASS" and not remaining,
|
|
118
|
+
awaiting=not passed and not reviewed and needs_review(run["failed"]))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def from_trace(source: dict) -> tuple[list[dict], list[dict], list[dict]]:
|
|
122
|
+
spans = read_trace(RESULTS / source["trace"])
|
|
123
|
+
meta = next((s for s in spans if s["kind"] == "meta"), {})
|
|
124
|
+
default_model = meta.get("answer_model") or (meta.get("answer_models") or [None])[0]
|
|
125
|
+
keep = source.get("cases")
|
|
126
|
+
ok = lambda s: keep is None or str(s.get("case_id")) in keep # noqa: E731
|
|
127
|
+
grades = graded(source["graded"]) if source.get("graded") else {}
|
|
128
|
+
runs = []
|
|
129
|
+
for s in spans:
|
|
130
|
+
if s["kind"] != "case_run" or not ok(s):
|
|
131
|
+
continue
|
|
132
|
+
name = s.get("model") or default_model
|
|
133
|
+
result, failed = grades.get((name, str(s["case_id"]), s.get("run")), (s["result"], s.get("failed", [])))
|
|
134
|
+
runs.append({"model": name, "case": str(s["case_id"]), "run": s.get("run"), "result": result, "seconds": s["seconds"],
|
|
135
|
+
"failed": failed, "error": s.get("error") or next((f for f in failed if "API error" in str(f)
|
|
136
|
+
or str(f).startswith("upstream outage")), "")})
|
|
137
|
+
model = [dict(s, model=s.get("model") or default_model) for s in spans if s["kind"] == "model" and ok(s)]
|
|
138
|
+
judge = [s for s in spans if s["kind"] == "judge" and ok(s) and not s.get("canary")]
|
|
139
|
+
return runs, model, judge
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def share(part: float, whole: float):
|
|
143
|
+
return round(part / whole, 4) if whole else ""
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def main() -> int:
|
|
147
|
+
kpis, cases = [], []
|
|
148
|
+
overrides = load_overrides()
|
|
149
|
+
for order, session in enumerate(SESSIONS, 1):
|
|
150
|
+
runs, model_spans, judge_spans, traced = [], [], [], False
|
|
151
|
+
for source in session["sources"]:
|
|
152
|
+
if "csv" in source:
|
|
153
|
+
runs += runs_from_csv(source)
|
|
154
|
+
else:
|
|
155
|
+
r, m, j = from_trace(source)
|
|
156
|
+
runs, model_spans, judge_spans, traced = runs + r, model_spans + m, judge_spans + j, True
|
|
157
|
+
keys = [(session["id"], r["model"], r["case"], r["run"]) for r in runs]
|
|
158
|
+
runs = [apply_review(r, overrides.get(k, set()), k in overrides) for r, k in zip(runs, keys)]
|
|
159
|
+
judge_usd = sum(s.get("total_usd", 0) for s in judge_spans)
|
|
160
|
+
canary_counts = canaries(session.get("canaries"))
|
|
161
|
+
models = sorted({r["model"] for r in runs}, key=lambda m: list(MODEL_LABELS).index(m) if m in MODEL_LABELS else 99)
|
|
162
|
+
for name in models:
|
|
163
|
+
all_runs = [r for r in runs if r["model"] == name]
|
|
164
|
+
valid = [r for r in all_runs if not r["error"]]
|
|
165
|
+
n, passed = len(valid), sum(r["result"] == "PASS" for r in valid)
|
|
166
|
+
secs = [r["seconds"] for r in valid]
|
|
167
|
+
row = {"session": session["id"], "order": order, "date": session["date"], "label": session["label"],
|
|
168
|
+
"note": session["note"], "degraded": "yes" if session.get("degraded") else "no", "model": name,
|
|
169
|
+
"model_label": MODEL_LABELS.get(name, name), "runs": n, "excluded": len(all_runs) - n,
|
|
170
|
+
"passed": passed, "pass_rate": share(passed, n),
|
|
171
|
+
# pass_rate counts split-vote fails as fails until reviewed; pass_rate_max counts them as passes
|
|
172
|
+
"awaiting_review": sum(r["awaiting"] for r in valid),
|
|
173
|
+
"pass_rate_max": share(passed + sum(r["awaiting"] for r in valid), n),
|
|
174
|
+
"judge_passed": sum(r["judge_result"] == "PASS" for r in valid),
|
|
175
|
+
"judge_pass_rate": share(sum(r["judge_result"] == "PASS" for r in valid), n),
|
|
176
|
+
"overturned": sum(r["overturned"] for r in valid), "made_up": sum(r["made_up"] for r in valid),
|
|
177
|
+
# code checks: the right tools were called and their output holds the expected values
|
|
178
|
+
"tool_ok": sum(not any(not re.match(r"R\d", f) for f in r["failed"]) for r in valid),
|
|
179
|
+
"canaries_run": canary_counts[0], "canaries_caught": canary_counts[1],
|
|
180
|
+
"p50_s": round(percentile(secs, 50), 2), "p95_s": round(percentile(secs, 95), 2),
|
|
181
|
+
"source": "trace" if traced else "csv (no cost)"}
|
|
182
|
+
if traced:
|
|
183
|
+
keys = {(r["case"], r.get("run")) for r in valid} # cost of the answers we grade, not of excluded runs
|
|
184
|
+
spans = [s for s in model_spans if s["model"] == name and (str(s["case_id"]), s.get("run")) in keys]
|
|
185
|
+
usd = sum(s["total_usd"] for s in spans)
|
|
186
|
+
input_usd = sum(s["input_usd"] + s["cache_read_usd"] + s["cache_write_usd"] for s in spans)
|
|
187
|
+
known = [s for s in spans if s.get("thinking") is not None]
|
|
188
|
+
out_known = sum(s["output"] for s in known)
|
|
189
|
+
think_usd = sum(s["output_usd"] for s in spans) * (sum(s["thinking"] for s in known) / out_known) if out_known else 0
|
|
190
|
+
tokens_in = sum(s["input"] + s["cache_read"] + s["cache_write_5m"] + s["cache_write_1h"] for s in spans)
|
|
191
|
+
row.update({"usd_per_answer": round(usd / n, 5) if n else "", "usd_per_pass": round(usd / passed, 5) if passed else "",
|
|
192
|
+
"cache_share": share(sum(s["cache_read"] for s in spans), tokens_in),
|
|
193
|
+
"input_cost_share": share(input_usd, usd), "reasoning_cost_share": share(think_usd, usd),
|
|
194
|
+
"answer_cost_share": share(usd - input_usd - think_usd, usd), "app_usd": round(usd, 4),
|
|
195
|
+
"judge_usd": round(judge_usd * len(all_runs) / len(runs), 4)})
|
|
196
|
+
kpis.append(row)
|
|
197
|
+
by_case = defaultdict(list)
|
|
198
|
+
for r in valid:
|
|
199
|
+
by_case[r["case"]].append(r)
|
|
200
|
+
for case_id in sorted(by_case, key=lambda c: int(c) if c.isdigit() else 99):
|
|
201
|
+
group = by_case[case_id]
|
|
202
|
+
cases.append({"session": session["id"], "model": name, "model_label": MODEL_LABELS.get(name, name),
|
|
203
|
+
"case": case_id, "runs": len(group), "passed": sum(r["result"] == "PASS" for r in group),
|
|
204
|
+
"made_up": sum(r["made_up"] for r in group)})
|
|
205
|
+
OUT.mkdir(parents=True, exist_ok=True)
|
|
206
|
+
for path, columns, rows in [(OUT / "kpis.csv", KPI_COLUMNS, kpis), (OUT / "cases.csv", CASE_COLUMNS, cases)]:
|
|
207
|
+
with path.open("w", newline="") as handle:
|
|
208
|
+
writer = csv.DictWriter(handle, fieldnames=columns)
|
|
209
|
+
writer.writeheader()
|
|
210
|
+
writer.writerows(rows)
|
|
211
|
+
print(f"wrote {path.relative_to(RESULTS.parent.parent)} ({len(rows)} rows)")
|
|
212
|
+
return 0
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
if __name__ == "__main__":
|
|
216
|
+
sys.exit(main())
|
|
@@ -34,7 +34,7 @@ cases:
|
|
|
34
34
|
title: Engineer triage prompt, NVD score beats the vendor's
|
|
35
35
|
tests: The triage_cve prompt (engineer) on a CVE where the vendor scored 5.4 and NVD scored 8.1
|
|
36
36
|
prompt: {name: triage_cve, arguments: {cve_id: CVE-2026-103678, audience: engineer}}
|
|
37
|
-
must_call: [lookup_cve, check_kev, get_epss]
|
|
37
|
+
must_call: [lookup_cve, check_kev, get_epss, search_cve_news]
|
|
38
38
|
expect:
|
|
39
39
|
- {tool: lookup_cve, cve_id: CVE-2026-103678, fields: {cvss_score: 8.1, cvss_version: "3.1", cvss_source: NVD, urgency: patch this week}}
|
|
40
40
|
applies: [R1, R2, R3, R4, R6, R7]
|
|
@@ -111,7 +111,7 @@ cases:
|
|
|
111
111
|
title: Executive summary prompt
|
|
112
112
|
tests: The triage_cve prompt (exec) on the xz backdoor, covering get_epss and the exec format
|
|
113
113
|
prompt: {name: triage_cve, arguments: {cve_id: CVE-2024-3094, audience: exec}}
|
|
114
|
-
must_call: [lookup_cve, check_kev, get_epss]
|
|
114
|
+
must_call: [lookup_cve, check_kev, get_epss, search_cve_news]
|
|
115
115
|
expect:
|
|
116
116
|
- {tool: lookup_cve, cve_id: CVE-2024-3094, fields: {cvss_score: 10.0, urgency: patch now}}
|
|
117
117
|
- {tool: get_epss, cve_id: CVE-2024-3094, fields: {epss_available: true}}
|