guardlink 1.3.0 → 1.4.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 +44 -0
- package/README.md +43 -1
- package/dist/agents/launcher.d.ts +1 -1
- package/dist/agents/launcher.js +1 -1
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +300 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +38 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/suggest.d.ts +1 -0
- package/dist/mcp/suggest.d.ts.map +1 -1
- package/dist/mcp/suggest.js +1 -0
- package/dist/mcp/suggest.js.map +1 -1
- package/dist/parser/parse-project.d.ts.map +1 -1
- package/dist/parser/parse-project.js +103 -0
- package/dist/parser/parse-project.js.map +1 -1
- package/dist/tui/commands.d.ts +3 -0
- package/dist/tui/commands.d.ts.map +1 -1
- package/dist/tui/commands.js +297 -39
- package/dist/tui/commands.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +17 -1
- package/dist/tui/index.js.map +1 -1
- package/dist/types/index.d.ts +39 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/workspace/index.d.ts +12 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +9 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/link.d.ts +91 -0
- package/dist/workspace/link.d.ts.map +1 -0
- package/dist/workspace/link.js +581 -0
- package/dist/workspace/link.js.map +1 -0
- package/dist/workspace/merge.d.ts +104 -0
- package/dist/workspace/merge.d.ts.map +1 -0
- package/dist/workspace/merge.js +752 -0
- package/dist/workspace/merge.js.map +1 -0
- package/dist/workspace/metadata.d.ts +34 -0
- package/dist/workspace/metadata.d.ts.map +1 -0
- package/dist/workspace/metadata.js +181 -0
- package/dist/workspace/metadata.js.map +1 -0
- package/dist/workspace/types.d.ts +134 -0
- package/dist/workspace/types.d.ts.map +1 -0
- package/dist/workspace/types.js +12 -0
- package/dist/workspace/types.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,50 @@ All notable changes to GuardLink CLI will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.4.1] — 2026-03-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **GAL reference (`/gal`, `guardlink gal`)**: Fixed all syntax examples to match the actual parser — descriptions now correctly show `-- "quoted text"` format instead of the non-functional `: text` format; severity now shows bracket notation `[high]` / `[P0]` instead of `severity:high`; `@flows` now shows `->` arrow syntax instead of `to`; `@validates` now shows `for` preposition instead of `on`; `@owns` now includes the required `for` preposition; `@mitigates` now documents `using` as the primary keyword (with `with` as v1 compat)
|
|
13
|
+
- **GAL reference**: Added missing documentation for external references (`cwe:CWE-89`, `owasp:A03:2021`, `capec:CAPEC-66`, `attack:T1190`) on `@threat` and `@exposes` annotations
|
|
14
|
+
- **GAL reference**: Added missing `@boundary` alternate syntaxes (`@boundary between A and B`, `@boundary A | B`) and `(#id)` support
|
|
15
|
+
- **GAL reference**: Added missing standalone `@shield` single-line marker (was only documenting `@shield:begin/end` blocks)
|
|
16
|
+
- **TUI `/help`**: Added missing `/unannotated` command to the help output (was registered and functional but not listed)
|
|
17
|
+
- **CLI version**: Fixed `guardlink --version` reporting `1.1.0` instead of the actual package version
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **GAL reference**: Added new "External References" section explaining `cwe:`, `owasp:`, `capec:`, `attack:` ref syntax
|
|
22
|
+
- **GAL reference**: Updated Tips section with description format, severity format, and `@flows ->` syntax reminders
|
|
23
|
+
- **Annotations**: Changed `@comment` to `@audit` on agent-launcher timeout note for better governance visibility
|
|
24
|
+
- **Annotations**: Added `@audit` to MCP suggest module, added workspace-related controls to definitions
|
|
25
|
+
|
|
26
|
+
## [1.4.0] — 2026-02-27
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **Workspace**: Multi-repo workspace support — link N service repos into a unified threat model with cross-repo tag resolution, weekly diff tracking, and merged dashboards
|
|
31
|
+
- **Workspace**: `guardlink link-project <repos...> --workspace <name> --registry <url>` — scaffold workspace.yaml in each repo, auto-detect repo names from git/package.json/Cargo.toml, inject cross-repo context into agent instruction files
|
|
32
|
+
- **Workspace**: `guardlink link-project --add <repo> --from <existing>` — add a repo to an existing workspace with sibling auto-discovery
|
|
33
|
+
- **Workspace**: `guardlink link-project --remove <name> --from <existing>` — remove a repo from workspace, update all siblings found on disk
|
|
34
|
+
- **Workspace**: `guardlink merge <files...>` — merge N per-repo report JSONs into a unified MergedReport with tag registry, cross-repo reference resolution, stale/schema warnings, and aggregated stats
|
|
35
|
+
- **Workspace**: `--diff-against <prev.json>` flag on merge for week-over-week risk tracking (assets/threats/mitigations/exposures added/removed, risk trend, unresolved ref changes)
|
|
36
|
+
- **Workspace**: `-o <file>` dashboard HTML output + `--json <file>` merged JSON output + `--summary-only` text mode
|
|
37
|
+
- **CLI**: `guardlink report --format json` — JSON report output with metadata (repo, workspace, commit SHA, schema version)
|
|
38
|
+
- **TUI**: `/workspace` — show workspace config, sibling repos, registries
|
|
39
|
+
- **TUI**: `/link` — link repos with `--add`/`--remove` support
|
|
40
|
+
- **TUI**: `/merge` — merge reports with `--json`, `--diff-against`, `-o` flags
|
|
41
|
+
- **MCP**: `guardlink_workspace_info` tool — returns workspace name, this_repo identity, sibling tag prefixes, and cross-repo annotation rules for agents
|
|
42
|
+
- **Parser**: External reference detection — scans relationship annotations for tags with dot-prefix matching sibling repo names from workspace.yaml, populates `ThreatModel.external_refs`
|
|
43
|
+
- **Types**: `ExternalRef` interface, `ThreatModel.external_refs` field, `ReportMetadata` with repo/workspace/commit_sha/schema_version
|
|
44
|
+
- **CI**: `examples/ci/per-repo-report.yml` — per-repo workflow: validate on PRs (diff + SARIF + PR comment), generate + upload report JSON on push to main
|
|
45
|
+
- **CI**: `examples/ci/workspace-merge.yml` — weekly workspace merge workflow: download all repo artifacts, merge, dashboard, weekly diff, optional GitHub Pages + Slack
|
|
46
|
+
- **Docs**: `docs/WORKSPACE.md` — multi-repo setup guide, workspace.yaml spec, cross-repo annotation rules, merge behavior, CI integration, weekly workflow
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- **MCP**: Server version bumped to 1.4.0
|
|
51
|
+
|
|
8
52
|
## [1.3.0] — 2026-02-27
|
|
9
53
|
|
|
10
54
|
### Added
|
package/README.md
CHANGED
|
@@ -59,6 +59,9 @@ To uninstall: `npm unlink -g guardlink`
|
|
|
59
59
|
# Initialize in your project (detects your AI agent automatically)
|
|
60
60
|
guardlink init
|
|
61
61
|
|
|
62
|
+
# Let AI annotate your project - Launch a coding agent to add annotations
|
|
63
|
+
guardlink annotate [prompt]
|
|
64
|
+
|
|
62
65
|
# Let your AI coding agent annotate, or write annotations manually
|
|
63
66
|
# Then validate
|
|
64
67
|
guardlink validate .
|
|
@@ -151,6 +154,7 @@ GuardLink ships an MCP server and behavioral directives for AI coding agents. Af
|
|
|
151
154
|
| `guardlink_dashboard` | Generate HTML dashboard |
|
|
152
155
|
| `guardlink_sarif` | Export SARIF 2.1.0 |
|
|
153
156
|
| `guardlink_diff` | Compare threat model against a git ref |
|
|
157
|
+
| `guardlink_workspace_info` | Workspace config, sibling repos, tag prefixes for cross-repo annotations |
|
|
154
158
|
|
|
155
159
|
**Resources:** `guardlink://model`, `guardlink://definitions`, `guardlink://config`
|
|
156
160
|
|
|
@@ -161,6 +165,7 @@ GuardLink ships an MCP server and behavioral directives for AI coding agents. Af
|
|
|
161
165
|
| Command | Description |
|
|
162
166
|
|---------|-------------|
|
|
163
167
|
| `guardlink init [dir]` | Initialize project with definitions, config, and agent integration |
|
|
168
|
+
| `guardlink annotate [prompt]` | Launch a coding agent to add annotations |
|
|
164
169
|
| `guardlink parse [dir]` | Parse all annotations, output ThreatModel JSON |
|
|
165
170
|
| `guardlink status [dir]` | Coverage summary: assets, threats, mitigations, exposures |
|
|
166
171
|
| `guardlink validate [dir]` | Check for syntax errors, dangling refs, duplicate IDs |
|
|
@@ -173,12 +178,16 @@ GuardLink ships an MCP server and behavioral directives for AI coding agents. Af
|
|
|
173
178
|
| `guardlink sarif [dir]` | Export unmitigated exposures as SARIF 2.1.0 |
|
|
174
179
|
| `guardlink threat-report [fw]` | AI threat report (stride/dread/pasta/attacker/rapid/general) |
|
|
175
180
|
| `guardlink threat-reports` | List saved AI threat reports |
|
|
176
|
-
| `guardlink annotate [prompt]` | Launch a coding agent to add annotations |
|
|
177
181
|
| `guardlink review [dir]` | Interactive governance review — accept, remediate, or skip unmitigated exposures |
|
|
178
182
|
| `guardlink review --list` | List reviewable exposures without prompting |
|
|
179
183
|
| `guardlink clear [dir]` | Remove all annotations from source files (with `--dry-run` preview) |
|
|
180
184
|
| `guardlink sync [dir]` | Sync agent instruction files with current threat model |
|
|
181
185
|
| `guardlink unannotated [dir]` | List source files with no annotations |
|
|
186
|
+
| `guardlink link-project <repos...>` | Link repos into a shared workspace for cross-repo threat modeling |
|
|
187
|
+
| `guardlink link-project --add <repo>` | Add a repo to an existing workspace |
|
|
188
|
+
| `guardlink link-project --remove <name>` | Remove a repo from a workspace |
|
|
189
|
+
| `guardlink merge <files...>` | Merge per-repo report JSONs into a unified workspace dashboard |
|
|
190
|
+
| `guardlink report --format json` | Generate report JSON with metadata (repo, workspace, commit SHA) |
|
|
182
191
|
| `guardlink config` | Set AI provider and API key |
|
|
183
192
|
| `guardlink mcp` | Start MCP server for AI agent integration |
|
|
184
193
|
|
|
@@ -282,6 +291,10 @@ jobs:
|
|
|
282
291
|
|
|
283
292
|
See [`examples/github-action.yml`](examples/github-action.yml) for a full example with PR comments and SARIF upload.
|
|
284
293
|
|
|
294
|
+
### Multi-Repo CI
|
|
295
|
+
|
|
296
|
+
For workspace setups, GuardLink provides two additional workflow templates: a per-repo workflow that generates report JSON artifacts on every push, and a workspace merge workflow that runs weekly to combine all repos into a unified dashboard. See the [CI setup guide](examples/ci/README.md) for step-by-step instructions.
|
|
297
|
+
|
|
285
298
|
### What CI Catches
|
|
286
299
|
|
|
287
300
|
- **New route, no annotations:** `guardlink diff` shows "+1 endpoint, 0 mitigations" — the team sees the gap.
|
|
@@ -294,6 +307,35 @@ See [`examples/github-action.yml`](examples/github-action.yml) for a full exampl
|
|
|
294
307
|
|
|
295
308
|
---
|
|
296
309
|
|
|
310
|
+
## Multi-Repo Workspaces
|
|
311
|
+
|
|
312
|
+
In microservices architectures, a single repo only has part of the security picture. `PaymentService` is defined in `repo-payments`, exposed in `repo-gateway`, mitigated in `repo-auth-lib`. GuardLink workspaces link these repos so the threat model spans service boundaries.
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Link three repos into a workspace
|
|
316
|
+
guardlink link-project ./payment-svc ./auth-lib ./api-gateway \
|
|
317
|
+
--workspace acme-platform
|
|
318
|
+
|
|
319
|
+
# Each repo gets .guardlink/workspace.yaml + agent files updated with cross-repo context
|
|
320
|
+
# Agents now know about sibling services and use tag prefixes like #payment-svc.refund
|
|
321
|
+
|
|
322
|
+
# Generate per-repo JSON reports (in each repo or in CI)
|
|
323
|
+
guardlink report --format json -o guardlink-report.json
|
|
324
|
+
|
|
325
|
+
# Merge all reports into a unified dashboard
|
|
326
|
+
guardlink merge payment-svc.json auth-lib.json api-gateway.json \
|
|
327
|
+
-o dashboard.html --json merged.json
|
|
328
|
+
|
|
329
|
+
# Week-over-week diff for security leads
|
|
330
|
+
guardlink merge *.json --diff-against last-week.json --json merged.json
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Annotations reference sibling repos by tag prefix — `@flows #request from #api-gateway.router to #payment-svc.refund` — and these references resolve during merge. `guardlink validate` flags them as external refs locally, but they're expected and won't block CI.
|
|
334
|
+
|
|
335
|
+
For automated weekly dashboards, see the [CI setup guide](examples/ci/README.md). Full workspace documentation: [docs/WORKSPACE.md](docs/WORKSPACE.md).
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
297
339
|
## Real-World Results
|
|
298
340
|
|
|
299
341
|
We tested GuardLink + Claude Code on [vuln-node.js-express.js-app](https://github.com/SirAppSec/vuln-node.js-express.js-app), a deliberately vulnerable Express.js application with 37 documented vulnerability types.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @exposes #agent-launcher to #prompt-injection [medium] cwe:CWE-77 -- "User prompt passed to agent CLI as argument"
|
|
14
14
|
* @audit #agent-launcher -- "Prompt content is opaque to agent binary; injection risk depends on agent implementation"
|
|
15
15
|
* @exposes #agent-launcher to #dos [low] cwe:CWE-400 -- "No timeout on foreground spawn; agent controls duration"
|
|
16
|
-
* @
|
|
16
|
+
* @audit #agent-launcher -- "Timeout intentionally omitted for interactive sessions; inline mode has implicit control"
|
|
17
17
|
* @flows UserPrompt -> #agent-launcher via launchAgent -- "Prompt input path"
|
|
18
18
|
* @flows #agent-launcher -> AgentProcess via spawn -- "Process spawn path"
|
|
19
19
|
* @flows AgentProcess -> #agent-launcher via stdout -- "Agent output capture"
|
package/dist/agents/launcher.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @exposes #agent-launcher to #prompt-injection [medium] cwe:CWE-77 -- "User prompt passed to agent CLI as argument"
|
|
14
14
|
* @audit #agent-launcher -- "Prompt content is opaque to agent binary; injection risk depends on agent implementation"
|
|
15
15
|
* @exposes #agent-launcher to #dos [low] cwe:CWE-400 -- "No timeout on foreground spawn; agent controls duration"
|
|
16
|
-
* @
|
|
16
|
+
* @audit #agent-launcher -- "Timeout intentionally omitted for interactive sessions; inline mode has implicit control"
|
|
17
17
|
* @flows UserPrompt -> #agent-launcher via launchAgent -- "Prompt input path"
|
|
18
18
|
* @flows #agent-launcher -> AgentProcess via spawn -- "Process spawn path"
|
|
19
19
|
* @flows AgentProcess -> #agent-launcher via stdout -- "Agent output capture"
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* guardlink mcp Start MCP server (stdio) for Claude Code, Cursor, etc.
|
|
19
19
|
* guardlink tui [dir] Interactive TUI with slash commands + AI chat
|
|
20
20
|
* guardlink gal Display GAL annotation language quick reference
|
|
21
|
+
* guardlink link-project <repos...> Link repos into a shared workspace
|
|
22
|
+
* guardlink merge <files...> Merge repo reports into unified dashboard
|
|
21
23
|
*
|
|
22
24
|
* @exposes #cli to #path-traversal [high] cwe:CWE-22 -- "User-supplied dir argument resolved via path.resolve"
|
|
23
25
|
* @mitigates #cli against #path-traversal using #path-validation -- "resolve() canonicalizes paths; cwd-relative by design"
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG"}
|