@clear-capabilities/agentic-security-scanner 0.75.0 → 0.76.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.76.0 — Command consolidation: 80 → 38 slash commands
4
+
5
+ Simplified the command surface from 80 individual slash commands down to
6
+ 38 by merging related commands into consolidated routers with flags.
7
+ No functionality removed — all logic preserved behind flags on fewer,
8
+ more discoverable parent commands.
9
+
10
+ ### New consolidated commands
11
+
12
+ | New command | Absorbed | Routing |
13
+ |---|---|---|
14
+ | `/audit` | db-audit, auth-audit, rate-limit-check, webhook-audit, env-check, csp-cors, deploy-check, launch-check, llm-cost-ceiling, prompt-firewall | `--target <area>` or `--all` |
15
+ | `/threat` | threat-model, personas, playbook, bounty, adversary, attack-surface, trust-boundary, spof | `--view <name>` |
16
+ | `/llm` | llm-redteam, jailbreak-detector, llm-eval | `--mode redteam\|jailbreak\|eval` |
17
+ | `/ci` | ci-gate, predeploy-gate, install-hooks | default / `--predeploy` / `--hooks` |
18
+ | `/generate` | privacy-docs, disaster-playbook, social-media, security-tests | `--type privacy\|disaster\|social\|tests` |
19
+ | `/scanner` | self-test, diff-scan, scan-baseline, concurrency-bugs, spec-drift | `--self-test` / `--diff` / `--baseline` / `--concurrency` / `--spec-drift` |
20
+
21
+ ### Commands absorbed into existing commands
22
+
23
+ - `/why-fired` → `/explain --provenance --finding <id>`
24
+ - `/why-not` → `/explain --gap <CWE>`
25
+ - `/install-script-audit` → `/supply-chain-check --show install-scripts`
26
+ - `/vendor-audit` → `/supply-chain-check --show vendored`
27
+
28
+ ### Deleted deprecated aliases (11)
29
+
30
+ ci-gate-multi, rotate-key-auto, trim-dead-code, trim-dependencies,
31
+ story-explain, security-badge, security-onepager, trust-page,
32
+ dep-pinning, dep-freshness, dep-alternatives.
33
+
34
+ ## 0.75.1 — /agent-harness-assessment + interactive compliance routing + README badge relocation
35
+
36
+ Three follow-ups to the 0.75.0 surface:
37
+
38
+ **Renamed `/executive-summary` → `/agent-harness-assessment`.** The
39
+ previous name framed this as a finance-style report. The actual artifact
40
+ is an assessment of the AI-agent harness: a CISO/buyer reading it wants
41
+ to know whether to trust an AI agent working in this project, not just
42
+ see a posture grade. The new name reflects the audience.
43
+
44
+ **Interactive compliance step.** After printing the six-control
45
+ assessment, the command now asks (via AskUserQuestion) which compliance
46
+ frameworks the reader wants generated NOW — NIST AI 600-1, OWASP ASVS,
47
+ OWASP LLM Top 10 (2025), or none. For each selection, the model invokes
48
+ `/compliance-report <fw>` with the matching positional argument
49
+ (`nist`, `asvs`, `llm`) so an auditor-ready file lands on disk. The
50
+ Compliance section in the assessment now says what evidence COULD be
51
+ produced; the interactive step closes the loop to evidence that EXISTS.
52
+
53
+ **README "Status badge" section relocated** from the top-of-README hero
54
+ region into the Security Pros section, between the 5-minute pro setup
55
+ and the full pro catalog. Adopting the badge is a pro-shaped step
56
+ (it requires CI wiring + a baseline scan). Three example badges now
57
+ render on three distinct lines via trailing `<br>` so the severity
58
+ ladder is legible at a glance.
59
+
3
60
  ## 0.75.0 — /executive-summary: CISO-facing six-control posture report
4
61
 
5
62
  New top-level command for buyer-questionnaire / diligence / CISO use.
@@ -1,7 +1,7 @@
1
1
  {
2
- "scanId": "8f54c078-a0c8-41d7-8100-62ec5a527f14",
3
- "startedAt": "2026-05-21T15:57:04.526Z",
4
- "durationMs": 282,
2
+ "scanId": "d01219ed-b5bf-4fde-bf3c-4f31c0ceaa41",
3
+ "startedAt": "2026-05-21T16:13:40.849Z",
4
+ "durationMs": 281,
5
5
  "scanned": {
6
6
  "files": 7,
7
7
  "lines": 0
@@ -1,7 +1,7 @@
1
1
  {
2
- "scanId": "8f54c078-a0c8-41d7-8100-62ec5a527f14",
3
- "startedAt": "2026-05-21T15:57:04.526Z",
4
- "durationMs": 282,
2
+ "scanId": "d01219ed-b5bf-4fde-bf3c-4f31c0ceaa41",
3
+ "startedAt": "2026-05-21T16:13:40.849Z",
4
+ "durationMs": 281,
5
5
  "scanned": {
6
6
  "files": 7,
7
7
  "lines": 0
@@ -1 +1 @@
1
- db7c9e1d0d4480b37a981b7b3c87f70306042f6e8838cb6ea2bfafdd12ab20d2
1
+ ec16cd87a90fed8ff54e93a2bc69d4e8053d22cd80ffc701a4668d3c3e929f7d
@@ -1,15 +1,4 @@
1
1
  [
2
- {
3
- "timestamp": "2026-05-19T16:01:41.762Z",
4
- "label": "scan",
5
- "total": 0,
6
- "critical": 0,
7
- "high": 0,
8
- "medium": 0,
9
- "low": 0,
10
- "kev": 0,
11
- "ids": []
12
- },
13
2
  {
14
3
  "timestamp": "2026-05-19T18:33:22.830Z",
15
4
  "label": "scan",
@@ -466,5 +455,21 @@
466
455
  "toctou-fs:agentic-security-consistency.js:66",
467
456
  "toctou-fs:agentic-security.js:1105"
468
457
  ]
458
+ },
459
+ {
460
+ "timestamp": "2026-05-21T16:13:41.128Z",
461
+ "label": "scan",
462
+ "total": 4,
463
+ "critical": 0,
464
+ "high": 0,
465
+ "medium": 4,
466
+ "low": 0,
467
+ "kev": 0,
468
+ "ids": [
469
+ "toctou-fs:agentic-security-audit.js:55",
470
+ "toctou-fs:agentic-security-consistency.js:44",
471
+ "toctou-fs:agentic-security-consistency.js:66",
472
+ "toctou-fs:agentic-security.js:1105"
473
+ ]
469
474
  }
470
475
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "firstScanDate": "2026-05-15T12:24:29.316Z",
3
- "lastScanDate": "2026-05-21T15:57:04.828Z",
4
- "totalScans": 122,
3
+ "lastScanDate": "2026-05-21T16:13:41.148Z",
4
+ "totalScans": 123,
5
5
  "daysCleanCritical": 4,
6
6
  "lastCleanDate": "2026-05-21",
7
7
  "lastCriticalDate": null,
@@ -137,7 +137,7 @@ function printBanner(args) {
137
137
  BOLD: '\x1b[1m',
138
138
  RESET: '\x1b[0m',
139
139
  } : { FROG:'', DEEP:'', CREAM:'', DIM:'', BOLD:'', RESET:'' };
140
- const v = '0.75.0';
140
+ const v = '0.75.1';
141
141
  const compact = !args.flags.full;
142
142
  if (compact) {
143
143
  const lines = [
@@ -1665,7 +1665,7 @@ async function main() {
1665
1665
  }
1666
1666
  process.exit(0);
1667
1667
  }
1668
- case 'version': console.log('agentic-security 0.75.0 · created by ClearCapabilities.Com'); process.exit(0);
1668
+ case 'version': console.log('agentic-security 0.75.1 · created by ClearCapabilities.Com'); process.exit(0);
1669
1669
  case 'banner': { printBanner(args); process.exit(0); }
1670
1670
  case 'harness': process.exit(await cmdHarness(args));
1671
1671
  case 'scan-baseline': process.exit(await cmdScanBaseline(args));
@@ -0,0 +1,152 @@
1
+ export const id = 838;
2
+ export const ids = [838];
3
+ export const modules = {
4
+
5
+ /***/ 7838:
6
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
+
8
+ __webpack_require__.r(__webpack_exports__);
9
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
+ /* harmony export */ runProjectLinter: () => (/* binding */ runProjectLinter),
11
+ /* harmony export */ verifyFix: () => (/* binding */ verifyFix),
12
+ /* harmony export */ verifyPatch: () => (/* binding */ verifyPatch)
13
+ /* harmony export */ });
14
+ /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1421);
15
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3024);
16
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6760);
17
+ /* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3291);
18
+ // Closed-loop /fix verification (Sentinel-parity FR-L4-4, FR-L4-5).
19
+ //
20
+ // Given a candidate patch (the new file content + the finding stableId being
21
+ // fixed), verify it:
22
+ //
23
+ // 1. The original finding's stableId no longer fires on the patched file.
24
+ // 2. No new findings at severity ≥ medium were introduced by the patch.
25
+ // 3. The project's existing linter (when present) passes on the patched file.
26
+ //
27
+ // If any of those fail, the caller is expected to NOT apply the patch and
28
+ // instead surface a "fix plan" — a numbered list of steps the engineer can
29
+ // follow — rather than dump a broken patch on the user.
30
+
31
+
32
+
33
+
34
+
35
+
36
+ const SEVERITY_RANK = { critical: 0, high: 1, medium: 2, low: 3, info: 4 };
37
+
38
+ // Run a focused re-scan over just the patched file(s) using the in-memory
39
+ // engine. No filesystem write needed — we hand the new content in via the
40
+ // fileContents map.
41
+ async function verifyPatch({
42
+ scanRoot,
43
+ originalFindingStableId,
44
+ files, // { [relPath]: newContent }
45
+ depFileContents = {},
46
+ } = {}) {
47
+ if (!files || typeof files !== 'object') return { ok: false, reason: 'no-files-provided' };
48
+ const fileContents = { ...files };
49
+ let scan;
50
+ try {
51
+ scan = await (0,_engine_js__WEBPACK_IMPORTED_MODULE_3__/* .runFullScan */ .wW)({ fileContents, depFileContents, scanRoot }, () => {});
52
+ } catch (e) {
53
+ return { ok: false, reason: 'rescan-failed', error: e.message };
54
+ }
55
+ const findings = (scan && scan.findings) || [];
56
+ const stillHasOriginal = !!originalFindingStableId &&
57
+ findings.some(f => f.stableId === originalFindingStableId);
58
+ if (stillHasOriginal) {
59
+ return { ok: false, reason: 'original-finding-still-present', stableId: originalFindingStableId };
60
+ }
61
+ const introducedHighOrAbove = findings.filter(f =>
62
+ (SEVERITY_RANK[f.severity] ?? 9) <= SEVERITY_RANK.medium);
63
+ // Don't count findings on lines outside the patched files — but our
64
+ // fileContents map IS the patched files, so every finding is in-scope.
65
+ return {
66
+ ok: introducedHighOrAbove.length === 0,
67
+ reason: introducedHighOrAbove.length === 0 ? 'verified' : 'introduced-new-findings',
68
+ introduced: introducedHighOrAbove.map(f => ({
69
+ vuln: f.vuln, file: f.file, line: f.line, severity: f.severity,
70
+ stableId: f.stableId,
71
+ })),
72
+ };
73
+ }
74
+
75
+ // Detect which linter the project uses and run it on the patched files.
76
+ // Returns { ok, runner, output } or { ok: true, runner: 'none' } when no
77
+ // linter is configured (silent pass).
78
+ function runProjectLinter(scanRoot, filePaths) {
79
+ if (!scanRoot || !Array.isArray(filePaths) || filePaths.length === 0) {
80
+ return { ok: true, runner: 'none' };
81
+ }
82
+ const has = (p) => { try { return node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(node_path__WEBPACK_IMPORTED_MODULE_2__.join(scanRoot, p)); } catch { return false; } };
83
+ // Pick the linter by config file present in the repo root.
84
+ const jsFiles = filePaths.filter(f => /\.(?:js|jsx|ts|tsx|mjs|cjs)$/i.test(f));
85
+ const pyFiles = filePaths.filter(f => /\.py$/i.test(f));
86
+ const goFiles = filePaths.filter(f => /\.go$/i.test(f));
87
+ const javaFiles = filePaths.filter(f => /\.java$/i.test(f));
88
+
89
+ if (jsFiles.length && (has('.eslintrc') || has('.eslintrc.json') || has('.eslintrc.js') || has('eslint.config.js') || has('eslint.config.mjs'))) {
90
+ return runLinter(scanRoot, 'eslint', ['--no-error-on-unmatched-pattern', ...jsFiles]);
91
+ }
92
+ if (pyFiles.length && (has('pyproject.toml') || has('ruff.toml') || has('.ruff.toml'))) {
93
+ return runLinter(scanRoot, 'ruff', ['check', ...pyFiles]);
94
+ }
95
+ if (pyFiles.length && has('.flake8')) {
96
+ return runLinter(scanRoot, 'flake8', pyFiles);
97
+ }
98
+ if (goFiles.length && (has('.golangci.yml') || has('.golangci.yaml'))) {
99
+ return runLinter(scanRoot, 'golangci-lint', ['run', ...goFiles]);
100
+ }
101
+ if (javaFiles.length && has('checkstyle.xml')) {
102
+ return runLinter(scanRoot, 'checkstyle', ['-c', 'checkstyle.xml', ...javaFiles]);
103
+ }
104
+ return { ok: true, runner: 'none' };
105
+ }
106
+
107
+ function runLinter(cwd, cmd, args) {
108
+ let r;
109
+ try {
110
+ r = (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)(cmd, args, { cwd, encoding: 'utf8', timeout: 60_000 });
111
+ } catch (e) {
112
+ return { ok: true, runner: cmd, skipped: true, reason: 'binary-missing', error: e.message };
113
+ }
114
+ if (r.error && r.error.code === 'ENOENT') {
115
+ return { ok: true, runner: cmd, skipped: true, reason: 'binary-missing' };
116
+ }
117
+ if (r.status === null) {
118
+ return { ok: false, runner: cmd, reason: 'timed-out', output: (r.stderr || r.stdout || '').slice(-2000) };
119
+ }
120
+ return {
121
+ ok: r.status === 0,
122
+ runner: cmd,
123
+ exitCode: r.status,
124
+ output: ((r.stderr || '') + (r.stdout || '')).slice(-2000),
125
+ };
126
+ }
127
+
128
+ // Top-level verify: re-scan + lint. Returns the combined verdict + a
129
+ // human-readable summary string suitable for surfacing to the user.
130
+ async function verifyFix({
131
+ scanRoot,
132
+ originalFindingStableId,
133
+ files,
134
+ depFileContents,
135
+ } = {}) {
136
+ const rescan = await verifyPatch({ scanRoot, originalFindingStableId, files, depFileContents });
137
+ const lint = runProjectLinter(scanRoot, Object.keys(files || {}));
138
+ const ok = rescan.ok && (lint.ok || lint.skipped);
139
+ const summary = [
140
+ `re-scan: ${rescan.ok ? 'PASS' : 'FAIL — ' + rescan.reason}`,
141
+ `linter: ${lint.runner === 'none' ? 'skipped (no linter config)'
142
+ : lint.skipped ? `${lint.runner} not installed`
143
+ : lint.ok ? `${lint.runner} PASS`
144
+ : `${lint.runner} FAIL (exit ${lint.exitCode})`}`,
145
+ ].join('\n');
146
+ return { ok, rescan, lint, summary };
147
+ }
148
+
149
+
150
+ /***/ })
151
+
152
+ };